/usr/src/castle-game-engine-4.1.1/x3d/opengl/glsl/screen_effect_library.glsl.inc is in castle-game-engine-src 4.1.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | { -*- buffer-read-only: t -*- }
{ DON'T EDIT -- this file was automatically generated from "screen_effect_library.glsl" }
'/* The library of common functions for GLSL screen effects.' + LineEnding +
' The ObjectPascal code that includes this will take care to define (or not)' + LineEnding +
' symbols MULTI_SAMPLING_x, DEPTH at the beginning of this file.' + LineEnding +
' Screen effect code using these functions is safe to work both with and without' + LineEnding +
' multi-sampling.' + LineEnding +
'*/' + LineEnding +
'' + LineEnding +
'#ifdef MULTI_SAMPLING' + LineEnding +
' #extension GL_ARB_texture_multisample : enable' + LineEnding +
' uniform sampler2DMS screen;' + LineEnding +
' #ifdef DEPTH' + LineEnding +
' uniform sampler2DMS screen_depth;' + LineEnding +
' #endif' + LineEnding +
'#else' + LineEnding +
' #extension GL_ARB_texture_rectangle : enable' + LineEnding +
' uniform sampler2DRect screen;' + LineEnding +
' #ifdef DEPTH' + LineEnding +
' uniform sampler2DRect screen_depth;' + LineEnding +
' #endif' + LineEnding +
'#endif' + LineEnding +
'' + LineEnding +
'ivec2 screen_position()' + LineEnding +
'{' + LineEnding +
' return ivec2(int(gl_TexCoord[0].s), int(gl_TexCoord[0].t));' + LineEnding +
'}' + LineEnding +
'' + LineEnding +
'int screen_x()' + LineEnding +
'{' + LineEnding +
' return int(gl_TexCoord[0].s);' + LineEnding +
'}' + LineEnding +
'' + LineEnding +
'int screen_y()' + LineEnding +
'{' + LineEnding +
' return int(gl_TexCoord[0].t);' + LineEnding +
'}' + LineEnding +
'' + LineEnding +
'vec4 screen_get_color(ivec2 position)' + LineEnding +
'{' + LineEnding +
'/* TODO: it would be nice to autogenerate this code */' + LineEnding +
'#ifdef MULTI_SAMPLING_16' + LineEnding +
' return ( texelFetch(screen, position, 0) +' + LineEnding +
' texelFetch(screen, position, 1) +' + LineEnding +
' texelFetch(screen, position, 2) +' + LineEnding +
' texelFetch(screen, position, 3) +' + LineEnding +
' texelFetch(screen, position, 4) +' + LineEnding +
' texelFetch(screen, position, 5) +' + LineEnding +
' texelFetch(screen, position, 6) +' + LineEnding +
' texelFetch(screen, position, 7) +' + LineEnding +
' texelFetch(screen, position, 8) +' + LineEnding +
' texelFetch(screen, position, 9) +' + LineEnding +
' texelFetch(screen, position, 10) +' + LineEnding +
' texelFetch(screen, position, 11) +' + LineEnding +
' texelFetch(screen, position, 12) +' + LineEnding +
' texelFetch(screen, position, 13) +' + LineEnding +
' texelFetch(screen, position, 14) +' + LineEnding +
' texelFetch(screen, position, 15) ) / 16.0;' + LineEnding +
'#else' + LineEnding +
'#ifdef MULTI_SAMPLING_8' + LineEnding +
' return ( texelFetch(screen, position, 0) +' + LineEnding +
' texelFetch(screen, position, 1) +' + LineEnding +
' texelFetch(screen, position, 2) +' + LineEnding +
' texelFetch(screen, position, 3) +' + LineEnding +
' texelFetch(screen, position, 4) +' + LineEnding +
' texelFetch(screen, position, 5) +' + LineEnding +
' texelFetch(screen, position, 6) +' + LineEnding +
' texelFetch(screen, position, 7) ) / 8.0;' + LineEnding +
'#else' + LineEnding +
'#ifdef MULTI_SAMPLING_4' + LineEnding +
' return ( texelFetch(screen, position, 0) +' + LineEnding +
' texelFetch(screen, position, 1) +' + LineEnding +
' texelFetch(screen, position, 2) +' + LineEnding +
' texelFetch(screen, position, 3) ) / 4.0;' + LineEnding +
'#else' + LineEnding +
'#ifdef MULTI_SAMPLING_2' + LineEnding +
' return ( texelFetch(screen, position, 0) +' + LineEnding +
' texelFetch(screen, position, 1) ) / 2.0;' + LineEnding +
'#else' + LineEnding +
' return texture2DRect(screen, vec2(position)+vec2(0.5));' + LineEnding +
'#endif' + LineEnding +
'#endif' + LineEnding +
'#endif' + LineEnding +
'#endif' + LineEnding +
'}' + LineEnding +
'' + LineEnding +
'#ifdef DEPTH' + LineEnding +
'float screen_get_depth(ivec2 position)' + LineEnding +
'{' + LineEnding +
'/* TODO: it would be nice to autogenerate this code */' + LineEnding +
'#ifdef MULTI_SAMPLING_16' + LineEnding +
' return ( texelFetch(screen_depth, position, 0).r +' + LineEnding +
' texelFetch(screen_depth, position, 1).r +' + LineEnding +
' texelFetch(screen_depth, position, 2).r +' + LineEnding +
' texelFetch(screen_depth, position, 3).r +' + LineEnding +
' texelFetch(screen_depth, position, 4).r +' + LineEnding +
' texelFetch(screen_depth, position, 5).r +' + LineEnding +
' texelFetch(screen_depth, position, 6).r +' + LineEnding +
' texelFetch(screen_depth, position, 7).r +' + LineEnding +
' texelFetch(screen_depth, position, 8).r +' + LineEnding +
' texelFetch(screen_depth, position, 9).r +' + LineEnding +
' texelFetch(screen_depth, position, 10).r +' + LineEnding +
' texelFetch(screen_depth, position, 11).r +' + LineEnding +
' texelFetch(screen_depth, position, 12).r +' + LineEnding +
' texelFetch(screen_depth, position, 13).r +' + LineEnding +
' texelFetch(screen_depth, position, 14).r +' + LineEnding +
' texelFetch(screen_depth, position, 15).r ) / 16.0;' + LineEnding +
'#else' + LineEnding +
'#ifdef MULTI_SAMPLING_8' + LineEnding +
' return ( texelFetch(screen_depth, position, 0).r +' + LineEnding +
' texelFetch(screen_depth, position, 1).r +' + LineEnding +
' texelFetch(screen_depth, position, 2).r +' + LineEnding +
' texelFetch(screen_depth, position, 3).r +' + LineEnding +
' texelFetch(screen_depth, position, 4).r +' + LineEnding +
' texelFetch(screen_depth, position, 5).r +' + LineEnding +
' texelFetch(screen_depth, position, 6).r +' + LineEnding +
' texelFetch(screen_depth, position, 7).r ) / 8.0;' + LineEnding +
'#else' + LineEnding +
'#ifdef MULTI_SAMPLING_4' + LineEnding +
' return ( texelFetch(screen_depth, position, 0).r +' + LineEnding +
' texelFetch(screen_depth, position, 1).r +' + LineEnding +
' texelFetch(screen_depth, position, 2).r +' + LineEnding +
' texelFetch(screen_depth, position, 3).r ) / 4.0;' + LineEnding +
'#else' + LineEnding +
'#ifdef MULTI_SAMPLING_2' + LineEnding +
' return ( texelFetch(screen_depth, position, 0).r +' + LineEnding +
' texelFetch(screen_depth, position, 1).r ) / 2.0;' + LineEnding +
'#else' + LineEnding +
' return texture2DRect(screen_depth, vec2(position)+vec2(0.5)).r;' + LineEnding +
'#endif' + LineEnding +
'#endif' + LineEnding +
'#endif' + LineEnding +
'#endif' + LineEnding +
'}' + LineEnding +
'#endif' + LineEnding +
''
|