Skip to main content
GameDev.net gamedev.net
🔒 Locked

mirror

Started by gamerking Sep 22, 2005 at 3:21 AM 3 replies 650+ views
Original Post
gamerking
gamerking
Hi, i was wondering how i could get lighting effects and bounce them of objects AKA. reflective water (see your own reflection) light bouncing of mirrors thanks
Matt : mattb0001@hotmail.comClick me please
timw
timw
a technique called projective textureing is commenly used for this task. also, a VERY expensive hack is to draw all geometry twice. suppose I got a world, and the ground level is the y = 0 plane, suppse you also have a lake on the ground level, simply draw the lake as a open shape(no cover like a hole in the ground) and draw all the geometry again but with the y values negated ie scale the y direction by -1. this is just a stupid fun thing to do. if you're doing a serious project you should use projective texturing, as that is much faster and can easily be modified to fake the wavey like textures in the water, like in half life 2.

check out this link
http://www.gamedev.net/reference/articles/article2138.asp

Tim
matches81
matches81
@Timw:
I don´t know exactly, but I would say you don´t get around that "hack" even with projective texturing? I mean, projective texturing is nice, but you need some texture to project, and that texture is normally generated in kind of reflection "pre-pass", where you do the same thing you described as "hack", namely rendering the whole scene mirrored at the plane, but saving the result to the texture you later on project onto the water plane. Am I mistaken?
timw
timw
I thought of that right after I did the post lol. ya they're both similiar I guess. the other approach is done in one pass, but I dont know which would be faster. the projective textureing is still much more flexible with regards to the special effects you can do wtih it, also, you could calculate frenel stuff, anyone know which is faster for pure mirror reflecitons?
superpig
superpig
For a pure planar mirror, I would have expected a stencil-based technique to be the most efficient. No point rendering it all into a texture if you're only going to render that texture out as a quad.
Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.