Merge pull request #227 from Azaezel/alpha40_scatterskyCleanups

adress #116 and #179 (shaderside)
This commit is contained in:
Brian Roberts 2020-06-26 20:51:59 -05:00 committed by GitHub
commit 005f7f6fd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 8 deletions

View file

@ -60,13 +60,9 @@ void main()
vec4 nightSkyColor = texture(nightSky, -v3Direction);
nightSkyColor = mix(nightColor, nightSkyColor, useCubemap);
float fac = dot( normalize( pos ), sunDir );
fac = max( nightInterpAndExposure.y, pow( clamp( fac, 0.0, 1.0 ), 2 ) );
OUT_col = mix( color, nightSkyColor, nightInterpAndExposure.y );
OUT_col.a = 1;
OUT_col = clamp(OUT_col, 0.0, 1.0);
OUT_col = hdrEncode( OUT_col );
}

View file

@ -58,12 +58,9 @@ float4 main( Conn In ) : TORQUE_TARGET0
float4 nightSkyColor = TORQUE_TEXCUBE(nightSky, -In.v3Direction);
nightSkyColor = lerp( nightColor, nightSkyColor, useCubemap );
float fac = dot( normalize( In.pos ), sunDir );
fac = max( nightInterpAndExposure.y, pow( saturate( fac ), 2 ) );
Out = lerp( color, nightSkyColor, nightInterpAndExposure.y );
Out.a = 1;
Out = saturate(Out);
return hdrEncode( Out );
}