unlimited planar reflections & refraction (update)

Thank you guys for replies.

laser blaster - it seems like other people are having clipping plane problems as well. I have no idea how to fix that though… I will rewrite the fresnel term to something more simple.

Yoda Almighty: It looks like the clipping plane is not applying. If I disable it on my computer it looks exactly the same. It is an OpenGL error or something.

thanks Vitor! :slight_smile:

BlendingBGE - I will make a water surface demo with controllable color and specularity through Blender material tab. Wind speed, bumpy-ness etc. will be adjustable through shader though…

hmm not sure if it helps, but when I quite the scene, i get this error in the console:


Blender Game Engine Finished
Saved session recovery to /var/folders/5p/x417rxv16vd_8zqgcj8d4_bm0000gn/T/quit.blend
Error: Not freed memory blocks: 11
IDProperty len: 96 0x10ccd31d8
IDProperty prop array len: 96 0x10ccefd68
id property string 3 len: 8 0x10ccd3278
id property string 3 len: 8 0x10ccc27d8
id property string 3 len: 16 0x10ccf0108
id property string 3 len: 4 0x10ccf0158
id property string 3 len: 92 0x10ccf01a8
idproperty array resized len: 768 0x10ccf0248
idproperty array resized len: 384 0x10cceff48
GPUNodeLink len: 96 0x10633f8f8
GPUNodeLink len: 96 0x1063ee4f8

Blender quit
logout

martinsh, your work in the BE is a breath of freshness!


martinsh, votre travail dans le BE est une bouffée de fraicheur!

Wow! nice work Martinsh! :smiley:

water surface demo:
http://dl.dropbox.com/u/11542084/water_surface_1.0.blend
(not yet debugged)

features:
• reflection & refraction
• normal map displacement (no real geometry displacement yet)
• water sunlight scattering
• chromatic aberration of refraction
• accurate fresnel term
• multi-frequency waves
• wave choppyness simulation
• bunch of tweakables to control all of this stuff

screenshots:
http://dl.dropbox.com/u/11542084/water_01.jpg

http://dl.dropbox.com/u/11542084/water_02.jpg

http://dl.dropbox.com/u/11542084/water_03.jpg

http://dl.dropbox.com/u/11542084/water_green.jpg

1 Like

hi this is amazing! but is there a way how can i combine the stained glass with the floor reflection? keep this up! you are GLSL king!

1 Like

So, this is by far the most beautidul Water Shader that I have seen running on my PC by now. : D
(Yeah, I simply don’t play most of the modern Games. :wink: )
Ô, and it runs fast and smooth! :ᴰ (Weirdly it runs even faster when I display it big, and runs slower when I keep the Viewport small – but hey, that is great too!^^)

And for me that Shader Code looks pretty complicated, but dissecting it to understand some more of it might be very helpful.

Ô, and by the Way: I virtually* bow before you, martinsh, as I honestly had thought Blender’s current Shader Capabilities would not allow such… well, Beauties!


(* like, over the Internet, so just imagine it. ;p )

1 Like

chäeMil, thank you. yeah it should be possible, but quite messy with current setup, I have to try it first.

C.A.ligári, cheers man :). I am really glad you like it. The code is not really clean and could be optimized, but actually it is quite simple. The most complex part is the tangent space conversion and normal texture blending.

1 Like

martinsh, you are truly a genius!!! this is simply amazing!
thank you for this great resources!!!

The blender foundation should start a new gameproject and hire you for that time!!!

**downloading the last demo atm

EDIT
woa… the light scattering through the water gives it a lot of realism… maybe the waves are a bit to fast for my taste…

Really nice screens!The water looks better than crysis water!

@ ndee: Change the float speed, one of the first float Values in the List of Tweakables.
You can change a Lot there, you also can make it a true calm Water.

ah… ok thanks C.A.ligári

:)Very nice! The light scattering looks amazing. I’m still having problems with the fresnel, so I replaced it with a simple approximation that still looks decent. Other than that(and the clip plane issue), it works great.

What’s up with the wave strength variables having two components? I would assume that they control the scale on the x and y axes independently, but that doesn’t seem to be the case.

Very nice work, looks beautiful on my screen.

However, I found an issue that would need to be fixed before it can be used in games.

Select an object and give it a simple logic setup to restart the scene under a certain condition like if a key if pressed. When the scene restarts, the shader will stop working and Blender will crash.

Beautiful, 9fps, full screen, 1360 x 768. That’s not bad, considering I have an older Nvidia card.

The more serious work like this that gets done with Blender, the less people will consider it a toy. For instance, Turbosquid won’t certify Blender models for their Checkmate program. Thanks.

ndee, thanks :), the “Use Frame Rate” button was unchecked, perhaps thats why the water speed seems too fast.

BlendingBGE - well Crysis has a real geometry displacement. But I have an idea how to make it.

Thank you laser blaster, yeah I have not touched fresnel yet, but I just cannot figure out the clipping plane thing…
about waves - there are 6 layers total for normalmap - 2 for big waves, 2 for medium and 2 for small frequency waves.
The wave strength values change proportional strength of each normal-map layer. Values are normalized in the end (0.0 to 1.0).

Edit: I updated the file.
Added water color and scattering color variables, replaced the fresnel term.

I made another water surface shader, this one with texture displacement using iterative parallax mapping (relief mapping). But it is significantly slower due displacement calculation for 3 normal-map layers.

http://dl.dropbox.com/u/11542084/water_displacement.jpg
blend:
http://dl.dropbox.com/u/11542084/water_surface_1.2.blend

Everything looks perfect at 60fps for me with my ATI
With some mesh displacement this would be comparable to Crysis’ shader.

Hey hey bro this shaders lookin real nice!!! it almost reminds me of that shader u made with the SSS, is any of that shader used in this one, n if not do u think it would improve the performance?

Didn’t think it’d work on my computer - it did. 60 FPS, too!

I get some weird artifacts with the submerged objects, but the reflections on the surface are perfect.


Running on an NVIDIA Geforce 7800 GTX, Windows XP 32-bit Media Center edition.

1 Like