jeromeetienne / tquery

extension system for three.js
http://jeromeetienne.github.io/tquery/
MIT License
651 stars 120 forks source link

water from rasperry pi #216

Open jeromeetienne opened 12 years ago

jeromeetienne commented 12 years ago
jetienne: http://penguinspuzzle.appspot.com/penguins.html?lev=10 how to do such water effect
[5:16pm] __doc__: jetienne: you render the scene two times
[5:16pm] __doc__: jetienne: onetime mirrored along eht Y axis
[5:16pm] __doc__: jetienne: the mirrored rende is only done where water is, so you need to do a water stencil
[5:17pm] __doc__: jetienne: or have some other rule to exclude anything above the water
[5:17pm] __doc__: jetienne: then when you render the main scene you first slap the solid scene on top
[5:18pm] __doc__: jetienne: then you render the water computing a refraction vector, and you lookup into your mirrored texture to fetch the distorted texel