VOGONS


3dfx voodoo chip emulation

Topic actions

Reply 220 of 386, by OSH

User metadata
Rank Member
Rank
Member

Great news kekko, this fullfil my dream!!!

Reply 221 of 386, by bored

User metadata
Rank Newbie
Rank
Newbie

Thanks kekko.

This is awesome news! 😀

...just hope I can set it up.

Reply 222 of 386, by kekko

User metadata
Rank Oldbie
Rank
Oldbie

first screenshot of the opengl accelerated 3dfx emulation 😜

Reply 223 of 386, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Nice. Screwed your weekend? 😉

Reply 224 of 386, by kekko

User metadata
Rank Oldbie
Rank
Oldbie
wd wrote:

Nice. Screwed your weekend? 😉

🤣

Reply 225 of 386, by SBlaster

User metadata
Rank Newbie
Rank
Newbie

Awesome, how well dows it work?

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)

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 😀

Reply 228 of 386, by SBlaster

User metadata
Rank Newbie
Rank
Newbie

Thanks! I recently tested your patch, and the Speed Incrase is HUGE, I finished the first level of Tomb Raider 1 at fullspeed, of course the graphics were all glitchy, but it worked.

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 231 of 386, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

As a one and only warning i'll remove ALL "fps is too low" postings without further note.

Reply 232 of 386, by Quaker766

User metadata
Rank Newbie
Rank
Newbie

Oh whoops my bad 😐. great work guys keep it up.

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"

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 237 of 386, by mudlord

User metadata
Rank Newbie
Rank
Newbie

Ah, so that explains the depth tests then.

I take it with the texture manager/cache, you are also taking care of textures not in use (eg. garbage collection)? I would imagine if textures are constantly allocated, there would be mem leaks....

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