mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
Merge pull request #1619 from Azaezel/alpha41/translucentOpacity2
Some checks are pending
Linux Build / ${{matrix.config.name}} (map[build_type:Release cc:gcc cxx:g++ generator:Ninja name:Ubuntu Latest GCC]) (push) Waiting to run
MacOSX Build / ${{matrix.config.name}} (map[build_type:Release cc:clang cxx:clang++ generator:Ninja name:MacOSX Latest Clang]) (push) Waiting to run
Windows Build / ${{matrix.config.name}} (map[build_type:Release cc:cl cxx:cl environment_script:C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat generator:Visual Studio 17 2022 name:Windows Latest MSVC]) (push) Waiting to run
Some checks are pending
Linux Build / ${{matrix.config.name}} (map[build_type:Release cc:gcc cxx:g++ generator:Ninja name:Ubuntu Latest GCC]) (push) Waiting to run
MacOSX Build / ${{matrix.config.name}} (map[build_type:Release cc:clang cxx:clang++ generator:Ninja name:MacOSX Latest Clang]) (push) Waiting to run
Windows Build / ${{matrix.config.name}} (map[build_type:Release cc:cl cxx:cl environment_script:C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat generator:Visual Studio 17 2022 name:Windows Latest MSVC]) (push) Waiting to run
simplified translucent opacity nudging
This commit is contained in:
commit
9d4bfec4d1
|
|
@ -3055,7 +3055,7 @@ void ReflectionProbeFeatGLSL::processPix(Vector<ShaderComponent*>& componentList
|
||||||
Var *ibl = (Var *)LangElement::find("ibl");
|
Var *ibl = (Var *)LangElement::find("ibl");
|
||||||
if (!ibl)
|
if (!ibl)
|
||||||
{
|
{
|
||||||
ibl = new Var("ibl", "float3");
|
ibl = new Var("ibl", "float4");
|
||||||
}
|
}
|
||||||
|
|
||||||
Var* eyePos = (Var*)LangElement::find("eyePosWorld");
|
Var* eyePos = (Var*)LangElement::find("eyePosWorld");
|
||||||
|
|
@ -3086,7 +3086,7 @@ void ReflectionProbeFeatGLSL::processPix(Vector<ShaderComponent*>& componentList
|
||||||
//Reflection vec
|
//Reflection vec
|
||||||
String computeForwardProbes = String(" @ = computeForwardProbes(@,@,@,@,@,@,@,@,@,\r\n\t\t");
|
String computeForwardProbes = String(" @ = computeForwardProbes(@,@,@,@,@,@,@,@,@,\r\n\t\t");
|
||||||
computeForwardProbes += String("@,@,@,@,@,@,\r\n\t\t");
|
computeForwardProbes += String("@,@,@,@,@,@,\r\n\t\t");
|
||||||
computeForwardProbes += String("@,@).rgb; \r\n");
|
computeForwardProbes += String("@,@); \r\n");
|
||||||
|
|
||||||
meta->addStatement(new GenOp(computeForwardProbes.c_str(), new DecOp(ibl), surface, cubeMips, numProbes, worldToObjArray, probeConfigData, inProbePosArray, refScaleArray, inRefPosArray, eyePos,
|
meta->addStatement(new GenOp(computeForwardProbes.c_str(), new DecOp(ibl), surface, cubeMips, numProbes, worldToObjArray, probeConfigData, inProbePosArray, refScaleArray, inRefPosArray, eyePos,
|
||||||
skylightCubemapIdx, SkylightDamp, BRDFTexture, WetnessTexture, accumTime, dampness,
|
skylightCubemapIdx, SkylightDamp, BRDFTexture, WetnessTexture, accumTime, dampness,
|
||||||
|
|
@ -3100,7 +3100,7 @@ void ReflectionProbeFeatGLSL::processPix(Vector<ShaderComponent*>& componentList
|
||||||
ambient->constSortPos = cspPass;
|
ambient->constSortPos = cspPass;
|
||||||
}
|
}
|
||||||
meta->addStatement(new GenOp(" @.rgb *= @.rgb;\r\n", ibl, ambient));
|
meta->addStatement(new GenOp(" @.rgb *= @.rgb;\r\n", ibl, ambient));
|
||||||
meta->addStatement(new GenOp(" @.rgb = @.rgb;\r\n", curColor, ibl));
|
meta->addStatement(new GenOp(" @ = @;\r\n", curColor, ibl));
|
||||||
|
|
||||||
output = meta;
|
output = meta;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3143,7 +3143,7 @@ void ReflectionProbeFeatHLSL::processPix(Vector<ShaderComponent*> &componentList
|
||||||
Var* ibl = (Var*)LangElement::find("ibl");
|
Var* ibl = (Var*)LangElement::find("ibl");
|
||||||
if (!ibl)
|
if (!ibl)
|
||||||
{
|
{
|
||||||
ibl = new Var("ibl", "float3");
|
ibl = new Var("ibl", "float4");
|
||||||
}
|
}
|
||||||
|
|
||||||
Var* eyePos = (Var*)LangElement::find("eyePosWorld");
|
Var* eyePos = (Var*)LangElement::find("eyePosWorld");
|
||||||
|
|
@ -3174,7 +3174,7 @@ void ReflectionProbeFeatHLSL::processPix(Vector<ShaderComponent*> &componentList
|
||||||
|
|
||||||
String computeForwardProbes = String(" @ = computeForwardProbes(@,@,@,@,@,@,@,@,@,\r\n\t\t");
|
String computeForwardProbes = String(" @ = computeForwardProbes(@,@,@,@,@,@,@,@,@,\r\n\t\t");
|
||||||
computeForwardProbes += String("@,@,TORQUE_SAMPLER2D_MAKEARG(@),TORQUE_SAMPLER2D_MAKEARG(@), @, @,\r\n\t\t");
|
computeForwardProbes += String("@,@,TORQUE_SAMPLER2D_MAKEARG(@),TORQUE_SAMPLER2D_MAKEARG(@), @, @,\r\n\t\t");
|
||||||
computeForwardProbes += String("TORQUE_SAMPLERCUBEARRAY_MAKEARG(@),TORQUE_SAMPLERCUBEARRAY_MAKEARG(@)).rgb; \r\n");
|
computeForwardProbes += String("TORQUE_SAMPLERCUBEARRAY_MAKEARG(@),TORQUE_SAMPLERCUBEARRAY_MAKEARG(@)); \r\n");
|
||||||
|
|
||||||
meta->addStatement(new GenOp(computeForwardProbes.c_str(), new DecOp(ibl), surface, cubeMips, numProbes, worldToObjArray, probeConfigData, inProbePosArray, refScaleArray, inRefPosArray, eyePos,
|
meta->addStatement(new GenOp(computeForwardProbes.c_str(), new DecOp(ibl), surface, cubeMips, numProbes, worldToObjArray, probeConfigData, inProbePosArray, refScaleArray, inRefPosArray, eyePos,
|
||||||
skylightCubemapIdx, SkylightDamp, BRDFTexture, WetnessTexture, accumTime, dampness,
|
skylightCubemapIdx, SkylightDamp, BRDFTexture, WetnessTexture, accumTime, dampness,
|
||||||
|
|
@ -3188,7 +3188,7 @@ void ReflectionProbeFeatHLSL::processPix(Vector<ShaderComponent*> &componentList
|
||||||
ambient->constSortPos = cspPass;
|
ambient->constSortPos = cspPass;
|
||||||
}
|
}
|
||||||
meta->addStatement(new GenOp(" @.rgb *= @.rgb;\r\n", ibl, ambient));
|
meta->addStatement(new GenOp(" @.rgb *= @.rgb;\r\n", ibl, ambient));
|
||||||
meta->addStatement(new GenOp(" @.rgb = @.rgb;\r\n", curColor, ibl));
|
meta->addStatement(new GenOp(" @ = @;\r\n", curColor, ibl));
|
||||||
|
|
||||||
output = meta;
|
output = meta;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -610,7 +610,8 @@ vec4 computeForwardProbes(Surface surface,
|
||||||
return vec4(lerp((finalColor), surface.baseColor.rgb,surface.metalness),0);
|
return vec4(lerp((finalColor), surface.baseColor.rgb,surface.metalness),0);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return vec4(finalColor, 0);
|
float reflectionOpacity = min(surface.baseColor.a+surface.baseColor.a*length(finalColor),1.0);
|
||||||
|
return vec4(finalColor, reflectionOpacity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -615,7 +615,8 @@ float4 computeForwardProbes(Surface surface,
|
||||||
return float4(lerp((finalColor), surface.baseColor.rgb,surface.metalness),0);
|
return float4(lerp((finalColor), surface.baseColor.rgb,surface.metalness),0);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return float4(finalColor, 0);
|
float reflectionOpacity = min(surface.baseColor.a+surface.baseColor.a*length(finalColor),1.0);
|
||||||
|
return float4(finalColor, reflectionOpacity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue