From: Brian P. <br...@va...> - 2001-06-06 15:28:44
|
Taura M wrote: > > On Tue, 05 Jun 2001 15:35:45 -0600, Brian Paul said: > > > Doing a clean implementation (as an OpenGL extension) would be some > > work but you could hack it into Mesa's software rendering code if you > > just wanted to experiment. > > > > Looking at the 3.4 code, in tritemp.h, search for "ctx->PolygonZoffset". > > It's added to the vertex Z positions during triangle setup. > > > > Now look at the depth.c file, where the Z test is performed. You > > could add or subtract ctx->PolygonZoffset to the value which is > > stored into the Z buffer when the Z test passes. I think that > > would effectively do what you want. > > > > There's a few other places where you'd have to add/subtract > > ctx->PolygonZoffset, like the specialized triangle functions in > > X/xmesa4.c > > Thanks for the notes, I'll keep them around if having to modify and get > a special Mesa3D just for this situation comes up. The down side is that > this modified Mesa3D will have to be compiled as part of the application > source and I don't know if that's a smart way to do that. > > Isn't there a way to add a few options to glPolgyonOffset? Ie > GL_OFFSET_DEPTH_PRE > or something like that. Basically I just want an option that'll write > the non-offsetted depth value instead of the offsetted depth value. You'd probably need a new glEnable/Disable() token. You can't add new parameters to existing GL functions. -Brian |