mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
Make the face culling a little more sensible.
GL Quake was weird, culling front faces. Partly understandable, since Quake's front order is clockwise and GL's default order is counter-clockwise. However, since the order can be specified, that should be done instead. Thus, specify the winding order as clockwise (for quake's data), set culling for back-face removal, and then mess with the winding direction in the mirror and fish-eye code.
This commit is contained in:
parent
62e564c5cd
commit
1437cbec91
4 changed files with 9 additions and 7 deletions
|
@ -154,7 +154,7 @@ QFGL_NEED (void, glFogf, (GLenum pname, GLfloat param))
|
|||
QFGL_NEED (void, glFogfv, (GLenum pname, const GLfloat * params))
|
||||
QFGL_NEED (void, glFogi, (GLenum pname, GLint param))
|
||||
QFGL_DONT_NEED (void, glFogiv, (GLenum pname, const GLint * params))
|
||||
QFGL_DONT_NEED (void, glFrontFace, (GLenum mode))
|
||||
QFGL_NEED (void, glFrontFace, (GLenum mode))
|
||||
QFGL_NEED (void, glFrustum, (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val))
|
||||
QFGL_NEED (GLuint, glGenLists, (GLsizei range))
|
||||
QFGL_NEED (void, glGenTextures, (GLsizei n, GLuint * textures))
|
||||
|
|
|
@ -469,9 +469,9 @@ R_SetupGL (void)
|
|||
qfglScalef (1, -1, 1);
|
||||
else
|
||||
qfglScalef (-1, 1, 1);
|
||||
qfglCullFace (GL_BACK);
|
||||
qfglFrontFace (GL_CCW);
|
||||
} else
|
||||
qfglCullFace (GL_FRONT);
|
||||
qfglFrontFace (GL_CW);
|
||||
|
||||
qfglMatrixMode (GL_MODELVIEW);
|
||||
qfglLoadIdentity ();
|
||||
|
@ -576,7 +576,7 @@ R_Mirror (void)
|
|||
qfglScalef (1, -1, 1);
|
||||
else
|
||||
qfglScalef (-1, 1, 1);
|
||||
qfglCullFace (GL_FRONT);
|
||||
qfglFrontFace (GL_CW);
|
||||
qfglMatrixMode (GL_MODELVIEW);
|
||||
|
||||
qfglLoadMatrixf (r_base_world_matrix);
|
||||
|
@ -883,7 +883,7 @@ R_InitFishEye (void)
|
|||
-gl_cube_map_size / 2);
|
||||
|
||||
qfglDisable (GL_DEPTH_TEST);
|
||||
qfglCullFace (GL_BACK);
|
||||
qfglFrontFace (GL_CCW);
|
||||
qfglClear (GL_COLOR_BUFFER_BIT);
|
||||
|
||||
qfglEnable (GL_TEXTURE_CUBE_MAP_ARB);
|
||||
|
|
|
@ -615,7 +615,8 @@ GL_Init_Common (void)
|
|||
qfglClearColor (0, 0, 0, 0);
|
||||
|
||||
qfglEnable (GL_TEXTURE_2D);
|
||||
qfglCullFace (GL_FRONT);
|
||||
qfglFrontFace (GL_CW);
|
||||
qfglCullFace (GL_BACK);
|
||||
qfglPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
|
||||
qfglShadeModel (GL_FLAT);
|
||||
|
||||
|
|
|
@ -140,7 +140,8 @@ GL_Init_Common (void)
|
|||
qfglClearColor (0, 0, 0, 0);
|
||||
|
||||
qfglEnable (GL_TEXTURE_2D);
|
||||
qfglCullFace (GL_FRONT);
|
||||
qfglFrontFace (GL_CW);
|
||||
qfglCullFace (GL_BACK);
|
||||
|
||||
qfglEnable (GL_BLEND);
|
||||
qfglBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
|
Loading…
Reference in a new issue