diffuse/albedo texture linearization

http://http.developer.nvidia.com/GPUGems3/gpugems3_ch24.html
This commit is contained in:
Azaezel 2015-11-11 13:52:46 -06:00
parent 51b6469922
commit ce2964d2d0
31 changed files with 396 additions and 107 deletions

View file

@ -120,6 +120,7 @@ void main()
{
// Modulate baseColor by the ambientColor.
vec4 waterBaseColor = baseColor * vec4( ambientColor.rgb, 1 );
waterBaseColor = toLinear(waterBaseColor);
// Get the bumpNorm...
vec3 bumpNorm = ( texture( bumpMap, IN_rippleTexCoord01.xy ).rgb * 2.0 - 1.0 ) * rippleMagnitude.x;

View file

@ -324,6 +324,7 @@ void main()
// Calculate the water "base" color based on depth.
vec4 waterBaseColor = baseColor * texture( depthGradMap, saturate( delta / depthGradMax ) );
waterBaseColor = toLinear(waterBaseColor);
// Modulate baseColor by the ambientColor.
waterBaseColor *= vec4( ambientColor.rgb, 1 );

View file

@ -117,6 +117,7 @@ float4 main( ConnectData IN ) : COLOR
{
// Modulate baseColor by the ambientColor.
float4 waterBaseColor = baseColor * float4( ambientColor.rgb, 1 );
waterBaseColor = toLinear(waterBaseColor);
// Get the bumpNorm...
float3 bumpNorm = ( tex2D( bumpMap, IN.rippleTexCoord01.xy ).rgb * 2.0 - 1.0 ) * rippleMagnitude.x;

View file

@ -311,6 +311,7 @@ float4 main( ConnectData IN ) : COLOR
// Calculate the water "base" color based on depth.
float4 waterBaseColor = baseColor * tex1D( depthGradMap, saturate( delta / depthGradMax ) );
waterBaseColor = toLinear(waterBaseColor);
// Modulate baseColor by the ambientColor.
waterBaseColor *= float4( ambientColor.rgb, 1 );