diff --git a/source/build/src/animvpx.cpp b/source/build/src/animvpx.cpp index 50e5832dc..863bfae37 100644 --- a/source/build/src/animvpx.cpp +++ b/source/build/src/animvpx.cpp @@ -406,7 +406,7 @@ void animvpx_setup_glstate(int32_t animvpx_flags) OSD_Printf("animvpx link log: %s\n", logbuf); /* Finally, use the program. */ - useShaderProgram(PHandle); + glUseProgram(PHandle); ////////// GL STATE ////////// diff --git a/source/build/src/defs.cpp b/source/build/src/defs.cpp index 0d7d58526..d9ee17c46 100644 --- a/source/build/src/defs.cpp +++ b/source/build/src/defs.cpp @@ -3494,7 +3494,7 @@ static int32_t defsparser(scriptfile *script) case T_SRC: case T_DST: { - static const tokenlist glBlendFuncTokens[] = + static const tokenlist blendFuncTokens[] = { { "ZERO", T_ZERO }, { "ONE", T_ONE }, @@ -3508,7 +3508,7 @@ static int32_t defsparser(scriptfile *script) { "ONE_MINUS_DST_COLOR", T_ONE_MINUS_DST_COLOR }, }; - int32_t factortoken = getatoken(script,glBlendFuncTokens,ARRAY_SIZE(glBlendFuncTokens)); + int32_t factortoken = getatoken(script,blendFuncTokens,ARRAY_SIZE(blendFuncTokens)); #ifdef USE_OPENGL uint8_t * const factor = glblenddeftoken == T_SRC ? &glbdef->src : &glbdef->dst; diff --git a/source/build/src/polymost.cpp b/source/build/src/polymost.cpp index 1d7ff661f..10d907aa4 100644 --- a/source/build/src/polymost.cpp +++ b/source/build/src/polymost.cpp @@ -370,11 +370,6 @@ static void polymost_bindPth(pthtyp const* const pPth, int sampler) } -void useShaderProgram(uint32_t shaderID) -{ - glUseProgram(shaderID); -} - FileReader GetBaseResource(const char* fn); // one-time initialization of OpenGL for polymost @@ -6732,7 +6727,7 @@ void polymost_fillpolygon(int32_t npoints) else { GLInterface.EnableBlend(false); - glColor3f(f, f, f); + GLInterface.SetColor(f, f, f); } tessectrap((float *)rx1,(float *)ry1,xb1,npoints); diff --git a/wadsrc/static/demolition/shaders/glsl/polymost.fp b/wadsrc/static/demolition/shaders/glsl/polymost.fp index e16340707..18849d098 100644 --- a/wadsrc/static/demolition/shaders/glsl/polymost.fp +++ b/wadsrc/static/demolition/shaders/glsl/polymost.fp @@ -13,9 +13,6 @@ uniform sampler2D s_palette; uniform sampler2D s_detail; uniform sampler2D s_glow; -//u_texturePosSize is the texture position & size packaged into a single vec4 as {pos.x, pos.y, size.x, size.y} -uniform vec4 u_texturePosSize; -uniform vec2 u_halfTexelSize; uniform vec2 u_palswapPos; uniform vec2 u_palswapSize; @@ -60,8 +57,7 @@ void main() vec2 transitionBlend = fwidth(floor(newCoord.xy)); transitionBlend = fwidth(transitionBlend)+transitionBlend; vec2 texCoord = mix(mix(fract(newCoord.xy), abs(c_one-mod(newCoord.xy+c_one, c_two)), transitionBlend), clamp(newCoord.xy, c_zero, c_one), u_clamp); - texCoord = clamp(u_texturePosSize.zw*texCoord, u_halfTexelSize, u_texturePosSize.zw-u_halfTexelSize); - vec4 color = texture2D(s_texture, u_texturePosSize.xy+texCoord); + vec4 color = texture2D(s_texture, texCoord); float shade = clamp((u_shade+max(u_visFactor*v_distance-0.5*u_shadeInterpolate,c_zero)), c_zero, u_numShades-c_one); float shadeFrac = mod(shade, c_one); diff --git a/wadsrc/static/demolition/shaders/glsl/polymost.vp b/wadsrc/static/demolition/shaders/glsl/polymost.vp index 3af69c413..57695a6a3 100644 --- a/wadsrc/static/demolition/shaders/glsl/polymost.vp +++ b/wadsrc/static/demolition/shaders/glsl/polymost.vp @@ -3,8 +3,6 @@ varying vec4 v_color; varying float v_distance; -//u_texturePosSize is the texture position & size packaged into a single vec4 as {pos.x, pos.y, size.x, size.y} -uniform vec4 u_texturePosSize; uniform float u_usePalette; uniform mat4 u_rotMatrix; @@ -22,11 +20,10 @@ void main() gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; gl_TexCoord[0] = mix(gl_TexCoord[0].xyzw, gl_TexCoord[0].yxzw, u_usePalette); - gl_TexCoord[3] = gl_TextureMatrix[3] * gl_MultiTexCoord3; - gl_TexCoord[4] = gl_TextureMatrix[4] * gl_MultiTexCoord4; + gl_TexCoord[3] = gl_TextureMatrix[3] * gl_MultiTexCoord0; + gl_TexCoord[4] = gl_TextureMatrix[4] * gl_MultiTexCoord0; gl_FogFragCoord = abs(eyeCoordPosition.z); - //gl_FogFragCoord = clamp((gl_Fog.end-abs(eyeCoordPosition.z))*gl_Fog.scale, c_zero, c_one); v_color = gl_Color; v_distance = gl_Vertex.z;