Hi, I just want to ask if this happen to other...
I want to optimize the game I made by removing unnecessary shadow casting light source by switching CAST OFF when the light source cant be seen from camera.
Code:
reset(me,CAST);


And setting them on again when they can be seen
Code:
set(me,CAST);



The problem is that it wont work. The flag CAST itself changed but the light still casting shadow(if they're at the first time) or still not casting shadow(if they weren't) even if the CAST flag changed.

I do have a work around that's setting lightrange to 0 before switching CAST flag the setting it lightrange again, but it's very noticable since the light's out for one frame...

Could anyone tell me what's going on?