Skip to content

Commit

Permalink
RTSS: fixup normalmap lookup
Browse files Browse the repository at this point in the history
fixup for bf9613b
  • Loading branch information
paroj committed May 11, 2023
1 parent bf9613b commit 6e857a6
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ bool NormalMapLighting::createCpuSubPrograms(ProgramSet* programSet)
// Output texture coordinates.
vstage.assign(vsInTexcoord, vsOutTexcoord);

// Add the normal fetch function invocation
auto normalMapSampler = psProgram->resolveParameter(GCT_SAMPLER2D, "gNormalMapSampler", mNormalMapSamplerIndex);
fstage.callFunction(SGX_FUNC_FETCHNORMAL, normalMapSampler, psInTexcoord, newViewNormal);

if (mNormalMapSpace == NMS_PARALLAX)
{
Expand All @@ -107,6 +105,9 @@ bool NormalMapLighting::createCpuSubPrograms(ProgramSet* programSet)
fstage.assign(psInTexcoord, texcoord0);
}

// Add the normal fetch function invocation
fstage.callFunction(SGX_FUNC_FETCHNORMAL, normalMapSampler, psInTexcoord, newViewNormal);

if (mNormalMapSpace & NMS_TANGENT)
{
auto vsInTangent = vsMain->resolveInputParameter(Parameter::SPC_TANGENT_OBJECT_SPACE);
Expand Down

0 comments on commit 6e857a6

Please sign in to comment.