Page 1 of 2

Water Reflection

PostPosted: Saturday, 28.September 2013, 22:30
by ikam
Hi

Here is how to make a reflective plane.

In the last version, I updated the camera operator to allow mirrored view.
With that you render a scene to a texture (RenderTarget operator) and use this texture as input in customMaterial.
Included shader in example file will do the rest.
(It is based on the next code : https://github.com/elvman/RealisticWaterSceneNode)

Re: Water Reflection

PostPosted: Saturday, 28.September 2013, 22:43
by Skinnytorus
Man... Congrats! A really big step forward! =D> =D> =D>
Will you leave it as a cusom material or make a shader/modFX operator?

Re: Water Reflection

PostPosted: Saturday, 28.September 2013, 22:47
by ikam
I really do nothing, just positioning a camera...
all is done by the shader written by elven.

I surely make an operator for that.

Re: Water Reflection

PostPosted: Saturday, 28.September 2013, 22:54
by Skinnytorus
Respect - you both. And thanks in advance for the operator. This is a really long awaited feature. Really well done!
I will have a closer look tomorrow.

Re: Water Reflection

PostPosted: Sunday, 29.September 2013, 13:25
by Skinnytorus
Added cam animation + sprites. I'm surprised! It reflects sprites! Very cool. A monster of an update! =D> =D> =D>

Re: Water Reflection

PostPosted: Sunday, 29.September 2013, 13:59
by Skinnytorus
Unfortunately, it doesn't work with BlowNoise as it should. Reflections are not distorted by the waves...

Re: Water Reflection

PostPosted: Sunday, 29.September 2013, 14:18
by nikitos75
So I' m don't understand how to make reflections on simple torus..((((((

Re: Water Reflection

PostPosted: Sunday, 29.September 2013, 15:34
by nikitos75
Ikam, is needed to add mirrorXYZ function in camera mode or something same(((

Re: Water Reflection

PostPosted: Sunday, 29.September 2013, 17:05
by ikam
This technique is only used to do planar reflection.

Re: Water Reflection

PostPosted: Sunday, 29.September 2013, 19:31
by Skinnytorus
That's OK. At least a realtime reflection is now possible. Is the Mirror-X cam mode created especially for this setup? I still can't make it work correctly with other material types...

Re: Water Reflection

PostPosted: Sunday, 29.September 2013, 19:52
by Skinnytorus
Maybe, support for Blownoise is not that important... In fact, all the essential params for water are there :)

Re: Water Reflection

PostPosted: Sunday, 29.September 2013, 19:56
by Skinnytorus
I don't see any difference between UpdateLastView on/off. Any clue?

Re: Water Reflection

PostPosted: Monday, 30.September 2013, 05:53
by ikam
mirrorx mode is especially set to be used with rendertarget to transform in real time the camera view around x axis (imagine a camera rotation along x axis). There is no real interest to be used in a live camera because it only translate y pos and target pos of the camera (you can do the same with a live camera). you can use this mode with modmat et simple mat like others rendertarget, your view will be transposed (see example). Maybe "Mirrorx" name is not really a good choice, because it does not mirror anything, just prepare view to be mirrored.

The UpdateLastView allow to update a camera information (matrix transformation) that can be retrieved later by others cameras. (for now only mirrorx mode use it and free camera mode when you press 'o' key), but it can be usefull for others mode later :) . In case f waterreflaction, it allow to update the camera in mode mirrorX with the same position than last last camera and it apply after its -y transposition. (try in example to desactivate it when rendering scene from last camera, howver take care to not click in the 3d view, because it also update this information, if you doesn't activate it in waterreflection example, reflection will not be correct because the camera position in MirrorX will not be updated correctly).

So mirrorx is more especially used to do reflection along a plane in conjunction with a shader that can manage it. like the initial example of water reflection shader.

To do other type of reflections (reflection arround a mesh) we can use env mapping with envi-reflect/sphere in tex2d uv mode, even if it is faked it can be it can be good enough used with render target or skyenv. Else, to be able to do a real time reflection around non planer mesh it need a raytracing technique, it is another story :)

Re: Water Reflection

PostPosted: Monday, 30.September 2013, 07:12
by nikitos75
Thank you, Ikam, for your answer! May be real raytracing will be the next step of wz growing?

Re: Water Reflection

PostPosted: Monday, 30.September 2013, 08:56
by Skinnytorus
Thanks for the info. Will play with that this evening. :)