sunset box: lock rotation of sun

This commit is contained in:
Crispy 2023-07-23 00:29:51 +02:00
parent 57d07d2258
commit 9034d9e2a2

View file

@ -7,6 +7,7 @@
_HorizonTint ("Horizon tint", Range(0, 1)) = 0.1
[Header(Sun)]
_SunCol ("Sun color", Color) = (1.0, 0.65, 0.05, 1.0)
_SunAngle ("Sun angle", Range(0, 6.28)) = 0
_SunRadius ("Sun radius", Range(0, 0.3)) = 0.06
_SunCutoff ("Sun cutoff", Range(0, 0.5)) = 0.08
[Header(Star Layout)]
@ -228,10 +229,7 @@
{
// float3 horizon_col = lerp(_SkyCol, _SunCol, _HorizonTint);
float3 origin = mul(unity_ObjectToWorld, float4(0, 0, 0, 1));
float3 sun_dir = (mul(unity_ObjectToWorld, float4(0, 0, -1, 1)) - origin) * float3(1, 0, 1);
// sun_dir.y = sin(_Time.x * 10) * 0.05;
sun_dir.y = 0.01;
sun_dir = normalize(sun_dir);
float3 sun_dir = float3(sin(_SunAngle), 0.0, cos(_SunAngle));
float3 dir = normalize(i.hit_pos - i.cam_pos);