frustrum culling (camera inside shadow volume) ?

Blitz3D Forums/Blitz3D Programming/frustrum culling (camera inside shadow volume) ?

bytecode77(Posted 2006) [#1]
hello!

in order to optimize our shadow system to about 1.5x speed i have to do it as follows:



the object is a shpere which represents the bounding sphere of an entity (or box or what ever the algorithm supports)...

i need to know whether the camera is inside the red area below the shadow caster.

thank you :)


b32(Posted 2006) [#2]
I'm not sure if this works, I don't know how to test it.



bytecode77(Posted 2006) [#3]
hey bram
thx it works seamless! thank you. you helped me alot.

i will release an update as soon as i finished this.

cya!!


bytecode77(Posted 2006) [#4]
one issue:
this code is made for parrallel light, right?
what if my lightsource is a pointlight? then it is making strange thigs...


b32(Posted 2006) [#5]
Yes, you are right, sorry. I forgot to include scale the radius# in IsInRedArea(). This might be better:

Note that instead of using EntityDistance() you could also calculate the distance between two points yourself. It will save creating/destroying a pivot for each calculation.


bytecode77(Posted 2006) [#6]
thank you :)


b32(Posted 2006) [#7]
no problem, Teufel!