Archived

This topic is now archived and is closed to further replies.

Igilima

Reflections, mirrors and non-flat surfaces.

Recommended Posts

I was thinking about adding reflections to something I am doing. Right now, the surface that would be reflective is just a flat ''floor''. So I was looking at the sdk samples and saw one method used in slightly different ways for both the mirror sample and the sprites sample. Basically it involves setting up a bunch of clipping planes to bound the ''mirror'' and rendering the scene twice with two different viewpoints if I understand it correctly. The trouble I have with this is that I don''t understand how you could then tie your reflection to a surface such as a tabletop or a shiny marble floor. The only way I see it being tied to that surface is the coincidence of the planar coordinates for your clip planes and the rendered quad(s) that make up the object''s surface. In the mirror sample, this is no problem since the mirror itself is not an object but is defined by the clipping planes. When it comes to an actual surface represented by one or more quads, however, I can see problems arising if your mirror clipping planes don''t follow the quads around. I suppose you could somehow tie the clipping planes'' vectors to the flat objects'' vectors (make both source off the same variables). Hmmm. Another way I know this can be done is to render the scene to a texture and then texture the flat object with the newly rendered scene texture. Is this a ''better'' or faster way? Probably not in most cases? This would also allow wrapping on non-flat objects because the texture is tied to the surface. But it would make for an improperly warped ''mirror'' effect. I suppose you could do a volume or projection effect to get the correct reflection result? Can you also do this with clipping planes to get the properly warped reflection on a non-flat surface? A friend is messing around with DX in Java and said that he can just make his materials reflective and get reflections? I''m pretty sure Java abstracts everything just a bit more than the C++ DX API but really, does it give him that much more power in that he can make his surface reflective without having to create the ''mirror'' code himself? Wow?! Comments? Clarification?

Share this post


Link to post
Share on other sites
quote:
Original post by Igilima
I was thinking about adding reflections to something I am doing. Right now, the surface that would be reflective is just a flat ''floor''.


Check out: Ofek, E., Rappoport, A., Interactive reflections on curved objects. Proceedings of Siggraph 98. In Computer Graphics Proceedings, Annual Conference Series, 1998, ACM SIGGRAPH, pp. 333-342 for some ideas.

-cb


Share this post


Link to post
Share on other sites