VOGONS


3dfx voodoo chip emulation

Topic actions

  • This topic is locked. You cannot reply or edit posts.

Reply 226 of 386, by kekko

User metadata
Rank Oldbie
Rank
Oldbie

well, I just added a simple and not much optimized texture caching algorithm, and it's already going insanely fast 😀
there are still hundreds of bugs and many missing features
- proper opengl video mode switch
- simple non textured polys
- triangles z-sort(or zbuffer)/perspective correction/alpha/filtering/lighting
here's also the latest experimental patch (apply after patch voodoo_20101127.diff at page 10)

Attachments

  • s2.PNG
    Filename
    s2.PNG
    File size
    158.2 KiB
    Views
    4936 views
    File license
    Fair use/fair dealing exception
  • Filename
    voodoo_ogl_exp6.diff
    File size
    17.13 KiB
    Downloads
    235 downloads
    File comment
    apply after patch voodoo_20101127.diff
    File license
    Fair use/fair dealing exception

Reply 227 of 386, by kekko

User metadata
Rank Oldbie
Rank
Oldbie

I partially fixed texture alpha; need a hand from opengl experts with perspective correction/depth testing, I'm not sure on how to make it work. Any suggestion will be appreciated 😀

Attachments

  • Filename
    voodoo_ogl_exp7.diff
    File size
    19.41 KiB
    Downloads
    433 downloads
    File license
    Fair use/fair dealing exception

Reply 229 of 386, by Quaker766

User metadata
Rank Newbie
Rank
Newbie

Hey all. I recently downloaded ykhwongs dosbox build with your voodoo emulation. I couldnt believe when i saw that spinning logo when GLquake launched. The only problem with his build is that the FPS is abysmal. Like playing Aces over europe 🤣. Anyhows, kekko (and the others working on this project) u have made my christmas and new year. I havent played some of the games i have tonight in 7 years. Even if the Framerates crap.
-Quaker (merry Christmas)

Reply 233 of 386, by mudlord

User metadata
Rank Newbie
Rank
Newbie

need a hand from opengl experts with perspective correction/depth testing

How are you doing your projection handling? If you are using glOrtho, I don't see your issue at all, since there is nothing to correct 😒

Are you sure all your coordinates for the textured quads are right?

Reply 234 of 386, by kekko

User metadata
Rank Oldbie
Rank
Oldbie

I'm using glOrtho, and also

	glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);

then when drawing triangles, I use glVertex3f(x,y,z), which is (mostly) working for depth testing, but not for perspective corrected textures.

I'm attaching the latest experimental code, with some preliminary depth testing and more stable videomode switch (thanks hal 😀 )
I moved all opengl code in the new include "voodoo_opengl.h"

Attachments

  • Filename
    dosbox_ogl_exp9.zip
    File size
    1.44 MiB
    Downloads
    459 downloads
    File license
    Fair use/fair dealing exception

Reply 235 of 386, by mudlord

User metadata
Rank Newbie
Rank
Newbie

I have to wonder why:

if (FBZMODE_Y_ORIGIN(v->reg[fbzMode].u))
glOrtho( 0, v->fbi.width, 0, v->fbi.height, 0.0f, -1.0f );
else
glOrtho( 0, v->fbi.width, v->fbi.height, 0, 0.0f, -1.0f );

Wouldn't it make sense if you use something like:
glOrtho(0, outwidth, 0, outheight, -1.0, 1.0);

instead rather than from 0.0f for nearZ?

How exactly does this renderer work? Is there just one singular texture or many being used?

Reply 236 of 386, by kekko

User metadata
Rank Oldbie
Rank
Oldbie

I took the values for z planes from openglide. changing these values seem to make things worse 😖
there are many textures, uploaded in the emulated texture ram; when the renderer calls a triangle for the first time, I upload its texture to the actual video card and then I link the emulated texture start address to a textureID, through a std::map container.

Reply 238 of 386, by kekko

User metadata
Rank Oldbie
Rank
Oldbie

that's handled by function ogl_texture_clear

void ogl_texture_clear(Bit32u texbase) {
std::map<const Bit32u, GLuint>::iterator t;
t=textures.find(texbase);
if (t != textures.end()) {
glDeleteTextures(1,&t->second);
textures.erase(t);
}
}

I hope it's working right (how do I check if video memory has been freed?)

Reply 239 of 386, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

One thing to keep in mind is that all (hopefully?) coordinates should already be pre-transformed. Voodoo did not have onboard transform&lightning (the first chip to have that was IIRC nVidia Geforce). Therefore, OGL should be set up in way to allow passing coordinates directly and not transforming them in any way.
Do you have a sample of where textures do not work correctly (a glide sdk test perhaps?).

ps. I guess video memory is not actually freed...you should check if any of the new textures overwrites an old texture mem address and release it then...

http://www.si-gamer.net/gulikoza