Skip to content

Commit

Permalink
Fix up emissive energy compensation for glTF.
Browse files Browse the repository at this point in the history
  • Loading branch information
prideout committed Feb 25, 2019
1 parent d8ca867 commit 186920e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion samples/app/MeshAssimp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,12 @@ std::string shaderFromConfig(MaterialConfig config) {
material.roughness = materialParams.roughnessFactor * metallicRoughness.g;
material.metallic = materialParams.metallicFactor * metallicRoughness.b;
material.ambientOcclusion = texture(materialParams_aoMap, aoUV).r;
material.emissive = texture(materialParams_emissiveMap, emissiveUV);
material.emissive.rgb = texture(materialParams_emissiveMap, emissiveUV).rgb;
material.emissive.rgb *= materialParams.emissiveFactor.rgb;
// The opinionated lighting model specified by glTF does not account for energy
// compensation, using this value basically disables it:
material.emissive.a = 3.0;
)SHADER";
}

Expand Down

0 comments on commit 186920e

Please sign in to comment.