-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Debug shader output functionality (#5261)
* Debug shader output functionality * updated docs * added comma * var -> const * renamed constants --------- Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com>
- Loading branch information
1 parent
1af7fae
commit a7aebb0
Showing
11 changed files
with
240 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
export default /* glsl */` | ||
#ifdef DEBUG_ALBEDO_PASS | ||
gl_FragColor = vec4(litShaderArgs.albedo , 1.0); | ||
#endif | ||
#ifdef DEBUG_UV0_PASS | ||
gl_FragColor = vec4(litShaderArgs.albedo , 1.0); | ||
#endif | ||
#ifdef DEBUG_WORLD_NORMAL_PASS | ||
gl_FragColor = vec4(litShaderArgs.worldNormal * 0.5 + 0.5, 1.0); | ||
#endif | ||
#ifdef DEBUG_OPACITY_PASS | ||
gl_FragColor = vec4(vec3(litShaderArgs.opacity) , 1.0); | ||
#endif | ||
#ifdef DEBUG_SPECULARITY_PASS | ||
gl_FragColor = vec4(litShaderArgs.specularity, 1.0); | ||
#endif | ||
#ifdef DEBUG_GLOSS_PASS | ||
gl_FragColor = vec4(vec3(litShaderArgs.gloss) , 1.0); | ||
#endif | ||
#ifdef DEBUG_METALNESS_PASS | ||
gl_FragColor = vec4(vec3(litShaderArgs.metalness) , 1.0); | ||
#endif | ||
#ifdef DEBUG_AO_PASS | ||
gl_FragColor = vec4(vec3(litShaderArgs.ao) , 1.0); | ||
#endif | ||
#ifdef DEBUG_EMISSION_PASS | ||
gl_FragColor = vec4(litShaderArgs.emission, 1.0); | ||
#endif | ||
`; |
9 changes: 9 additions & 0 deletions
9
src/scene/shader-lib/chunks/lit/frag/debug-process-frontend.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export default /* glsl */` | ||
#ifdef DEBUG_LIGHTING_PASS | ||
litShaderArgs.albedo = vec3(0.5); | ||
#endif | ||
#ifdef DEBUG_UV0_PASS | ||
litShaderArgs.albedo = vec3(vUv0, 0); | ||
#endif | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.