diff --git a/install/gl/zfill_alpha_fp.glsl b/install/gl/zfill_alpha_fp.glsl index 8fcc57ef5d..9089464e23 100644 --- a/install/gl/zfill_alpha_fp.glsl +++ b/install/gl/zfill_alpha_fp.glsl @@ -4,7 +4,7 @@ uniform sampler2D u_diffuse; uniform float u_alphaTest; uniform mat4 u_objectTransform; -varying vec2 var_tex_diffuse; +varying vec2 var_TexDiffuse; void main() { @@ -15,7 +15,7 @@ void main() } else { - vec4 tex = texture2D(u_diffuse, var_tex_diffuse); + vec4 tex = texture2D(u_diffuse, var_TexDiffuse); if (tex.a <= u_alphaTest) { diff --git a/install/gl/zfill_vp.glsl b/install/gl/zfill_vp.glsl index ff151d680c..e2205f8dbc 100644 --- a/install/gl/zfill_vp.glsl +++ b/install/gl/zfill_vp.glsl @@ -1,40 +1,21 @@ -/// ============================================================================ -/* -Copyright (C) 2004 Robert Beckebans -Please see the file "CONTRIBUTORS" for a list of contributors +#version 120 -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. +in vec4 attr_Position; // bound to attribute 0 in source, in object space +in vec4 attr_TexCoord; // bound to attribute 8 in source -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +uniform mat4 u_objectTransform; // object transform (object2world) -See the GNU Lesser General Public License for more details. +varying vec2 var_TexDiffuse; -You should have received a copy of the GNU Lesser General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -/// ============================================================================ - -attribute vec4 attr_TexCoord0; - -uniform mat4 u_objectTransform; - -varying vec2 var_tex_diffuse; - -void main() +void main() { // Apply the supplied object transform to the incoming vertex - // transform vertex position into homogenous clip-space - gl_Position = gl_ModelViewProjectionMatrix * u_objectTransform * gl_Vertex; + // transform vertex position into homogenous clip-space + gl_Position = gl_ModelViewProjectionMatrix * u_objectTransform * attr_Position; - // transform texcoords - var_tex_diffuse = (gl_TextureMatrix[0] * attr_TexCoord0).st; + // transform texcoords + var_TexDiffuse = (gl_TextureMatrix[0] * attr_TexCoord).st; - // assign color - gl_FrontColor = gl_Color; + // assign color + gl_FrontColor = gl_Color; } diff --git a/radiantcore/rendersystem/backend/glprogram/GLSLDepthFillAlphaProgram.cpp b/radiantcore/rendersystem/backend/glprogram/GLSLDepthFillAlphaProgram.cpp index 590591015d..7f1d98fa97 100644 --- a/radiantcore/rendersystem/backend/glprogram/GLSLDepthFillAlphaProgram.cpp +++ b/radiantcore/rendersystem/backend/glprogram/GLSLDepthFillAlphaProgram.cpp @@ -24,7 +24,8 @@ void GLSLDepthFillAlphaProgram::create() DEPTHFILL_ALPHA_VP_FILENAME, DEPTHFILL_ALPHA_FP_FILENAME ); - glBindAttribLocation(_programObj, GLProgramAttribute::TexCoord, "attr_TexCoord0"); + glBindAttribLocation(_programObj, GLProgramAttribute::Position, "attr_Position"); + glBindAttribLocation(_programObj, GLProgramAttribute::TexCoord, "attr_TexCoord"); glLinkProgram(_programObj);