Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Warn: Source for shader program genericMaterial:
- 0: #version 450 core
- 1: #define HAVE_ARB_texture_gather 1
- 2: #define HAVE_EXT_gpu_shader4 1
- 3: #define HAVE_ARB_gpu_shader5 1
- 4: #define HAVE_ARB_uniform_buffer_object 1
- 5: #extension GL_ARB_shader_draw_parameters : require
- 6: #define HAVE_ARB_shader_draw_parameters 1
- 7: #define HAVE_ARB_shader_storage_buffer_object 1
- 8: #extension GL_ARB_gpu_shader_int64 : require
- 9: #define HAVE_ARB_gpu_shader_int64 1
- 10: #define IN(mode) mode in
- 11: #define DECLARE_OUTPUT(type) out type outputColor;
- 12: #define textureCube texture
- 13: #define texture2D texture
- 14: #define texture2DProj textureProj
- 15: #define texture3D texture
- 16: IN(flat) int in_drawID;
- 17: IN(flat) int in_baseInstance;
- 18: #ifndef r_dynamicLight
- 19: #define r_dynamicLight 1
- 20: #endif
- 21: #ifndef r_precomputedLighting
- 22: #define r_precomputedLighting 1
- 23: #endif
- 24: #ifndef r_vertexSkinning
- 25: #define r_vertexSkinning 1
- 26: #endif
- 27: const int MAX_GLSL_BONES = 256;
- 28: #ifndef r_halfLambertLighting
- 29: #define r_halfLambertLighting 1
- 30: #endif
- 31: #ifndef r_rimLighting
- 32: #define r_rimLighting 1
- 33: #endif
- 34: const float r_RimExponent = 3.00000000e+00;
- 35: #ifndef r_normalMapping
- 36: #define r_normalMapping 1
- 37: #endif
- 38: #ifndef r_liquidMapping
- 39: #define r_liquidMapping 1
- 40: #endif
- 41: #ifndef r_specularMapping
- 42: #define r_specularMapping 1
- 43: #endif
- 44: #ifndef r_physicalMapping
- 45: #define r_physicalMapping 1
- 46: #endif
- 47: #ifndef r_glowMapping
- 48: #define r_glowMapping 1
- 49: #endif
- 50:
- 51: struct DrawcallState {
- 52: mat4 u_TextureMatrix;
- 53: vec4 u_ColorModulate;
- 54: vec4 u_Color;
- 55: uvec2 u_ColorMap;
- 56: uvec2 u_DepthMap;
- 57: float u_AlphaThreshold;
- 58: float u_InverseLightFactor;
- 59: float u_VertexInterpolation;
- 60: float u_DepthScale;
- 61: float u_Time;
- 62: int drawcallState_padding0;
- 63: };
- 64:
- 65: layout(std430, binding = 0) readonly buffer drawcallStateSSBO {
- 66: DrawcallState drawcallStates[];
- 67: };
- 68:
- 69: #define drawID in_drawID
- 70: #define baseInstance in_baseInstance
- 71:
- 72: #define u_TextureMatrix drawcallStates[baseInstance].u_TextureMatrix
- 73: #define u_ColorModulate drawcallStates[baseInstance].u_ColorModulate
- 74: #define u_Color drawcallStates[baseInstance].u_Color
- 75: #define u_ColorMap_initial uvec2( drawcallStates[baseInstance].u_ColorMap )
- 76: #define u_DepthMap_initial uvec2( drawcallStates[baseInstance].u_DepthMap )
- 77: #define u_AlphaThreshold drawcallStates[baseInstance].u_AlphaThreshold
- 78: #define u_InverseLightFactor drawcallStates[baseInstance].u_InverseLightFactor
- 79: #define u_VertexInterpolation drawcallStates[baseInstance].u_VertexInterpolation
- 80: #define u_DepthScale drawcallStates[baseInstance].u_DepthScale
- 81: #define u_Time drawcallStates[baseInstance].u_Time
- 82:
- 83: uniform vec3 u_ViewOrigin;
- 84: uniform vec3 u_ViewUp;
- 85: uniform mat4 u_ModelMatrix;
- 86: uniform mat4 u_ModelViewProjectionMatrix;
- 87:
- 88: #ifndef TEXTURE_RG
- 89: #define TEXTURE_RG 1
- 90: #endif
- 91: #ifndef UNIFORM_BUFFER_OBJECT
- 92: #define UNIFORM_BUFFER_OBJECT 1
- 93: #endif
- 94: #ifndef TEXTURE_INTEGER
- 95: #define TEXTURE_INTEGER 1
- 96: #endif
- 97: #ifndef r_AmbientScale
- 98: #define r_AmbientScale 1.00000000e+00
- 99: #endif
- 100: #ifndef r_SpecularScale
- 101: #define r_SpecularScale 1.00000000e+00
- 102: #endif
- 103: #ifndef r_zNear
- 104: #define r_zNear 3.00000000e+00
- 105: #endif
- 106: #ifndef M_PI
- 107: #define M_PI 3.14159274e+00
- 108: #endif
- 109: #ifndef MAX_SHADOWMAPS
- 110: #define MAX_SHADOWMAPS 5
- 111: #endif
- 112: #ifndef MAX_REF_LIGHTS
- 113: #define MAX_REF_LIGHTS 1024
- 114: #endif
- 115: #ifndef TILE_SIZE
- 116: #define TILE_SIZE 16
- 117: #endif
- 118: #ifndef r_FBufSize
- 119: #define r_FBufSize vec2(1.92000000e+03, 1.08000000e+03)
- 120: #endif
- 121: #ifndef r_tileStep
- 122: #define r_tileStep vec2(8.33333377e-03, 1.48148146e-02)
- 123: #endif
- 124: /*
- 125: ===========================================================================
- 126: Copyright (C) 2006-2011 Robert Beckebans <trebor_7@users.sourceforge.net>
- 127:
- 128: This file is part of XreaL source code.
- 129:
- 130: XreaL source code is free software; you can redistribute it
- 131: and/or modify it under the terms of the GNU General Public License as
- 132: published by the Free Software Foundation; either version 2 of the License,
- 133: or (at your option) any later version.
- 134:
- 135: XreaL source code is distributed in the hope that it will be
- 136: useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
- 137: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- 138: GNU General Public License for more details.
- 139:
- 140: You should have received a copy of the GNU General Public License
- 141: along with XreaL source code; if not, write to the Free Software
- 142: Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- 143: ===========================================================================
- 144: */
- 145:
- 146: /* generic_fp.glsl */
- 147:
- 148:
- 149: #if !defined(GENERIC_2D)
- 150: #endif
- 151:
- 152: IN(smooth) vec2 var_TexCoords;
- 153: IN(smooth) vec4 var_Color;
- 154:
- 155: #if defined(USE_DEPTH_FADE) || defined(USE_VERTEX_SPRITE)
- 156: IN(smooth) vec2 var_FadeDepth;
- 157: #endif
- 158:
- 159: DECLARE_OUTPUT(vec4)
- 160:
- 161: void main()
- 162: {
- 163: sampler2D u_ColorMap = sampler2D(u_ColorMap_initial);
- 164: vec4 color = texture2D(u_ColorMap, var_TexCoords);
- 165:
- 166: #if defined(USE_ALPHA_TESTING)
- 167: if( abs(color.a + u_AlphaThreshold) <= 1.0 )
- 168: {
- 169: discard;
- 170: return;
- 171: }
- 172: #endif
- 173:
- 174: #if defined(USE_DEPTH_FADE) || defined(USE_VERTEX_SPRITE)
- 175: sampler2D u_DepthMap = sampler2D(u_DepthMap_initial);
- 176: float depth = texture2D(u_DepthMap, gl_FragCoord.xy / r_FBufSize).x;
- 177: float fadeDepth = 0.5 * var_FadeDepth.x / var_FadeDepth.y + 0.5;
- 178: color.a *= smoothstep(gl_FragCoord.z, fadeDepth, depth);
- 179: #endif
- 180:
- 181: color *= var_Color;
- 182:
- 183: #if !defined(GENERIC_2D) && !defined(USE_DEPTH_FADE)
- 184: color.rgb *= u_InverseLightFactor;
- 185: #endif
- 186:
- 187: outputColor = color;
- 188:
- 189: #if defined(GENERIC_2D)
- 190: gl_FragDepth = 0;
- 191: #endif
- 192:
- 193: // Debugging.
- 194: #if defined(r_showVertexColors) && !defined(GENERIC_2D)
- 195: outputColor = vec4(0.0, 0.0, 0.0, 0.0);
- 196: #endif
- 197: }
- Warn: Compile log:
- 0:164(1): error: image/sampler variables may only be declared as function parameters or uniform-qualified global variables
- 0:164(1): error: opaque variables must be declared uniform
- 0:164(24): error: cannot initialize u_ColorMap variable opaque
- 0:164(24): error: cannot construct opaque type `sampler2D'
- 0:165(23): warning: `u_ColorMap' used uninitialized
- Warn: Unhandled exception (15ShaderException): Couldn't compile fragment shader: genericMaterial
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement