sunset box: lock rotation of sun
This commit is contained in:
parent
57d07d2258
commit
9034d9e2a2
1 changed files with 2 additions and 4 deletions
|
@ -7,6 +7,7 @@
|
||||||
_HorizonTint ("Horizon tint", Range(0, 1)) = 0.1
|
_HorizonTint ("Horizon tint", Range(0, 1)) = 0.1
|
||||||
[Header(Sun)]
|
[Header(Sun)]
|
||||||
_SunCol ("Sun color", Color) = (1.0, 0.65, 0.05, 1.0)
|
_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
|
_SunRadius ("Sun radius", Range(0, 0.3)) = 0.06
|
||||||
_SunCutoff ("Sun cutoff", Range(0, 0.5)) = 0.08
|
_SunCutoff ("Sun cutoff", Range(0, 0.5)) = 0.08
|
||||||
[Header(Star Layout)]
|
[Header(Star Layout)]
|
||||||
|
@ -228,10 +229,7 @@
|
||||||
{
|
{
|
||||||
// float3 horizon_col = lerp(_SkyCol, _SunCol, _HorizonTint);
|
// float3 horizon_col = lerp(_SkyCol, _SunCol, _HorizonTint);
|
||||||
float3 origin = mul(unity_ObjectToWorld, float4(0, 0, 0, 1));
|
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);
|
float3 sun_dir = float3(sin(_SunAngle), 0.0, cos(_SunAngle));
|
||||||
// sun_dir.y = sin(_Time.x * 10) * 0.05;
|
|
||||||
sun_dir.y = 0.01;
|
|
||||||
sun_dir = normalize(sun_dir);
|
|
||||||
|
|
||||||
float3 dir = normalize(i.hit_pos - i.cam_pos);
|
float3 dir = normalize(i.hit_pos - i.cam_pos);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue