crashfix: we don't actually need the texture coordinates for forward lit surface creation. at that point, the rest of the shader features have already filled out the info being looked up from the gbuffer for deferred. (was triggering errors with float2 vs float3 coord entries for terrain)

This commit is contained in:
AzaezelX 2019-07-21 23:03:32 -05:00
parent 9859d9b7bc
commit b6c28638b0
2 changed files with 3 additions and 8 deletions

View file

@ -848,10 +848,6 @@ Var* ShaderFeatureHLSL::getSurface(Vector<ShaderComponent*>& componentList, Mult
meta->addStatement(new GenOp(" @ = float4(0.0,1.0,@,@);\r\n", colorDecl, smoothness, metalness)); //reconstruct matinfo, no ao darkening
}
Var* inTex = getInTexCoord("texCoord", "float2", componentList);
if (!inTex)
return nullptr;
Var* wsNormal = (Var*)LangElement::find("wsNormal");
Var* normal = (Var*)LangElement::find("normal");
if (!normal)
@ -878,8 +874,8 @@ Var* ShaderFeatureHLSL::getSurface(Vector<ShaderComponent*>& componentList, Mult
if (!surface)
{
surface = new Var("surface", "Surface");
meta->addStatement(new GenOp(" @ = createForwardSurface(@,@,@,@,@,@,@);\r\n\n", new DecOp(surface), diffuseColor, normal, matinfo,
inTex, wsPosition, wsEyePos, wsView));
meta->addStatement(new GenOp(" @ = createForwardSurface(@,@,@,@,@,@);\r\n\n", new DecOp(surface), diffuseColor, normal, matinfo,
wsPosition, wsEyePos, wsView));
}
return surface;

View file

@ -122,8 +122,7 @@ inline Surface createSurface(float4 gbuffer0, TORQUE_SAMPLER2D(gbufferTex1), TOR
return surface;
}
inline Surface createForwardSurface(float4 baseColor, float3 normal, float4 pbrProperties, in float2 uv,
in float3 wsPosition, in float3 wsEyePos, in float3 wsEyeRay)
inline Surface createForwardSurface(float4 baseColor, float3 normal, float4 pbrProperties, in float3 wsPosition, in float3 wsEyePos, in float3 wsEyeRay)
{
Surface surface = (Surface)0;