Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All non-color debug channels output in linear color space #445

Merged
merged 1 commit into from
Dec 16, 2022
Merged
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
26 changes: 13 additions & 13 deletions source/Renderer/shaders/pbr.frag
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,10 @@ void main()
g_finalColor.rgb = (normalInfo.b + 1.0) / 2.0;
#endif
#if DEBUG == DEBUG_ALPHA
g_finalColor.rgb = linearTosRGB(vec3(baseColor.a));
g_finalColor.rgb = vec3(baseColor.a);
#endif
#if DEBUG == DEBUG_OCCLUSION && defined(HAS_OCCLUSION_MAP)
g_finalColor.rgb = linearTosRGB(vec3(ao));
g_finalColor.rgb = vec3(ao);
#endif
#if DEBUG == DEBUG_EMISSIVE
g_finalColor.rgb = linearTosRGB(f_emissive);
Expand All @@ -348,10 +348,10 @@ void main()
g_finalColor.rgb = linearTosRGB(f_diffuse + f_specular);
#endif
#if DEBUG == DEBUG_METALLIC
g_finalColor.rgb = linearTosRGB(vec3(materialInfo.metallic));
g_finalColor.rgb = vec3(materialInfo.metallic);
#endif
#if DEBUG == DEBUG_ROUGHNESS
g_finalColor.rgb = linearTosRGB(vec3(materialInfo.perceptualRoughness));
g_finalColor.rgb = vec3(materialInfo.perceptualRoughness);
#endif
#if DEBUG == DEBUG_BASE_COLOR
g_finalColor.rgb = linearTosRGB(materialInfo.baseColor);
Expand All @@ -364,10 +364,10 @@ void main()
g_finalColor.rgb = linearTosRGB(f_clearcoat);
#endif
#if DEBUG == DEBUG_CLEARCOAT_FACTOR
g_finalColor.rgb = linearTosRGB(vec3(materialInfo.clearcoatFactor));
g_finalColor.rgb = vec3(materialInfo.clearcoatFactor);
#endif
#if DEBUG == DEBUG_CLEARCOAT_ROUGHNESS
g_finalColor.rgb = linearTosRGB(vec3(materialInfo.clearcoatRoughness));
g_finalColor.rgb = vec3(materialInfo.clearcoatRoughness);
#endif
#if DEBUG == DEBUG_CLEARCOAT_NORMAL
g_finalColor.rgb = (materialInfo.clearcoatNormal + vec3(1)) / 2.0;
Expand All @@ -380,10 +380,10 @@ void main()
g_finalColor.rgb = linearTosRGB(f_sheen);
#endif
#if DEBUG == DEBUG_SHEEN_COLOR
g_finalColor.rgb = linearTosRGB(materialInfo.sheenColorFactor);
g_finalColor.rgb = materialInfo.sheenColorFactor;
#endif
#if DEBUG == DEBUG_SHEEN_ROUGHNESS
g_finalColor.rgb = linearTosRGB(vec3(materialInfo.sheenRoughnessFactor));
g_finalColor.rgb = vec3(materialInfo.sheenRoughnessFactor);
#endif
#endif

Expand Down Expand Up @@ -411,25 +411,25 @@ vec3 specularTexture = vec3(1.0);
g_finalColor.rgb = linearTosRGB(f_transmission);
#endif
#if DEBUG == DEBUG_TRANSMISSION_FACTOR
g_finalColor.rgb = linearTosRGB(vec3(materialInfo.transmissionFactor));
g_finalColor.rgb = vec3(materialInfo.transmissionFactor);
#endif
#endif
#ifdef MATERIAL_VOLUME
#if DEBUG == DEBUG_VOLUME_THICKNESS
g_finalColor.rgb = linearTosRGB(vec3(materialInfo.thickness));
g_finalColor.rgb = vec3(materialInfo.thickness);
#endif
#endif

// Iridescence:
#ifdef MATERIAL_IRIDESCENCE
#if DEBUG == DEBUG_IRIDESCENCE
g_finalColor.rgb = linearTosRGB(iridescenceFresnel);
g_finalColor.rgb = iridescenceFresnel;
#endif
#if DEBUG == DEBUG_IRIDESCENCE_FACTOR
g_finalColor.rgb = linearTosRGB(vec3(materialInfo.iridescenceFactor));
g_finalColor.rgb = vec3(materialInfo.iridescenceFactor);
#endif
#if DEBUG == DEBUG_IRIDESCENCE_THICKNESS
g_finalColor.rgb = linearTosRGB(vec3(materialInfo.iridescenceThickness / 1200.0));
g_finalColor.rgb = vec3(materialInfo.iridescenceThickness / 1200.0);
#endif
#endif
}