Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/engine/renderer/glsl_source/generic_vp.glsl b/src/engine/renderer/glsl_source/generic_vp.glsl
- index 2b4c21034..4bf94f569 100644
- --- a/src/engine/renderer/glsl_source/generic_vp.glsl
- +++ b/src/engine/renderer/glsl_source/generic_vp.glsl
- @@ -61,7 +61,7 @@ void DeformVertex( inout vec4 pos,
- void main()
- {
- #insert material_vp
- -
- + a
- vec4 position;
- localBasis LB;
- vec4 color;
- -------------------------------
- Debug: building generic shader permutation with macro: GENERIC_2D
- Warn: Source for shader program generic2D:
- 0: #version 460 core
- 1: #define HAVE_EXT_gpu_shader4 1
- 2: #define HAVE_ARB_gpu_shader5 1
- 3: #define HAVE_ARB_texture_gather 1
- 4: #define HAVE_EXT_texture_integer 1
- 5: #define HAVE_ARB_texture_rg 1
- 6: #define HAVE_ARB_uniform_buffer_object 1
- 7: #extension GL_ARB_shader_draw_parameters : require
- 8: #define HAVE_ARB_shader_draw_parameters 1
- 9: #define HAVE_ARB_shader_storage_buffer_object 1
- 10: #ifndef r_AmbientScale
- 11: #define r_AmbientScale 1.00000000e+00
- 12: #endif
- 13: #ifndef r_SpecularScale
- 14: #define r_SpecularScale 1.00000000e+00
- 15: #endif
- 16: #ifndef r_zNear
- 17: #define r_zNear 3.00000000e+00
- 18: #endif
- 19: #ifndef M_PI
- 20: #define M_PI 3.14159274e+00
- 21: #endif
- 22: #ifndef MAX_SHADOWMAPS
- 23: #define MAX_SHADOWMAPS 5
- 24: #endif
- 25: #ifndef MAX_REF_LIGHTS
- 26: #define MAX_REF_LIGHTS 1024
- 27: #endif
- 28: #ifndef TILE_SIZE
- 29: #define TILE_SIZE 16
- 30: #endif
- 31: #ifndef r_FBufSize
- 32: #define r_FBufSize vec2(2.56000000e+03, 1.44000000e+03)
- 33: #endif
- 34: #ifndef r_tileStep
- 35: #define r_tileStep vec2(6.25000009e-03, 1.11111114e-02)
- 36: #endif
- 37: #ifndef r_highPrecisionRendering
- 38: #define r_highPrecisionRendering 1
- 39: #endif
- 40: #ifndef r_precomputedLighting
- 41: #define r_precomputedLighting 1
- 42: #endif
- 43: #ifndef r_vertexSkinning
- 44: #define r_vertexSkinning 1
- 45: #endif
- 46: const int MAX_GLSL_BONES = 256;
- 47: #ifndef r_halfLambertLighting
- 48: #define r_halfLambertLighting 1
- 49: #endif
- 50: #ifndef r_rimLighting
- 51: #define r_rimLighting 1
- 52: #endif
- 53: const float r_RimExponent = 3.00000000e+00;
- 54: #ifndef r_normalMapping
- 55: #define r_normalMapping 1
- 56: #endif
- 57: #ifndef r_specularMapping
- 58: #define r_specularMapping 1
- 59: #endif
- 60: #ifndef r_physicalMapping
- 61: #define r_physicalMapping 1
- 62: #endif
- 63: #ifndef r_glowMapping
- 64: #define r_glowMapping 1
- 65: #endif
- 66: #ifndef r_zNear
- 67: #define r_zNear 3.00000000e+00
- 68: #endif
- 69: #define IN in
- 70: #define OUT(mode) mode out
- 71: #define textureCube texture
- 72: #define texture2D texture
- 73: #define texture2DProj textureProj
- 74: #define texture3D texture
- 75: OUT(flat) int in_drawID;
- 76: OUT(flat) int in_baseInstance;
- 77: #define drawID gl_DrawIDARB
- 78: #define baseInstance gl_BaseInstanceARB
- 79:
- 80: #ifndef GENERIC_2D
- 81: #define GENERIC_2D 1
- 82: #endif
- 83: /*
- 84: ===========================================================================
- 85: Copyright (C) 2006-2011 Robert Beckebans <trebor_7@users.sourceforge.net>
- 86:
- 87: This file is part of XreaL source code.
- 88:
- 89: XreaL source code is free software; you can redistribute it
- 90: and/or modify it under the terms of the GNU General Public License as
- 91: published by the Free Software Foundation; either version 2 of the License,
- 92: or (at your option) any later version.
- 93:
- 94: XreaL source code is distributed in the hope that it will be
- 95: useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
- 96: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- 97: GNU General Public License for more details.
- 98:
- 99: You should have received a copy of the GNU General Public License
- 100: along with XreaL source code; if not, write to the Free Software
- 101: Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- 102: ===========================================================================
- 103: */
- 104:
- 105: /* generic_vp.glsl */
- 106:
- 107: uniform mat4 u_TextureMatrix;
- 108: #if !defined(USE_VERTEX_SPRITE)
- 109: uniform vec3 u_ViewOrigin;
- 110: #endif
- 111:
- 112: uniform float u_Time;
- 113:
- 114: uniform vec4 u_ColorModulate;
- 115: uniform vec4 u_Color;
- 116: #if defined(USE_TCGEN_ENVIRONMENT)
- 117: uniform mat4 u_ModelMatrix;
- 118: #endif
- 119: uniform mat4 u_ModelViewProjectionMatrix;
- 120:
- 121: #if defined(USE_VERTEX_SPRITE)
- 122: OUT(smooth) vec2 var_FadeDepth;
- 123: uniform mat4 u_ProjectionMatrixTranspose;
- 124: #elif defined(USE_DEPTH_FADE)
- 125: uniform float u_DepthScale;
- 126: OUT(smooth) vec2 var_FadeDepth;
- 127: #endif
- 128:
- 129: OUT(smooth) vec2 var_TexCoords;
- 130: OUT(smooth) vec4 var_Color;
- 131:
- 132: void DeformVertex( inout vec4 pos,
- 133: inout vec3 normal,
- 134: inout vec2 st,
- 135: inout vec4 color,
- 136: in float time);
- 137:
- 138: void main()
- 139: {
- 10000: #line 10000 // material_vp.glsl
- 10001: /*
- 10002: ===========================================================================
- 10003:
- 10004: Daemon BSD Source Code
- 10005: Copyright (c) 2024 Daemon Developers
- 10006: All rights reserved.
- 10007:
- 10008: This file is part of the Daemon BSD Source Code (Daemon Source Code).
- 10009:
- 10010: Redistribution and use in source and binary forms, with or without
- 10011: modification, are permitted provided that the following conditions are met:
- 10012: * Redistributions of source code must retain the above copyright
- 10013: notice, this list of conditions and the following disclaimer.
- 10014: * Redistributions in binary form must reproduce the above copyright
- 10015: notice, this list of conditions and the following disclaimer in the
- 10016: documentation and/or other materials provided with the distribution.
- 10017: * Neither the name of the Daemon developers nor the
- 10018: names of its contributors may be used to endorse or promote products
- 10019: derived from this software without specific prior written permission.
- 10020:
- 10021: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- 10022: ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- 10023: WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- 10024: DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY
- 10025: DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- 10026: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- 10027: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- 10028: ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- 10029: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- 10030: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- 10031:
- 10032: ===========================================================================
- 10033: */
- 10034:
- 10035: /* material_vp.glsl */
- 10036:
- 10037: #if defined(USE_MATERIAL_SYSTEM)
- 10038:
- 10039: #ifdef HAVE_ARB_shader_draw_parameters
- 10040: in_drawID = drawID;
- 10041: in_baseInstance = baseInstance;
- 10042: #endif // !HAVE_ARB_shader_draw_parameters
- 10043:
- 10044: #endif // !USE_MATERIAL_SYSTEM
- 140: #line 140
- 141:
- 142: vec4 position;
- ------ ------------^-
- 0:142(13): error: syntax error, unexpected NEW_IDENTIFIER, expecting ',' or ';'
- 143: localBasis LB;
- 144: vec4 color;
- 145: vec2 texCoord, lmCoord;
- 146:
- 147: VertexFetch( position, LB, color, texCoord, lmCoord );
- 148: color = color * u_ColorModulate + u_Color;
- 149:
- 150: DeformVertex( position,
- 151: LB.normal,
- 152: texCoord,
- 153: color,
- 154: u_Time);
- 155:
- 156: // transform vertex position into homogenous clip-space
- 157: gl_Position = u_ModelViewProjectionMatrix * position;
- 158:
- 159: // transform texcoords
- 160: #if defined(USE_TCGEN_ENVIRONMENT)
- 161: {
- 162: // TODO: Explain why only the rotational part of u_ModelMatrix is relevant
- 163: position.xyz = mat3(u_ModelMatrix) * position.xyz;
- 164:
- 165: vec3 viewer = normalize(u_ViewOrigin - position.xyz);
- 166:
- 167: float d = dot(LB.normal, viewer);
- 168:
- 169: vec3 reflected = LB.normal * 2.0 * d - viewer;
- 170:
- 171: var_TexCoords = 0.5 + vec2(0.5, -0.5) * reflected.yz;
- 172: }
- 173: #elif defined(USE_TCGEN_LIGHTMAP)
- 174: var_TexCoords = (u_TextureMatrix * vec4(lmCoord, 0.0, 1.0)).xy;
- 175: #else
- 176: var_TexCoords = (u_TextureMatrix * vec4(texCoord, 0.0, 1.0)).xy;
- 177: #endif
- 178:
- 179: #if defined(USE_DEPTH_FADE)
- 180: // compute z of end of fading effect
- 181: vec4 fadeDepth = u_ModelViewProjectionMatrix * (position - u_DepthScale * vec4(LB.normal, 0.0));
- 182: var_FadeDepth = fadeDepth.zw;
- 183: #elif defined(USE_VERTEX_SPRITE)
- 184: vec4 fadeDepth = u_ModelViewProjectionMatrix * (position - depthScale * vec4(LB.normal, 0.0));
- 185: var_FadeDepth = fadeDepth.zw;
- 186: #endif
- 187:
- 188: var_Color = color;
- 189: }
- Warn: Compile log:
- Warn: 0:142(13): error: syntax error, unexpected NEW_IDENTIFIER, expecting ',' or ';'
- Warn: Unhandled exception (15ShaderException): Couldn't compile vertex shader: generic2D
- Debug: ----- CL_Shutdown -----
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement