Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cmake-build-*/
/mingw/
/.cache/
/_skbuild/

/buildrelease/
# Meta data of macOS's Finder.app
.DS_Store

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ bool CookTorranceLighting::createCpuSubPrograms(ProgramSet* programSet)

// add the lighting computation
auto mrparams = psMain->resolveLocalParameter(GCT_FLOAT2, "metalRoughness");
auto ao = psMain->resolveLocalParameter(GCT_FLOAT1, "ao");
fstage.assign(1.0f, ao); //Default to no AO.
if(!mMetalRoughnessMapName.empty())
{
auto metalRoughnessSampler =
Expand All @@ -106,6 +108,7 @@ bool CookTorranceLighting::createCpuSubPrograms(ProgramSet* programSet)
// This layout intentionally reserves the 'r' channel for (optional) occlusion map data
fstage.sampleTexture(metalRoughnessSampler, psInTexcoord, mrSample);
fstage.assign(In(mrSample).mask(Operand::OPM_YZ), mrparams);
fstage.assign(In(mrSample).x(), ao);
}
else
{
Expand All @@ -124,7 +127,7 @@ bool CookTorranceLighting::createCpuSubPrograms(ProgramSet* programSet)
fstage.assign(Vector3(0), Out(outDiffuse).xyz());
fstage.mul(In(diffuse).w(), In(outDiffuse).w(), Out(outDiffuse).w()); // forward alpha

fstage.callFunction("PBR_MakeParams", {In(baseColor), In(mrparams), InOut(pixelParams)});
fstage.callFunction("PBR_MakeParams", {In(baseColor), In(mrparams), In(ao), InOut(pixelParams)});

fstage = psMain->getStage(FFP_PS_PBR_LIGHTING_END);
if(mLightCount > 0)
Expand Down
Loading