Search
lxdream.org :: lxdream/src/pvr2/glrender.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/glrender.c
changeset 847:2089244671d2
prev736:a02d1475ccfd
next856:02ac5f37bfc9
author nkeynes
date Sun Sep 07 04:23:49 2008 +0000 (11 years ago)
permissions -rw-r--r--
last change Fog work-in-progress
file annotate diff log raw
1.1 --- a/src/pvr2/glrender.c Mon Jul 14 07:44:42 2008 +0000
1.2 +++ b/src/pvr2/glrender.c Sun Sep 07 04:23:49 2008 +0000
1.3 @@ -113,6 +113,7 @@
1.4 glEnableClientState( GL_VERTEX_ARRAY );
1.5 glEnableClientState( GL_TEXTURE_COORD_ARRAY );
1.6 glEnableClientState( GL_SECONDARY_COLOR_ARRAY );
1.7 + glEnableClientState( GL_FOG_COORDINATE_ARRAY_EXT );
1.8
1.9 glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
1.10 glClearDepth(0);
1.11 @@ -181,6 +182,22 @@
1.12 } else {
1.13 glDisable( GL_TEXTURE_2D );
1.14 }
1.15 +
1.16 + switch( POLY2_FOG_MODE(poly2) ) {
1.17 + case PVR2_POLY_FOG_LOOKUP:
1.18 + glFogfv( GL_FOG_COLOR, pvr2_scene.fog_lut_colour );
1.19 + glEnable( GL_FOG );
1.20 + break;
1.21 + case PVR2_POLY_FOG_VERTEX:
1.22 + if( POLY1_SPECULAR(poly1) ) {
1.23 + glFogfv( GL_FOG_COLOR, pvr2_scene.fog_vert_colour );
1.24 + glEnable( GL_FOG );
1.25 + break;
1.26 + } /* else fallthrough */
1.27 + default:
1.28 + glDisable( GL_FOG );
1.29 + }
1.30 +
1.31
1.32 glShadeModel( POLY1_SHADE_MODEL(poly1) );
1.33
1.34 @@ -296,7 +313,11 @@
1.35 glColorPointer(4, GL_FLOAT, sizeof(struct vertex_struct), &pvr2_scene.vertex_array[0].rgba[0]);
1.36 glTexCoordPointer(2, GL_FLOAT, sizeof(struct vertex_struct), &pvr2_scene.vertex_array[0].u);
1.37 glSecondaryColorPointerEXT(3, GL_FLOAT, sizeof(struct vertex_struct), pvr2_scene.vertex_array[0].offset_rgba );
1.38 -
1.39 + glFogCoordPointerEXT(GL_FLOAT, sizeof(struct vertex_struct), &pvr2_scene.vertex_array[0].offset_rgba[3] );
1.40 + glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT);
1.41 + glFogi(GL_FOG_MODE, GL_LINEAR);
1.42 + glFogf(GL_FOG_START, 0.0);
1.43 + glFogf(GL_FOG_END, 1.0);
1.44 /* Turn on the shaders (if available) */
1.45 glsl_enable_shaders(TRUE);
1.46
.