Closed tehbelinda closed 12 years ago
You basically need to do 6 render (to render targets) and use these as a cubemap for the object you want to be reflective.
Sounds like a fun thing to hack :)
Oh okay, could you offer some tips on how to implement that by any chance? :) I'll see what I can do...
I'm interested as well. If you can give me tips on how to save my renders into a variable perhaps I can figure it out. Cheers
This may give you some pointers: http://www.mandreel.com/demos/sailboat/webgl/index.html
WICKED ! Thank's I'll be figuring this out. Cheers
On second thought. That code is very convoluted. I'll have to push it down my to do list. Thank's for the find though. Cheers
Yeah, the code is the opposite os readable, specially because it's compiled code. But on there you can see the tricks used (rendering the scene from under the plane, etc).
(yea even with http://jsbeautifier.org/ it still looked horrible hehe).
I'm still trying to understand the idea behind it. (Also thank's for clarifying the camera is under the plane (I thought they just rotated everything :s ) .
I think for refraction they're rendering special objects that are only as high as the water (which is really smart, cuz there's less polygons to render)
Very cool stuff. Thank's again.
4d1dd95d62ff48b1842bf4e3fe0c393f5bd6f4d6
I'm trying to create a reflective surface like a mirror that reflects everything else in a scene. I've got it working with an envmap and texturecube for the background of the scene, but not the other objects in the scene. I've been hunting around examples and such, but haven't been able to figure out how to map it.
So basically, is what I'm trying to do possible with three js at the moment...? If it is, any pointers would be much appreciated! Otherwise, I guess I'll give up for now...