mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 23:54:35 +00:00
* 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:
parent
296ab5b532
commit
d07abe8ad2
41 changed files with 69 additions and 184 deletions
|
|
@ -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 )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue