MH's Direct3D 8.1 Wrapper

Discuss programming topics for the various GPL'd game engine sources.
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Re: MH's Direct3D 8.1 Wrapper

Post by r00k »

okay sorry to dig up an old thread but in the off time during the holidays i decided to give this a try again........

here's what it looks like
Image

and here's my link to gl_rsurf.c

i cant figure out the problem unless it's something to do with GL_RGB...

i'm using this version
NEW FAKE GL WRAPPER - MH 2009
is it not the most current?
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: MH's Direct3D 8.1 Wrapper

Post by Spike »

firstly, it looks like your lightmap format isn't supported, you might need to extend it to support rgb or whatever format you're using.
secondly, it looks like your lightmap blend mode isn't supported either. try enabling/disabling multitexture support? even with real opengl drivers? looks like someone left alpha-test active instead of using alpha-blend or something. it could even be the wrapper not recognising overbright blend modes.
the wrapper was written to support quake rather than to be a generic wrapper. as soon as you use some stuff outside of its featureset, it'll make assumptions that will explode.
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Re: MH's Direct3D 8.1 Wrapper

Post by r00k »

Thanks!


byte lightmaps[4*MAX_LIGHTMAPS*LIGHTMAP_BLOCK_WIDTH*LIGHTMAP_BLOCK_HEIGHT];
that 4 was *3 in the dx version and uses a global LIGHT_SCALE for 3 thru the code in gl_rsurf.
changing it back to 4 only gave me flat grey textures. gl_overbright inversed the colors, and
changing this part in yellow made everything work like norm again. I had to revert the GBRA uploads back to RGBA also..
void R_BlendLightmaps (void)
{
int i, j;
glpoly_t *p;
float *v;

glDepthMask (GL_FALSE); // don't bother writing Z

glEnable (GL_BLEND);//<---- hmm this was missing?! yet no bug in the gl build

// if (gl_overbright.value)// D3D doesnt like this, reverses the colors
// glBlendFunc(GL_DST_COLOR, GL_SRC_COLOR);
// else
glBlendFunc (GL_ZERO, GL_ONE_MINUS_SRC_COLOR);

glEnable(GL_ALPHA_TEST);
glAlphaFunc ( GL_GREATER, 0.5 );
Phew! now i have to diff this build with a stable to trim all the unnecessary changes.

Someone requested a dx build to use with nVidia's ShadowPlay.
Post Reply