Page 1 of 1

Strange shadow effect with spotlight

Posted: Fri Feb 07, 2014 2:23 pm
by AndyLy
Hi, I have one problem with shadows.
If I use a direct light source - shadows displays normal, if spotLight - shadow and light displays in the inversion. The picture below it shows.

Code: Select all

CreateLight(222,RGB(200,200,200),32,75,200,#PB_Light_Directional): LightLookAt(222,52,10,240)
WorldShadows( #PB_Shadow_Modulative, 70, RGB(120,120,120))
Image

Code: Select all

CreateLight(223,RGB(200,200,200),38,94,165,#PB_Light_Spot)
SpotLightRange(223,20,240): LightDirection(223,1,-1,1)
WorldShadows( #PB_Shadow_Modulative, 70, RGB(120,120,120))
Image

I can not put all the source code, but maybe someone has an idea why this happens?

Re: Strange shadow effect with spotlight

Posted: Sat Feb 08, 2014 1:38 am
by Samuel
Unfortunately, I can't replicate your problem. I'm guessing this only happens under certain conditions.

I once read a topic saying that inverted shadows can appear when a light is within the bounding box of an object.
Maybe that's somehow related to your problem. You could try moving your light source to different locations and see if you can get different results.

Re: Strange shadow effect with spotlight

Posted: Sat Feb 08, 2014 2:23 am
by AndyLy
Thank you for reply.
This whole room is a mesh. So "light is within the bounding box of an object."
Well, it will be one more reason not to use shadow. )
Anyway with shadows FPS falls too much, impossible to play.

Re: Strange shadow effect with spotlight

Posted: Sat Feb 08, 2014 2:20 pm
by AndyLy
Room - a single mesh, I mean cube (walls, floor, ceiling).

I tried static geometry once, maybe I did something wrong, but after free all entities I got scene without physics.

Re: Strange shadow effect with spotlight

Posted: Sun Feb 09, 2014 9:31 am
by Bananenfreak
Don´t free the entities, just hide them. So (in my mind) only the StaticGeometry is rendered, but you´ll have the static physicsbody of your entities.

Re: Strange shadow effect with spotlight

Posted: Sun Feb 09, 2014 12:24 pm
by AndyLy
I tried static geometry right now: first, it behaves strangely, the meshes are only visible from a certain angle of the camera (in the range of 90 deg.), at other angles they are invisible. Second FPS increase only on 5.
Yes, if hiding objects - physics persists.

Re: Strange shadow effect with spotlight

Posted: Mon Feb 10, 2014 10:46 pm
by AndyLy
Today I decided to check out one thing - it is important to disable casting shadows of the room itself, then works fine (with spot light). :D