mirror of
https://github.com/ZDoom/Raze.git
synced 2025-05-13 17:20:59 +00:00
- minor fixes.
This commit is contained in:
parent
bd4e4834e3
commit
644b07b718
5 changed files with 7 additions and 19 deletions
|
@ -406,7 +406,7 @@ void animvpx_setup_glstate(int32_t animvpx_flags)
|
||||||
OSD_Printf("animvpx link log: %s\n", logbuf);
|
OSD_Printf("animvpx link log: %s\n", logbuf);
|
||||||
|
|
||||||
/* Finally, use the program. */
|
/* Finally, use the program. */
|
||||||
useShaderProgram(PHandle);
|
glUseProgram(PHandle);
|
||||||
|
|
||||||
|
|
||||||
////////// GL STATE //////////
|
////////// GL STATE //////////
|
||||||
|
|
|
@ -3494,7 +3494,7 @@ static int32_t defsparser(scriptfile *script)
|
||||||
case T_SRC:
|
case T_SRC:
|
||||||
case T_DST:
|
case T_DST:
|
||||||
{
|
{
|
||||||
static const tokenlist glBlendFuncTokens[] =
|
static const tokenlist blendFuncTokens[] =
|
||||||
{
|
{
|
||||||
{ "ZERO", T_ZERO },
|
{ "ZERO", T_ZERO },
|
||||||
{ "ONE", T_ONE },
|
{ "ONE", T_ONE },
|
||||||
|
@ -3508,7 +3508,7 @@ static int32_t defsparser(scriptfile *script)
|
||||||
{ "ONE_MINUS_DST_COLOR", T_ONE_MINUS_DST_COLOR },
|
{ "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
|
#ifdef USE_OPENGL
|
||||||
uint8_t * const factor = glblenddeftoken == T_SRC ? &glbdef->src : &glbdef->dst;
|
uint8_t * const factor = glblenddeftoken == T_SRC ? &glbdef->src : &glbdef->dst;
|
||||||
|
|
|
@ -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);
|
FileReader GetBaseResource(const char* fn);
|
||||||
|
|
||||||
// one-time initialization of OpenGL for polymost
|
// one-time initialization of OpenGL for polymost
|
||||||
|
@ -6732,7 +6727,7 @@ void polymost_fillpolygon(int32_t npoints)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GLInterface.EnableBlend(false);
|
GLInterface.EnableBlend(false);
|
||||||
glColor3f(f, f, f);
|
GLInterface.SetColor(f, f, f);
|
||||||
}
|
}
|
||||||
|
|
||||||
tessectrap((float *)rx1,(float *)ry1,xb1,npoints);
|
tessectrap((float *)rx1,(float *)ry1,xb1,npoints);
|
||||||
|
|
|
@ -13,9 +13,6 @@ uniform sampler2D s_palette;
|
||||||
uniform sampler2D s_detail;
|
uniform sampler2D s_detail;
|
||||||
uniform sampler2D s_glow;
|
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_palswapPos;
|
||||||
uniform vec2 u_palswapSize;
|
uniform vec2 u_palswapSize;
|
||||||
|
|
||||||
|
@ -60,8 +57,7 @@ void main()
|
||||||
vec2 transitionBlend = fwidth(floor(newCoord.xy));
|
vec2 transitionBlend = fwidth(floor(newCoord.xy));
|
||||||
transitionBlend = fwidth(transitionBlend)+transitionBlend;
|
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);
|
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, texCoord);
|
||||||
vec4 color = texture2D(s_texture, u_texturePosSize.xy+texCoord);
|
|
||||||
|
|
||||||
float shade = clamp((u_shade+max(u_visFactor*v_distance-0.5*u_shadeInterpolate,c_zero)), c_zero, u_numShades-c_one);
|
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);
|
float shadeFrac = mod(shade, c_one);
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
varying vec4 v_color;
|
varying vec4 v_color;
|
||||||
varying float v_distance;
|
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 float u_usePalette;
|
||||||
uniform mat4 u_rotMatrix;
|
uniform mat4 u_rotMatrix;
|
||||||
|
|
||||||
|
@ -22,11 +20,10 @@ void main()
|
||||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||||
gl_TexCoord[0] = mix(gl_TexCoord[0].xyzw, gl_TexCoord[0].yxzw, u_usePalette);
|
gl_TexCoord[0] = mix(gl_TexCoord[0].xyzw, gl_TexCoord[0].yxzw, u_usePalette);
|
||||||
|
|
||||||
gl_TexCoord[3] = gl_TextureMatrix[3] * gl_MultiTexCoord3;
|
gl_TexCoord[3] = gl_TextureMatrix[3] * gl_MultiTexCoord0;
|
||||||
gl_TexCoord[4] = gl_TextureMatrix[4] * gl_MultiTexCoord4;
|
gl_TexCoord[4] = gl_TextureMatrix[4] * gl_MultiTexCoord0;
|
||||||
|
|
||||||
gl_FogFragCoord = abs(eyeCoordPosition.z);
|
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_color = gl_Color;
|
||||||
v_distance = gl_Vertex.z;
|
v_distance = gl_Vertex.z;
|
||||||
|
|
Loading…
Reference in a new issue