Skip to content

Commit

Permalink
[OW-1655] feat: lod debug vis (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
MAG-AdrianMeredith authored Aug 14, 2024
1 parent 1ba0644 commit f0ad4d1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/scene/shader-lib/chunks/lit/frag/base.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
export default /* glsl */`
uniform vec3 view_position;
// magnopus patched
#ifdef LOD_PASS
uniform int lod_level;
#endif
uniform vec3 light_globalAmbient;
float square(float x) {
Expand Down
12 changes: 12 additions & 0 deletions src/scene/shader-lib/chunks/lit/frag/debug-output.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ export default /* glsl */`
#ifdef DEBUG_ALBEDO_PASS
gl_FragColor = vec4(gammaCorrectOutput(dAlbedo), 1.0);
#endif
// magnopus patched
#ifdef LOD_PASS
if (lod_level == 0) {
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
} else if (lod_level == 1) {
gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);
} else if (lod_level == 2) {
gl_FragColor = vec4(0.0, 1.0, 1.0, 1.0);
} else if (lod_level == 3) {
gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0);
}
#endif
#ifdef DEBUG_UV0_PASS
gl_FragColor = vec4(litArgs_albedo , 1.0);
Expand Down

0 comments on commit f0ad4d1

Please sign in to comment.