libsdl-org / sdl12-compat

An SDL-1.2 compatibility layer that uses SDL 2.0 behind the scenes.
Other
194 stars 40 forks source link

Quake IV lacks stencil shadow volumes #126

Closed eukara closed 2 years ago

eukara commented 3 years ago

Running Quake4 V1.4.2 linux-x86 Jun 15 2007 and sdl12-compat from git (87c7e29) compiled for 32-bit.

shot00001 shot00002

Not a whole lot to say here, other than Quake IV completely lacking shadows. First shot is real SDL 1.2, second is sdl12-compat. Also sorry for the upside down images, I forgot the games TGA screenshots wouldn't automatically get flipped by mogrify.

shot00003

r_showShadows reveals that the stencil shadow volumes are being calculated and cut properly (compared that too with old 1.2 and they look identical)

shot00004

Interestingly enough, toggling r_useShadowVertexProgram to be set to 0 will make something show. It's not right (old SDL 1.2 renders this properly) but at least it shows that it's doing something.

I recently went over and set-up all my games to use sdl12-compat and noticed this right away when booting up Quake IV. I suspected Prey (1.4.119 linux-x86 Nov 26 2008) to be potentially affected by this as well, but that does not seem to be the case. It looks just fine.

icculus commented 2 years ago

I believe we have fixed this, probably with either OpenGL scaling getting correct render buffers formats or with SDL_GL_GetAttribute no longer returning 0 for various sizes.

So I guess either Quake 4 needed an alpha channel on the window framebuffer, or it incorrectly believed there was no stencil buffer. Either way, it appears to work now.

shot00001