Water Reflection

Water Reflection

Postby ikam » Saturday, 28.September 2013, 22:30

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)
You do not have the required permissions to view the files attached to this post.
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: Water Reflection

Postby Skinnytorus » Saturday, 28.September 2013, 22:43

Man... Congrats! A really big step forward! =D> =D> =D>
Will you leave it as a cusom material or make a shader/modFX operator?
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: Water Reflection

Postby ikam » Saturday, 28.September 2013, 22:47

I really do nothing, just positioning a camera...
all is done by the shader written by elven.

I surely make an operator for that.
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: Water Reflection

Postby Skinnytorus » Saturday, 28.September 2013, 22:54

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.
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: Water Reflection

Postby Skinnytorus » Sunday, 29.September 2013, 13:25

Added cam animation + sprites. I'm surprised! It reflects sprites! Very cool. A monster of an update! =D> =D> =D>
You do not have the required permissions to view the files attached to this post.
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: Water Reflection

Postby Skinnytorus » Sunday, 29.September 2013, 13:59

Unfortunately, it doesn't work with BlowNoise as it should. Reflections are not distorted by the waves...
You do not have the required permissions to view the files attached to this post.
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: Water Reflection

Postby nikitos75 » Sunday, 29.September 2013, 14:18

So I' m don't understand how to make reflections on simple torus..((((((
nikitos75
Partikelmeister
Partikelmeister
 
Posts: 85
Joined: Monday, 04.April 2011, 19:27

Re: Water Reflection

Postby nikitos75 » Sunday, 29.September 2013, 15:34

Ikam, is needed to add mirrorXYZ function in camera mode or something same(((
nikitos75
Partikelmeister
Partikelmeister
 
Posts: 85
Joined: Monday, 04.April 2011, 19:27

Re: Water Reflection

Postby ikam » Sunday, 29.September 2013, 17:05

This technique is only used to do planar reflection.
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: Water Reflection

Postby Skinnytorus » Sunday, 29.September 2013, 19:31

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...
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: Water Reflection

Postby Skinnytorus » Sunday, 29.September 2013, 19:52

Maybe, support for Blownoise is not that important... In fact, all the essential params for water are there :)
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: Water Reflection

Postby Skinnytorus » Sunday, 29.September 2013, 19:56

I don't see any difference between UpdateLastView on/off. Any clue?
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: Water Reflection

Postby ikam » Monday, 30.September 2013, 05:53

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 :)
You do not have the required permissions to view the files attached to this post.
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: Water Reflection

Postby nikitos75 » Monday, 30.September 2013, 07:12

Thank you, Ikam, for your answer! May be real raytracing will be the next step of wz growing?
nikitos75
Partikelmeister
Partikelmeister
 
Posts: 85
Joined: Monday, 04.April 2011, 19:27

Re: Water Reflection

Postby Skinnytorus » Monday, 30.September 2013, 08:56

Thanks for the info. Will play with that this evening. :)
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46


Return to Snippets



Who is online

Users browsing this forum: No registered users and 1 guest

cron