Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Shadows passing through walls.

Author
Message
Jediam
14
Years of Service
User Offline
Joined: 14th Apr 2012
Location:
Posted: 2nd May 2012 01:39
Hello everyone,

Does anyone using shadows find that they "pass through walls" when you move away from a building model? I have a .x building model with a point light on the outside of it. When the light shines through the model, you can see the shadows and the light from the windows. However, when I move away from the model, the shadows move to the outside of the building. The shadow position is set to the point light which remains stationary as the camera moves. I'm not sure if the problem has to do with the shadows, camera clipping, or something else entirely. Thank you for your help.
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 2nd May 2012 12:28
screenshot please

«It's the Shader, shader me this, shader me that»
Jediam
14
Years of Service
User Offline
Joined: 14th Apr 2012
Location:
Posted: 2nd May 2012 13:19
Hello mrHandy,

Here are two pictures of the building/church that I'm working on. The first is of the sanctuary where you can see the shadows being cast through the windows from your left. The second is from the outside; the light source (point light) is still on the left. The same shadows from the interior shouldn't appear on the exterior. The model of the church is .x and I had converted all limbs to objects, made meshes from the objects, then removed the limbs. Next,I selected the wall which is casting the shadows and set shadow shading to it using the GPU for the shading(value = 1). I also am using the mesh generated from the wall object for shading. I haven't figured out how to attach more than one image at a time when uploading pictures. I might have to post more than once to get both images. Thanks for your help.
Jediam
14
Years of Service
User Offline
Joined: 14th Apr 2012
Location:
Posted: 2nd May 2012 13:22
Here's the second image. I wasn't able to get the File Uploader applet to work. I think this is how multiple images are uploaded simultaneously. I also don't know how to enable someone to view the image in addition to having to download it. Please let me know. Thanks.
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 2nd May 2012 14:22
that's how stencil shadows work, they go through all objects, there's nothing you can do about it

Jediam
14
Years of Service
User Offline
Joined: 14th Apr 2012
Location:
Posted: 2nd May 2012 14:53
Hello Brendy boy,
Can camera clipping isolate just shadows? I'm thinking maybe a clipping plane can be set to all exterior surfaces of the building. When the camera moves to the exterior, the shadow clipping can be turned on for a given plane or maybe multiple planes simultaneously. Let me know. Thanks.
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 2nd May 2012 15:20 Edited at: 2nd May 2012 15:23
Looks like you will have to turn off the shadows when you go outside.

mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 2nd May 2012 15:25
GreenGandalf
Quote: "shader = 1 ` shader option is broken in U77 - might work in earlier versions
set shadow shading on obj, -1, 1000, shader"

cpu shadows do crap, gpu shadows don't work.
use shadow mapping shader! you could find a plenty of these here, all free.

«It's the Shader, shader me this, shader me that»
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 2nd May 2012 15:32 Edited at: 2nd May 2012 15:32
ok, here\'s the updated version
Quote: "Hello Brendy boy,
Can camera clipping isolate just shadows?"

no, but i believe there is a command for setting the shadows radius so when you go outside decrease the radius to a small value

Jediam
14
Years of Service
User Offline
Joined: 14th Apr 2012
Location:
Posted: 2nd May 2012 15:39
Pincho,

I think your way would be alot easier, didn't think of it..Thanks.

mrHandy,

I am not familiar with shaders, I think there are two (vertex,pixel). How do they interact with light sources? Do you think it would solve the shadowing problem as indicated in the images above? It would be great if I didn't have to turn shadows off when going outside... Even better if I didn't have to single out certain objects for shadowing.
Jediam
14
Years of Service
User Offline
Joined: 14th Apr 2012
Location:
Posted: 2nd May 2012 15:50
Brendy boy,

I know that when you set shadow shading on for a certain object, you can specify the distance over which the shadow is cast. I'm not sure if this is what you were talking about. I don't think Set shadow position has a radius parameter.
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 2nd May 2012 15:57
CPU stencil may project even on a backdrop(!), that is physically a sphere object.

If you want to keep original lighting, you can use lightmaps! Search for Gile[s], that's a free (now free) soft for easy shadow baking.

«It's the Shader, shader me this, shader me that»
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 2nd May 2012 16:22
Quote: " I'm not sure if this is what you were talking about."

yes, that's what i meant

Jediam
14
Years of Service
User Offline
Joined: 14th Apr 2012
Location:
Posted: 2nd May 2012 21:25
Hello gentlemen,

Thanks for your help, I think all three methods combined will work. If I wish for the point light to move and for the shadows to change, I could employ both Brendy and Pinchos' methods. If I decide a moving light/shadows is unneccesary, I could switch to mrHandys' method. Do any of you know if it's possible to switch between lightmaps while the program is running if you want to see different shadow configurations. It is probably the best compromise between the two options (moving/static shadows). One last thing...I think Dark Lights can be used for lightmaps/shadow baking as well...however, the program crashes on me everytime I try to build the level after the lights are applied. I'll give Gile[s] a shot anyway. Thanks again. Take Care

Login to post a reply

Server time is: 2026-07-08 05:37:31
Your offset time is: 2026-07-08 05:37:31