File: visualize_depth.x3dv

package info (click to toggle)
view3dscene 4.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 13,824 kB
  • sloc: pascal: 3,961; sh: 330; xml: 261; makefile: 133
file content (24 lines) | stat: -rw-r--r-- 512 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#X3D V4.0 utf8
PROFILE Interchange

# Visualize depth screen effect.
#
# See https://castle-engine.io/x3d_extensions_screen_effects.php
# for docs how to write screen effects for CGE.

ScreenEffect {
  needsDepth TRUE
  shaders ComposedShader {
    language "GLSL"
    parts ShaderPart {
      type "FRAGMENT"
      url "data:text/plain,
        void main (void)
        {
          float d = pow(screenf_get_original_depth(), 20.0);
          gl_FragColor = vec4(d, d, d, 1.0);
        };
        "
    }
  }
}