File: debug.omwfx

package info (click to toggle)
openmw 0.49.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 33,992 kB
  • sloc: cpp: 372,479; xml: 2,149; sh: 1,403; python: 797; makefile: 26
file content (54 lines) | stat: -rw-r--r-- 1,400 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
uniform_bool uDisplayDepth {
    header = "#{OMWShaders:DebugHeaderDepth}";
    default = true;
    display_name = "#{OMWShaders:DisplayDepthName}";
}

uniform_float uDepthFactor {
    step = 0.1;
    min = 0.01;
    max = 20.0;
    default = 1.0;
    display_name = "#{OMWShaders:DisplayDepthFactorName}";
    description = "#{OMWShaders:DisplayDepthFactorDescription}";
}

uniform_bool uDisplayNormals {
    header = "#{OMWShaders:DebugHeaderNormals}";
    default = true;
    display_name = "#{OMWShaders:DisplayNormalsName}";
}

uniform_bool uNormalsInWorldSpace {
    default = false;
    display_name = "#{OMWShaders:NormalsInWorldSpace}";
}

fragment main {

    omw_In vec2 omw_TexCoord;

    void main()
    {
        omw_FragColor = omw_GetLastShader(omw_TexCoord);

        if (uDisplayDepth)
            omw_FragColor = vec4(vec3(omw_GetLinearDepth(omw_TexCoord) / omw.far * uDepthFactor), 1.0);
#if OMW_NORMALS
        if (uDisplayNormals && (!uDisplayDepth || omw_TexCoord.x < 0.5)) {
            if (uNormalsInWorldSpace)
                omw_FragColor.rgb = omw_GetNormalsWorldSpace(omw_TexCoord) * 0.5 + 0.5;
            else
                omw_FragColor.rgb = omw_GetNormals(omw_TexCoord) * 0.5 + 0.5;
        }
#endif
    }
}

technique {
    passes = main;
    description = "#{OMWShaders:DebugDescription}";
    author = "OpenMW";
    version = "1.0";
    pass_normals = true;
}