Added by request "SunDirection" vector to enbbloom.fx, enbeffect.fx, effect.txt shaders. Fixed wrong ScreenSize parameter in enbeffect.fx.
Code: Select all
//code for visualizing sun position on the screen
float2 sundir=SunDirection.xy/SunDirection.w;//.w !=0. It negative when sun is on back side
float2 uvpos=IN.txcoord0.xy*2.0-1.0;
uvpos.y=-uvpos.y;
sundir.xy=(uvpos.xy-sundir.xy);
sundir.y*=ScreenSize.w;
float sunvis=dot(sundir.xy, sundir.xy);
sunvis=saturate(1-pow(sunvis, 0.1))*10;//pow(tempF1.x, 16);
if (SunDirection.w<0.0) sunvis=0.0;
_oC0.xyz+=sunvis;
Code: Select all
float4 SunDirection;