mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
slim ambient down to vec3, default to premul for translucency
This commit is contained in:
parent
0e0088cab9
commit
de6ee93159
5 changed files with 7 additions and 7 deletions
|
|
@ -536,7 +536,7 @@ bool Material::onAdd()
|
||||||
if (mTranslucentBlendOp >= NumBlendTypes || mTranslucentBlendOp < 0)
|
if (mTranslucentBlendOp >= NumBlendTypes || mTranslucentBlendOp < 0)
|
||||||
{
|
{
|
||||||
Con::errorf("Invalid blend op in material: %s", getName());
|
Con::errorf("Invalid blend op in material: %s", getName());
|
||||||
mTranslucentBlendOp = LerpAlpha;
|
mTranslucentBlendOp = PreMul;
|
||||||
}
|
}
|
||||||
|
|
||||||
SimSet* matSet = MATMGR->getMaterialSet();
|
SimSet* matSet = MATMGR->getMaterialSet();
|
||||||
|
|
|
||||||
|
|
@ -3064,7 +3064,7 @@ void ReflectionProbeFeatGLSL::processPix(Vector<ShaderComponent*>& componentList
|
||||||
Var *ambient = (Var *)LangElement::find("ambient");
|
Var *ambient = (Var *)LangElement::find("ambient");
|
||||||
if (!ambient)
|
if (!ambient)
|
||||||
{
|
{
|
||||||
ambient = new Var("ambient", "vec4");
|
ambient = new Var("ambient", "vec3");
|
||||||
eyePos->uniform = true;
|
eyePos->uniform = true;
|
||||||
eyePos->constSortPos = cspPass;
|
eyePos->constSortPos = cspPass;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3153,7 +3153,7 @@ void ReflectionProbeFeatHLSL::processPix(Vector<ShaderComponent*> &componentList
|
||||||
Var *ambient = (Var *)LangElement::find("ambient");
|
Var *ambient = (Var *)LangElement::find("ambient");
|
||||||
if (!ambient)
|
if (!ambient)
|
||||||
{
|
{
|
||||||
ambient = new Var("ambient","float4");
|
ambient = new Var("ambient","float3");
|
||||||
eyePos->uniform = true;
|
eyePos->uniform = true;
|
||||||
eyePos->constSortPos = cspPass;
|
eyePos->constSortPos = cspPass;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ uniform sampler2D colorBuffer;
|
||||||
uniform sampler2D matInfoBuffer;
|
uniform sampler2D matInfoBuffer;
|
||||||
uniform sampler2D BRDFTexture;
|
uniform sampler2D BRDFTexture;
|
||||||
|
|
||||||
uniform vec4 ambientColor;
|
uniform vec3 ambientColor;
|
||||||
uniform vec4 rtParams0;
|
uniform vec4 rtParams0;
|
||||||
uniform vec4 vsFarPlane;
|
uniform vec4 vsFarPlane;
|
||||||
uniform mat4 cameraToWorld;
|
uniform mat4 cameraToWorld;
|
||||||
|
|
@ -203,6 +203,6 @@ void main()
|
||||||
#if CAPTURING == 1
|
#if CAPTURING == 1
|
||||||
OUT_col = vec4(mix(surface.baseColor.rgb,(irradiance + specular* horizon) ,surface.metalness/2),0);
|
OUT_col = vec4(mix(surface.baseColor.rgb,(irradiance + specular* horizon) ,surface.metalness/2),0);
|
||||||
#else
|
#else
|
||||||
OUT_col = vec4((irradiance + specular* horizon)*ambientColor.rgb , 0);//alpha writes disabled
|
OUT_col = vec4((irradiance + specular* horizon)*ambientColor, 0);//alpha writes disabled
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ TORQUE_UNIFORM_SAMPLER2D(deferredBuffer, 0);
|
||||||
TORQUE_UNIFORM_SAMPLER2D(colorBuffer, 1);
|
TORQUE_UNIFORM_SAMPLER2D(colorBuffer, 1);
|
||||||
TORQUE_UNIFORM_SAMPLER2D(matInfoBuffer, 2);
|
TORQUE_UNIFORM_SAMPLER2D(matInfoBuffer, 2);
|
||||||
TORQUE_UNIFORM_SAMPLER2D(BRDFTexture, 3);
|
TORQUE_UNIFORM_SAMPLER2D(BRDFTexture, 3);
|
||||||
uniform float4 ambientColor;
|
uniform float3 ambientColor;
|
||||||
uniform float4 rtParams0;
|
uniform float4 rtParams0;
|
||||||
uniform float4 vsFarPlane;
|
uniform float4 vsFarPlane;
|
||||||
uniform float4x4 cameraToWorld;
|
uniform float4x4 cameraToWorld;
|
||||||
|
|
@ -190,6 +190,6 @@ float4 main(PFXVertToPix IN) : SV_TARGET
|
||||||
#if CAPTURING == 1
|
#if CAPTURING == 1
|
||||||
return float4(lerp(surface.baseColor.rgb,(irradiance + specular* horizon) ,surface.metalness/2),0);
|
return float4(lerp(surface.baseColor.rgb,(irradiance + specular* horizon) ,surface.metalness/2),0);
|
||||||
#else
|
#else
|
||||||
return float4((irradiance + specular* horizon)*ambientColor.rgb, 0);//alpha writes disabled
|
return float4((irradiance + specular* horizon)*ambientColor, 0);//alpha writes disabled
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue