Re: [Algorithms] I hate mirrors...
Brought to you by:
vexxed72
From: Wesley H. <hu...@cs...> - 2002-09-20 18:55:27
|
----- Original Message ----- From: "Mat Noguchi" <mat...@mi...> To: "Tom Forsyth" <to...@mu...>; <gda...@li...> Sent: Friday, September 20, 2002 1:25 PM Subject: RE: [Algorithms] I hate mirrors... > With proper culling, the bits farther away shouldn't draw. > I don't think this works. like mentioned earlier, you really need an interval ztest for this to work, where one is the plane of the mirror, and the other is the current zvalue. > Of course, it's infinitely easier to just adjust the near clip plane to > lie along the mirror (along with the far clip to be parallel to that). > I've played around with this method, but I couldn't get it to work right when your view direction faces away from the plane of the mirror. If you think about what this techniue does, you can't skew the near plane enough if your view direction is not facing towards the mirror by some amount. Has anyone found a solution for this? -Wes -----Original Message----- From: Tom Forsyth [mailto:to...@mu...] Sent: Friday, September 20, 2002 4:25 AM To: gda...@li... Subject: RE: [Algorithms] I hate mirrors... You render the plane of the mirror, and then switch your Z-test to do theopposite of what it normally does. Then render the object, and only pixels further away than the mirror will be rendered. But of course now for a single object, bits further away will obscure closer bits. The suggested solution reverses the Z value by inverting the proijection matrix, but to be honest I don't understand how this can work, because if you do that then the mirror stops doing the right clipping. So I'm not sure exactly how this works. The fundamental problem is that for a particular pixel, you want it to be rendered if it's further away than a certain value (the mirror) _and_ closer than another value (further-away bits of the object). I don't really understand how any munging of the projection matrix allows you to test against two values at once, whene there's only one stored in the Z-buffer. Tom Forsyth - purely hypothetical Muckyfoot bloke. This email is the product of your deranged imagination, and does not in any way imply existence of the author. |