Ian wrote:The actual stencil bit I found is only used *i think* by the shadows in sega rally. I don't know what other games are doing, or how the h/w is processing them.
There is a stipple alpha bit in header 6, but we aren't sure if it's used
Some of the biggest issues that remain are transparency related. If you try lemans24, it looks quite broken in places. For some reason the depth test is always enabled in the model3, so translucent polys always depth test against each other. It leads to some interesting problems on the original h/w itself.
Ok let's anticipate the transparency discussion
I'm quite sure that translucent poly are always single sided, I've forced that condition and it seems to solve the remaining issue on meshes that have both single and double sided polys (again those colored balloons...).
I've got instead a theory about the polygon orientation: I think that the Real3D keeps dynamically their face normals toward the camera, this resolves some issues in oceanhunter (the transparent helmets in attract mode), the atmosphere halo around Endor in some open space scene in SWT, etc. Maybe that could be how "shadow-polys" are rendered without flicker, instead of implementing a co-planar check every time.
I'll post some screenshots later. But sadly I've not the skills to mess with vertex/face normals in your 3D engine. You can surely find the way faster. It could be worth a try.
About the depth test: yes, I've seen that odd effect and honestly I'd keep that (again the accuracy thing...
I'm also sure that transparent-not-textured poly are rendered in another, separate, pass in the render pipeline. Last year I've made a proof-of-concept patch on the old engine and it fixed, for example, the priority (visibility) between the snow and the shadows in Sega Rally 2, maybe there're other cases.