Search
lxdream.org :: lxdream :: r1257:e1314ad3e7cc
lxdream 0.9.1
released Jun 29
Download Now
changeset1257:e1314ad3e7cc
parent1256:a9d29fe74bf3
child1258:f8a9c0fd2abb
authornkeynes
dateSun Mar 04 21:28:48 2012 +1000 (8 years ago)
Fix have_shaders in glrender.c
Set negative fog for lut when using shaders
src/pvr2/glrender.c
src/pvr2/scene.c
1.1 --- a/src/pvr2/glrender.c Sun Mar 04 21:10:12 2012 +1000
1.2 +++ b/src/pvr2/glrender.c Sun Mar 04 21:28:48 2012 +1000
1.3 @@ -115,6 +115,7 @@
1.4 */
1.5 void pvr2_setup_gl_context()
1.6 {
1.7 + have_shaders = display_driver->capabilities.has_sl;
1.8 #ifdef APPLE_BUILD
1.9 CGL_MACRO_CONTEXT = CGLGetCurrentContext();
1.10 #endif
2.1 --- a/src/pvr2/scene.c Sun Mar 04 21:10:12 2012 +1000
2.2 +++ b/src/pvr2/scene.c Sun Mar 04 21:28:48 2012 +1000
2.3 @@ -385,8 +385,11 @@
2.4 uint32_t index = pvr2_scene.poly_array[i].vertex_index;
2.5 if( mode == PVR2_POLY_FOG_LOOKUP ) {
2.6 for( j=0; j<pvr2_scene.poly_array[i].vertex_count; j++ ) {
2.7 - pvr2_scene.vertex_array[index+j].offset_rgba[3] =
2.8 - scene_compute_lut_fog_vertex( pvr2_scene.vertex_array[index+j].z, fog_density, fog_table );
2.9 + float fog = scene_compute_lut_fog_vertex( pvr2_scene.vertex_array[index+j].z, fog_density, fog_table );
2.10 + if( display_driver->capabilities.has_sl )
2.11 + pvr2_scene.vertex_array[index+j].offset_rgba[3] = -fog;
2.12 + else
2.13 + pvr2_scene.vertex_array[index+j].offset_rgba[3] = fog;
2.14 }
2.15 } else if( mode == PVR2_POLY_FOG_LOOKUP2 ) {
2.16 for( j=0; j<pvr2_scene.poly_array[i].vertex_count; j++ ) {
.