VOGONS

Common searches


Search results

Display options

Re: 3dfx voodoo chip emulation

Just realized I accidentally used glColor3f instead of glColor4f. Forgot that you'd already calculated the alpha as well so you might as well use them. You mentioned you had already made that change so you may have done it that already, but I wanted to correct my mistake anyway. Should be glColor4f( …

Re: 3dfx voodoo chip emulation

Even better than using a 24-bit depth buffer, you can try using floating point depth buffer using the official GL_ARB_depth_buffer_float extension. Not sure how that would work since you're using SDL to do most of the graphics initialization. http://www.opengl.org/registry/specs/ARB/depth_buffer_ …

Re: 3dfx voodoo chip emulation

Well, the texture perspective issue ended up being a pretty easy fix. It's basically what I mentioned before except using W instead of Z. glTexCoord4f(s0 * w0, t0 * w0, 0.0f, w0); glVertex3f((float)v->fbi.ax/16, (float)v->fbi.ay/16, z0); glTexCoord4f(s1 * w1, t1 * w1, 0.0f, w1); glVertex3f((float …

Re: 3dfx voodoo chip emulation

Thanks. That code is a lot more complicated that I was expecting. I'm trying to trace the various Z/W calculations. It looks like there's is some clamping going on that might be counter-productive for texture coordinates. I'll have to play around. One issue, I'm getting a build error saying "Unable …

Re: 3dfx voodoo chip emulation

The distortion caused by changing the Z values is known and expected. In normal 3D rendering 4th parameter for all of the vertexes (W) get calculated as a natural part of the transformation math and is always set correctly for the depth so things just kind of work out. The PowerVR handles that …

Re: 3dfx voodoo chip emulation

Hi touchmonkey, i'm thinking again about inverse projection method; I guess I understood why you said it would work just in theory. Some games use strange tricks or don't even use z buffer (just triangle z-sorting i guess). Moreover, you can't correctly convert clipped polys on the edges of viewing …

Re: 3dfx voodoo chip emulation

I just can't remember how I did it :) I needed to go to a shader so I could correctly model some blending modes that aren't available in OpenGL. That's no problem: all PCX1-2 can do is alpha blend. I can't see why that or even Glide would need DX10 to roll properly. I second the OpenGL motion I …

Re: 3dfx voodoo chip emulation

Looking at my old code I'm pretty sure Attempt 1 is the correct method. I found the following macro still in use: #define handle_texture_coordinates(u, v, z) \ glTexCoord2f(u, v); Originally all of my texture coordinates used the Z (depth). When I converted everything to shaders I was too lazy to …

Re: 3dfx voodoo chip emulation

@TouchMonkey So, you're saying that perspective correction can't work, because triangles are actually in 2d space, right? and the solution you implemented is to fix texturing pixel by pixel with a simple shader? That's pretty much correct. You have a vertex with an X/Y value that specify a specific …

Re: 3dfx voodoo chip emulation

About the perspective correction issue, I've read somewhere that I need to use glFrustum or gluPerspective, instead of glOrtho, in order to fix textures. Does anyone have a clue? Thanks :) You definitely don't want to use glFrustrum or gluPerspective, glOrtho is the way to go you just need to …

Page 1 of 1