unlimited planar reflections & refraction (update)

(Rusoski) #281


I know I say this often but… You are the man… Thank you so much for sharing this awesome awesomeness! :smiley:

(spellcaster) #282

This technique applied to a non planar surface not works well, i think the vertex position changes the way of reflection, i could upload image if someone interested to solve this

(Wisaam) #283

Hi…can anyone explain to me (in simple terms of course :D) how did he “animate” the normal maps using just static textures…did he somehow displace the UVs or is it something else?

(Jsewill) #284

He sets up at least one other camera and renders the scene per camera, per frame. Then, he has the results of the extra cameras (which are positioned and rotated to meet the needs of the scene) saved to a couple textures on the material that has reflection/refraction.

(Wisaam) #285

Thanks but I was not asking about how the reflections/refractions are made but about the animated normal maps that distort the reflections, how are they animated?

(Jsewill) #286

As far as I can tell, he uses a GLSL shader uniform and passes a value in from a BGE property of timer type. Using this timer value, the shader then dynamically sets the normals in the fragment shader, using the normal map image as a base. Have a look at the text block, “watershader_high” in the blend file.

(jason7bourne) #287

i use the shaders in different scenes and i’ve just changed the name of the render camera in the scripts of the different scenes and it works but when i try to move through scenes in the game mode, reflections don’t work … any suggest to resolve the problem?

(Akira_San) #288

Yep, “unlimited planar reflections & refraction” have been implemented in the next version of UPBGE(015). :smiley:

(musikai) #289

In this project here I use 2 different instances of waterplanes.

To get the reflections to work independently I had to create a copy of Watertexture.py and change all “g.refraction” to “g.refraction2” and all “g.reflection” to “g.reflection2”.
I really had no real clue what I was doing, but it worked in the end. Perhaps your problem is similar.

(bobsss) #290

the link does not work (((
water surface demo (v1.1)
please correct this problem!


hi. anyone have a updated link of the water blend file??? (the last link that martin posted expired)