Hi! I am making shadow shader based on a
tutorial and evolved's spot shadow mapping
I have camera 6 for sun, other 5 are for water, bloom etc.
What I have in DB:
make camera 6 `sun
set camera fov 6,1
color backdrop 6,0
set camera to image 6,6,4096,4096,3,114 `32 bit float red channel for high precision
set camera range 6,1,1000000
...
do
...
set effect technique 1,"Depth"
position camera 6,0,500,0
point camera 6,500,0,500
move camera 6,-100000
set current camera 6
view matrix4 1
projection matrix4 2
multiply matrix4 3,1,2 `This matrix describes how our light views the world
set effect constant matrix 1,"LightProjMatrix",3 `Pass in our lights view of the world
sync mask 2^6:fastsync
set current camera 0
set effect technique 1,"Texture"
...
Used from evolved's shader:
matrix ViewMat={0.5,0,0,0.5,0,-0.5,0,0.5,0,0,0.5,0.5,0,0,0,1};
\\ here is sun spot projection coords
float4 Wpos = mul(IN.Pos,World);
float4 Proj = mul(Wpos,ProjMatrix);
OUT.Proj = mul(ViewMat,Proj);
And... result: