Implementation of sRGB image support. Overhauls the linearization setup to utilize the sRGB image types, as well as refactors the use of ColorF and ColorI to be properly internally consistent. ColorIs are used only for front-facing/editing/UI settings, and ColorFs, now renamed to LinearColorF to reduce confusion of purpose, are used for color info in the engine itself. This avoids confusing and expensive conversions back and forth between types and avoids botches with linearity. Majority work done by @rextimmy

This commit is contained in:
Areloch 2017-06-23 11:36:20 -05:00
parent 8943c673fb
commit 0801a3cca8
294 changed files with 3894 additions and 2813 deletions

View file

@ -1314,66 +1314,6 @@
canSaveDynamicFields = "0";
};
};
new GuiControl() {
position = "0 190";
extent = "352 15";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
internalName = "GammaSliderContainer";
canSave = "1";
canSaveDynamicFields = "0";
new GuiSliderCtrl() {
range = "2.0 2.5";
ticks = "0";
snap = "0";
value = "2.2";
position = "76 -1";
extent = "268 15";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiSliderProfile";
visible = "1";
active = "1";
variable = "$pref::Video::Gamma";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Gamma:";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "22 -4";
extent = "105 18";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiTextProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
};
new GuiControl() {
position = "0 208";
extent = "352 15";

View file

@ -77,15 +77,6 @@ $pref::Video::Gamma = 2.2;
$pref::Video::Contrast = 1.0;
$pref::Video::Brightness = 0;
// Console-friendly defaults
if($platform $= "xenon")
{
// Save some fillrate on the X360, and take advantage of the HW scaling
$pref::Video::Resolution = "1152 640";
$pref::Video::mode = $pref::Video::Resolution SPC "true 32 60 0";
$pref::Video::fullScreen = 1;
}
/// This is the path used by ShaderGen to cache procedural
/// shaders. If left blank ShaderGen will only cache shaders
/// to memory and not to disk.
@ -160,7 +151,7 @@ $pref::SFX::channelVolume6 = 1;
$pref::SFX::channelVolume7 = 1;
$pref::SFX::channelVolume8 = 1;
$pref::PostEffect::PreferedHDRFormat = "GFXFormatR8G8B8A8";
$pref::PostEffect::PreferedHDRFormat = "GFXFormatR16G16B16A16F";
/// This is an scalar which can be used to reduce the
/// reflection textures on all objects to save fillrate.

View file

@ -35,6 +35,7 @@ new GFXStateBlockData( AL_DeferredShadingState : PFX_DefaultStateBlock )
samplerStates[1] = SamplerWrapLinear;
samplerStates[2] = SamplerWrapLinear;
samplerStates[3] = SamplerWrapLinear;
samplerStates[4] = SamplerWrapLinear;
};
new ShaderData( AL_DeferredShader )

View file

@ -48,14 +48,14 @@ singleton PostEffect( GammaPostFX )
renderTime = "PFXBeforeBin";
renderBin = "EditorBin";
renderPriority = 9999;
renderPriority = 9998;
shader = GammaShader;
stateBlock = GammaStateBlock;
texture[0] = "$backBuffer";
texture[1] = $HDRPostFX::colorCorrectionRamp;
targetFormat = getBestHDRFormat();
textureSRGB[1] = true;
};
function GammaPostFX::preProcess( %this )

View file

@ -275,10 +275,6 @@ function HDRPostFX::preProcess( %this )
function HDRPostFX::onEnabled( %this )
{
// We don't allow hdr on OSX yet.
if ( $platform $= "macos" )
return false;
// See what HDR format would be best.
%format = getBestHDRFormat();
if ( %format $= "" || %format $= "GFXFormatR8G8B8A8" )

View file

@ -32,8 +32,8 @@ function initRenderManager()
new RenderFormatToken(AL_FormatToken)
{
enabled = "false";
format = getBestHDRFormat();
//When hdr is enabled this will be changed to the appropriate format
format = "GFXFormatR8G8B8A8_SRGB";
depthFormat = "GFXFormatD24S8";
aaLevel = 0; // -1 = match backbuffer

View file

@ -18,7 +18,7 @@ $PostFXManager::Settings::HDR::blueShiftColor = "1.05 0.97 1.27";
$PostFXManager::Settings::HDR::brightPassThreshold = "0.631579";
$PostFXManager::Settings::HDR::enableBloom = "1";
$PostFXManager::Settings::HDR::enableBlueShift = "0";
$PostFXManager::Settings::HDR::enableToneMapping = "1";
$PostFXManager::Settings::HDR::enableToneMapping = "0.5";
$PostFXManager::Settings::HDR::gaussMean = "0.0526316";
$PostFXManager::Settings::HDR::gaussMultiplier = "0.31746";
$PostFXManager::Settings::HDR::gaussStdDev = "0.8";

View file

@ -56,7 +56,7 @@ float4 main( ConnectData IN ) : TORQUE_TARGET0
float2 uvscreen=((IN.htpos.xy/IN.htpos.w) + 1.0 ) / 2.0;
uvscreen.y = 1.0 - uvscreen.y;
float obj_test = TORQUE_PREPASS_UNCONDITION(deferredTex, uvscreen).w * preBias;
float obj_test = TORQUE_DEFERRED_UNCONDITION(deferredTex, uvscreen).w * preBias;
float depth = TORQUE_TEX2D(depthBuffer, uvscreen).r;
float front = TORQUE_TEX2D(frontBuffer, uvscreen).r;

View file

@ -28,6 +28,6 @@ TORQUE_UNIFORM_SAMPLER1D(depthViz, 1);
float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
{
float depth = TORQUE_PREPASS_UNCONDITION( deferredTex, IN.uv0 ).w;
float depth = TORQUE_DEFERRED_UNCONDITION( deferredTex, IN.uv0 ).w;
return float4( TORQUE_TEX1D( depthViz, depth ).rgb, 1.0 );
}

View file

@ -27,6 +27,6 @@ TORQUE_UNIFORM_SAMPLER2D(deferredTex, 0);
float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
{
float3 normal = TORQUE_PREPASS_UNCONDITION( deferredTex, IN.uv0 ).xyz;
float3 normal = TORQUE_DEFERRED_UNCONDITION( deferredTex, IN.uv0 ).xyz;
return float4( ( normal + 1.0 ) * 0.5, 1.0 );
}

View file

@ -35,7 +35,7 @@ float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
float4 colorBuffer = TORQUE_TEX2D( colorBufferTex, IN.uv0 );
float4 matInfo = TORQUE_TEX2D( matInfoTex, IN.uv0 );
float specular = saturate(lightBuffer.a);
float depth = TORQUE_PREPASS_UNCONDITION( deferredTex, IN.uv0 ).w;
float depth = TORQUE_DEFERRED_UNCONDITION( deferredTex, IN.uv0 ).w;
if (depth>0.9999)
return float4(0,0,0,0);

View file

@ -49,7 +49,7 @@ float4 main( ConvexConnectP IN ) : TORQUE_TARGET0
float2 uvScene = getUVFromSSPos(ssPos, rtParams0);
// Sample/unpack the normal/z data
float4 deferredSample = TORQUE_PREPASS_UNCONDITION(deferredBuffer, uvScene);
float4 deferredSample = TORQUE_DEFERRED_UNCONDITION(deferredBuffer, uvScene);
float3 normal = deferredSample.rgb;
float depth = deferredSample.a;

View file

@ -161,7 +161,7 @@ float4 main( ConvexConnectP IN ) : TORQUE_TARGET0
}
// Sample/unpack the normal/z data
float4 deferredSample = TORQUE_PREPASS_UNCONDITION( deferredBuffer, uvScene );
float4 deferredSample = TORQUE_DEFERRED_UNCONDITION( deferredBuffer, uvScene );
float3 normal = deferredSample.rgb;
float depth = deferredSample.a;

View file

@ -99,7 +99,7 @@ float4 main( ConvexConnectP IN ) : TORQUE_TARGET0
}
// Sample/unpack the normal/z data
float4 deferredSample = TORQUE_PREPASS_UNCONDITION( deferredBuffer, uvScene );
float4 deferredSample = TORQUE_DEFERRED_UNCONDITION( deferredBuffer, uvScene );
float3 normal = deferredSample.rgb;
float depth = deferredSample.a;

View file

@ -213,7 +213,7 @@ float4 main( FarFrustumQuadConnectP IN ) : TORQUE_TARGET0
subsurface = float3(0.337255, 0.772549, 0.262745);
}
// Sample/unpack the normal/z data
float4 deferredSample = TORQUE_PREPASS_UNCONDITION( deferredBuffer, IN.uv0 );
float4 deferredSample = TORQUE_DEFERRED_UNCONDITION( deferredBuffer, IN.uv0 );
float3 normal = deferredSample.rgb;
float depth = deferredSample.a;

View file

@ -84,7 +84,7 @@ float4 main( Conn IN ) : TORQUE_TARGET0
float2 tc = IN.pos.xy * float2(1.0, -1.0) / IN.pos.w;
tc = viewportCoordToRenderTarget(saturate( ( tc + 1.0 ) * 0.5 ), deferredTargetParams);
float sceneDepth = TORQUE_PREPASS_UNCONDITION(deferredTex, tc).w;
float sceneDepth = TORQUE_DEFERRED_UNCONDITION(deferredTex, tc).w;
float depth = IN.pos.w * oneOverFar;
float diff = sceneDepth - depth;
#ifdef CLIP_Z

View file

@ -40,7 +40,7 @@ float distanceToPlane(float4 plane, float3 pos)
float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
{
//Sample the pre-pass
float4 deferred = TORQUE_PREPASS_UNCONDITION( deferredTex, IN.uv0 );
float4 deferred = TORQUE_DEFERRED_UNCONDITION( deferredTex, IN.uv0 );
//Get depth
float depth = deferred.w;

View file

@ -88,10 +88,10 @@ half4 main( Pixel IN ) : TORQUE_TARGET0
[unroll] // coc[i] causes this anyway
for (int i = 0; i < 4; i++)
{
depth[0] = TORQUE_PREPASS_UNCONDITION(depthSampler, (IN.tcDepth0.xy + rowOfs[i])).w;
depth[1] = TORQUE_PREPASS_UNCONDITION(depthSampler, (IN.tcDepth1.xy + rowOfs[i])).w;
depth[2] = TORQUE_PREPASS_UNCONDITION(depthSampler, (IN.tcDepth2.xy + rowOfs[i])).w;
depth[3] = TORQUE_PREPASS_UNCONDITION(depthSampler, (IN.tcDepth3.xy + rowOfs[i])).w;
depth[0] = TORQUE_DEFERRED_UNCONDITION(depthSampler, (IN.tcDepth0.xy + rowOfs[i])).w;
depth[1] = TORQUE_DEFERRED_UNCONDITION(depthSampler, (IN.tcDepth1.xy + rowOfs[i])).w;
depth[2] = TORQUE_DEFERRED_UNCONDITION(depthSampler, (IN.tcDepth2.xy + rowOfs[i])).w;
depth[3] = TORQUE_DEFERRED_UNCONDITION(depthSampler, (IN.tcDepth3.xy + rowOfs[i])).w;
coc = max(coc, clamp(dofEqWorld4X * half4(depth)+dofEqWorld4Y, zero4, maxWorldCoC4));
}

View file

@ -71,7 +71,7 @@ half4 InterpolateDof( half3 small, half3 med, half3 large, half t )
// d0, the small to medium blur over distance d1, and the medium to
// large blur over distance d2, where d0 + d1 + d2 = 1.
//float4 dofLerpScale = float4( -1 / d0, -1 / d1, -1 / d2, 1 / d2 );
//float4 dofLerpBias = float4( 1, (1 d2) / d1, 1 / d2, (d2 1) / d2 );
//float4 dofLerpBias = float4( 1, (1 <EFBFBD> d2) / d1, 1 / d2, (d2 <20> 1) / d2 );
weights = half4(saturate( t * dofLerpScale + dofLerpBias ));
weights.yz = min( weights.yz, 1 - weights.xy );
@ -115,7 +115,7 @@ half4 main( PFXVertToPix IN ) : TORQUE_TARGET0
//med.rgb = large;
//nearCoc = 0;
depth = half(TORQUE_PREPASS_UNCONDITION( depthSampler, IN.uv3 ).w);
depth = half(TORQUE_DEFERRED_UNCONDITION( depthSampler, IN.uv3 ).w);
//return half4(depth.rrr,1);
//return half4(nearCoc.rrr,1.0);

View file

@ -50,7 +50,7 @@ float GetEdgeWeight(float2 uv0, in float2 targetSize)
for(int i = 0; i < 9; i++)
{
float2 uv = uv0 + offsets[i] * PixelSize;
float4 gbSample = TORQUE_PREPASS_UNCONDITION( deferredBuffer, uv );
float4 gbSample = TORQUE_DEFERRED_UNCONDITION( deferredBuffer, uv );
Depth[i] = gbSample.a;
Normal[i] = gbSample.rgb;
}

View file

@ -34,7 +34,7 @@ uniform float4 rtParams0;
float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
{
//float2 deferredCoord = ( IN.uv0.xy * rtParams0.zw ) + rtParams0.xy;
float depth = TORQUE_PREPASS_UNCONDITION( deferredTex, IN.uv0 ).w;
float depth = TORQUE_DEFERRED_UNCONDITION( deferredTex, IN.uv0 ).w;
//return float4( depth, 0, 0, 0.7 );
float factor = computeSceneFog( eyePosWorld,
@ -43,5 +43,5 @@ float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
fogData.y,
fogData.z );
return hdrEncode( float4( toLinear(fogColor.rgb), 1.0 - saturate( factor ) ) );
return hdrEncode( float4( fogColor.rgb, 1.0 - saturate( factor ) ) );
}

View file

@ -40,9 +40,6 @@ float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
color.g = TORQUE_TEX1D( colorCorrectionTex, color.g ).g;
color.b = TORQUE_TEX1D( colorCorrectionTex, color.b ).b;
// Apply gamma correction
color.rgb = pow( saturate(color.rgb), OneOverGamma );
// Apply contrast
color.rgb = ((color.rgb - 0.5f) * Contrast) + 0.5f;

View file

@ -48,5 +48,5 @@ void main()
fogData.y,
fogData.z );
OUT_col = hdrEncode( vec4( toLinear(fogColor.rgb), 1.0 - saturate( factor ) ) );
}
OUT_col = hdrEncode( vec4( fogColor.rgb, 1.0 - saturate( factor ) ) );
}

View file

@ -44,9 +44,6 @@ void main()
color.g = texture( colorCorrectionTex, color.g ).g;
color.b = texture( colorCorrectionTex, color.b ).b;
// Apply gamma correction
color.rgb = pow( clamp(color.rgb, vec3(0.0),vec3(1.0)), vec3(OneOverGamma) );
// Apply contrast
color.rgb = ((color.rgb - 0.5f) * Contrast) + 0.5f;

View file

@ -87,15 +87,6 @@ float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
sample.r = TORQUE_TEX1D( colorCorrectionTex, sample.r ).r;
sample.g = TORQUE_TEX1D( colorCorrectionTex, sample.g ).g;
sample.b = TORQUE_TEX1D( colorCorrectionTex, sample.b ).b;
// Apply gamma correction
sample.rgb = pow( saturate(sample.rgb), g_fOneOverGamma );
// Apply contrast
sample.rgb = ((sample.rgb - 0.5f) * Contrast) + 0.5f;
// Apply brightness
sample.rgb += Brightness;
return sample;
}

View file

@ -93,14 +93,5 @@ void main()
_sample.g = texture( colorCorrectionTex, _sample.g ).g;
_sample.b = texture( colorCorrectionTex, _sample.b ).b;
// Apply gamma correction
_sample.rgb = pow( _sample.rgb, vec3(g_fOneOverGamma) );
// Apply contrast
_sample.rgb = ((_sample.rgb - 0.5f) * Contrast) + 0.5f;
// Apply brightness
_sample.rgb += Brightness;
OUT_col = _sample;
}

View file

@ -36,7 +36,7 @@ float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
float4 col = float4( 0, 0, 0, 1 );
// Get the depth at this pixel.
float depth = TORQUE_PREPASS_UNCONDITION( deferredTex, IN.uv0 ).w;
float depth = TORQUE_DEFERRED_UNCONDITION( deferredTex, IN.uv0 ).w;
// If the depth is equal to 1.0, read from the backbuffer
// and perform the exposure calculation on the result.

View file

@ -37,7 +37,7 @@ float4 main(PFXVertToPix IN) : TORQUE_TARGET0
float samples = 5;
// First get the deferred texture for uv channel 0
float4 deferred = TORQUE_PREPASS_UNCONDITION( deferredTex, IN.uv0 );
float4 deferred = TORQUE_DEFERRED_UNCONDITION( deferredTex, IN.uv0 );
// Next extract the depth
float depth = deferred.a;

View file

@ -49,7 +49,7 @@ uniform float blurNormalTol;
void sample( float2 uv, float weight, float4 centerTap, inout int usedCount, inout float occlusion, inout float total )
{
//return;
float4 tap = TORQUE_PREPASS_UNCONDITION( deferredMap, uv );
float4 tap = TORQUE_DEFERRED_UNCONDITION( deferredMap, uv );
if ( abs( tap.a - centerTap.a ) < blurDepthTol )
{
@ -65,7 +65,7 @@ void sample( float2 uv, float weight, float4 centerTap, inout int usedCount, ino
float4 main( VertToPix IN ) : TORQUE_TARGET0
{
//float4 centerTap;
float4 centerTap = TORQUE_PREPASS_UNCONDITION( deferredMap, IN.uv0.zw );
float4 centerTap = TORQUE_DEFERRED_UNCONDITION( deferredMap, IN.uv0.zw );
//return centerTap;

View file

@ -143,7 +143,7 @@ float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
float3 reflectNormal = normalize( TORQUE_TEX2DLOD( randNormalTex, noiseMapUV ).xyz * 2.0 - 1.0 );
//return float4( reflectNormal, 1 );
float4 deferred = TORQUE_PREPASS_UNCONDITION( deferredMap, IN.uv0 );
float4 deferred = TORQUE_DEFERRED_UNCONDITION( deferredMap, IN.uv0 );
float3 normal = deferred.xyz;
float depth = deferred.a;
//return float4( ( depth ).xxx, 1 );
@ -183,7 +183,7 @@ float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
//if ( radiusDepth.x < 1.0 / targetSize.x )
// return color;
//radiusDepth.xyz = 0.0009;
[unroll]
for ( i = 0; i < sSampleCount; i++ )
{
baseRay = reflect( ptSphere[i], reflectNormal );
@ -197,7 +197,7 @@ float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
se = ep + ray;
occluderFragment = TORQUE_PREPASS_UNCONDITION( deferredMap, se.xy );
occluderFragment = TORQUE_DEFERRED_UNCONDITION( deferredMap, se.xy );
depthDiff = se.z - occluderFragment.a;
@ -232,7 +232,7 @@ float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
//if ( radiusDepth.x < 1.0 / targetSize.x )
// return color;
//radiusDepth.xyz = 0.0009;
[unroll]
for ( i = sSampleCount; i < totalSampleCount; i++ )
{
baseRay = reflect( ptSphere[i], reflectNormal );
@ -246,7 +246,7 @@ float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
se = ep + ray;
occluderFragment = TORQUE_PREPASS_UNCONDITION( deferredMap, se.xy );
occluderFragment = TORQUE_DEFERRED_UNCONDITION( deferredMap, se.xy );
depthDiff = se.z - occluderFragment.a;

View file

@ -55,7 +55,7 @@ float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
{
//float2 deferredCoord = IN.uv0;
//IN.uv0 = ( IN.uv0.xy * rtParams0.zw ) + rtParams0.xy;
float depth = TORQUE_PREPASS_UNCONDITION( deferredTex, IN.uv0 ).w;
float depth = TORQUE_DEFERRED_UNCONDITION( deferredTex, IN.uv0 ).w;
//return float4( depth.rrr, 1 );
// Skip fogging the extreme far plane so that

View file

@ -27,9 +27,9 @@
// Portability helpers for autogenConditioners
#if (TORQUE_SM >= 10 && TORQUE_SM <=30)
#define TORQUE_PREPASS_UNCONDITION(tex, coords) deferredUncondition(tex, coords)
#define TORQUE_DEFERRED_UNCONDITION(tex, coords) deferredUncondition(tex, coords)
#elif TORQUE_SM >= 40
#define TORQUE_PREPASS_UNCONDITION(tex, coords) deferredUncondition(tex, texture_##tex, coords)
#define TORQUE_DEFERRED_UNCONDITION(tex, coords) deferredUncondition(tex, texture_##tex, coords)
#endif
#endif //_TORQUE_SHADERMODEL_AUTOGEN_

View file

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

View file

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

View file

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

View file

@ -155,7 +155,7 @@ float4 main( ConnectData IN ) : TORQUE_TARGET0
float2 deferredCoord = viewportCoordToRenderTarget( IN.posPostWave, rtParams1 );
float startDepth = TORQUE_PREPASS_UNCONDITION( deferredTex, deferredCoord ).w;
float startDepth = TORQUE_DEFERRED_UNCONDITION( deferredTex, deferredCoord ).w;
// The water depth in world units of the undistorted pixel.
float startDelta = ( startDepth - pixelDepth );
@ -180,7 +180,7 @@ float4 main( ConnectData IN ) : TORQUE_TARGET0
deferredCoord = viewportCoordToRenderTarget( distortPos, rtParams1 );
// Get deferred depth at the position of this distorted pixel.
float deferredDepth = TORQUE_PREPASS_UNCONDITION( deferredTex, deferredCoord ).w;
float deferredDepth = TORQUE_DEFERRED_UNCONDITION( deferredTex, deferredCoord ).w;
if ( deferredDepth > 0.99 )
deferredDepth = 5.0;
@ -212,7 +212,7 @@ float4 main( ConnectData IN ) : TORQUE_TARGET0
deferredCoord = viewportCoordToRenderTarget( distortPos, rtParams1 );
// Get deferred depth at the position of this distorted pixel.
deferredDepth = TORQUE_PREPASS_UNCONDITION( deferredTex, deferredCoord ).w;
deferredDepth = TORQUE_DEFERRED_UNCONDITION( deferredTex, deferredCoord ).w;
if ( deferredDepth > 0.99 )
deferredDepth = 5.0;
delta = ( deferredDepth - pixelDepth ) * farPlaneDist;
@ -311,7 +311,7 @@ float4 main( ConnectData IN ) : TORQUE_TARGET0
// Calculate the water "base" color based on depth.
float4 waterBaseColor = baseColor * TORQUE_TEX1D( depthGradMap, saturate( delta / depthGradMax ) );
waterBaseColor = toLinear(waterBaseColor);
waterBaseColor = waterBaseColor;
// Modulate baseColor by the ambientColor.
waterBaseColor *= float4( ambientColor.rgb, 1 );

View file

@ -718,22 +718,6 @@
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiCheckBoxCtrl() {
text = "use sRGB";
groupNum = "-1";
buttonType = "ToggleButton";
useMouseEvents = "0";
position = "360 105";
extent = "66 16";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiCheckBoxProfile";
visible = "1";
active = "1";
variable = "$displayAsSRGB";
command = "useSRGBctrl($displayAsSRGB);";
};
};
};
//--- OBJECT WRITE END ---
@ -743,15 +727,6 @@ $ColorPickerCancelCallback = "";
$ColorPickerUpdateCallback = "";
$ColorCallbackType = 1; // ColorI
function useSRGBctrl(%colorScale)
{
ColorPickerDlg.useSRGB = %colorScale;
ColorRangeSelect.useSRGB = %colorScale;
ColorBlendSelect.useSRGB = %colorScale;
myColor.useSRGB = %colorScale;
oldColor.useSRGB = %colorScale;
}
// This function pushes the color picker dialog and returns to a callback the selected value
function GetColorI( %currentColor, %callback, %root, %updateCallback, %cancelCallback )
{