RE: [Algorithms] 2d clipping of 3d geometry
Brought to you by:
vexxed72
From: Tom F. <to...@mu...> - 2003-05-19 18:44:31
|
D3DXMatrixPerspectiveOffCenterLH/RH should do what you want. Tom Forsyth - Muckyfoot bloke and Microsoft MVP. This email is the product of your deranged imagination, and does not in any way imply existence of the author. > -----Original Message----- > From: Jason Zisk [mailto:zi...@n-...] > Sent: 19 May 2003 19:25 > To: gda...@li... > Subject: Re: [Algorithms] 2d clipping of 3d geometry > > > I tried this method, and like others it seems to fall apart > if the viewport > isn't centered on the screen. As soon as the viewport moves it gets > seriously warped. I guess I forgot to mention this was for a portal > renderer in the original email, sorry if that wasn't clear. > :) Since the > portal might be anywhere on the screen, the screen-space > viewport around it > could also be anywhere, including with a funky aspect because > of the shape > of the portal. > > I've been trying to figure this one out for a while, it seems > like it should > be doable to set up the projection so its the same as when > the viewport is > fullscreen and just render what is in the viewport like its a window, > automatically cutting out anything not inside the viewport. > But maybe the > only way to do this is via the scissors stuff in OGL and I'm > trying to do > the impossible? (Using D3D at least). > > > BTW, if you lay out the depth buffer in the first pass, > then all your > > fancy pixel shader stuff in the following passes will only be > > calculated for visible fragmets (assuming you don't alter > depth in the > > shader). > > Yeah this may just be the better solution. It would require > one additional > pass, eating up tons of transform time if the env. is very > poly heavy but if > fillrate is the issue it might end up being a savings. > > - Jason Zisk > - nFusion Interactive LLC |