unlimited planar reflections & refraction (update)


(martinsh) #81

leonn, for the oil painting effect I don’t really think this is the best solution. If the image is static (e.g. a picture) then a simple GLSL brush strokes shader would do the trick.

kevincorrigan - reflection and refraction rendering no, you can use this in Multitexture mode. The shader that processes the water surface and textures - yes it is a GLSL shader.

Ace Dragon, awesome! I was very interested in this thing once I saw it in CryEngine2. Thanks for the link, I will try to make it work in BGE.
I think it is not the shader that is causing the problem, but perhaps the texture rendering or camera setup… I have to do a deeper research.


(Ace Dragon) #82

My line of thinking when it comes to that problem is wondering how one would go and in effect ‘reset’ the shading and textures in full when the scene restarts or possibly when the scene changes, I don’t know much in the way of complex shading code but I would think there might be a way.

EDIT: Tested the scene and restarted with the texture script deleted just to see what would happen, I can confirm that the issue (the crash anyway) is probably the water texture script because restarting will not crash the scene if it’s not being used.


(chäeMil) #83

hi just a quick question… can i somehow setup the delayed camera with slow parent?? or i have to modify the mouselook script? thanks


(leonnn) #84

Thanks martinsh, but on that case the rest of the scene have a more realistic stile, just on the pictures on the wall I would use that effect, aniway thanks a lot, but in this particular case it would be better if I just let it go since the scene is allready kind of loaded!


(chäeMil) #85

and if is anyone interested here’s the video of the shader inside my project… just a quickie :smiley:


(musikai) #86

Since I really like Martins efforts and don’t know nothing about coding myself I just want to point to the free Aquatica Water Engine here on the bottom of the site:
http://www.magicindie.com/index.html?t=win
After install you can examine the water shaders (.fx-files) and perhaps it can be helpful. Although it is using directx they say the shaders are written in hlsl. Did I already mention that don’t know anything about coding?


(Crumpet) #87

@martinsh:
Thank you very much for this awesome contribution.
It is contributions like these that makes the BGE what it will become and proofs once again that a lot is possible, thank you.


(HG1) #88

If you use clip planes on Nvidia cards with GLSL shaders, then you have to set the gl_ClipVertex in the VertexShader of the clipped material. But ATI cards don’t support gl_ClipVertex so. I used a exception with __GLSL_CG_DATA_TYPES to check if a Nvidia card is used.

Here is a test file with that material shader.



water_surface_1.2 ClipFix.blend (772 KB)
Using a own material shader is no good solution because we loose the shading, lightning, texture and Shadows on the material.

Therefore I changed the Blender source code to fix the clip plane problem.
Here is a Windows 32 bit build.



http://www.mediafire.com/?93u0ompl597jate

And here is the Blender patch, if some one want to compile and test it on Linux or Mac.
http://www.mediafire.com/?532dalzdx1sckib


(laser blaster) #89

Thanks for the fix, HG1. What are the prospects of that small fix getting added into the Trunk?


(Yoda Almighty) #90

I use an nvidia card, and I still have render issues.


(HG1) #91

@ laser blaster:
I don’t know. I hope so.

@ Joda Almighty:
There are some possible reasons why it is not working.

  1. Your graphic card driver is to old. Try to update your graphic card driver.
  2. Your graphic card is to old and don’t support user clipping planes.
    Try this example file. water_surface_1.2 ClipFix2.blend (731 KB)
  3. I heard that on Mac gl_ClipVertex is not supported from the driver. Try also the example from point 2.

(JohnnyBlack) #92

Wont work on my pc, no chance… Ubuntu 11.10 GPU GTS450 .Tried all examples. Dark water.


(chäeMil) #93

what version of blender do you have… when i updated to the latest one from the ppa:cheleb/blender-svn it wont work. the last blender in which was the shader working is 2.61.4 r43747 you can download the .deb from here: 32bit and 64bit.

i dont know why it wont work. no error output in the terminal :confused:

p.s. if you want to stay with this blender version (if you are using this PPA or any other PPA) you can hold the blender package version using Synaptic package manager.


(HG1) #94

@BlendingBGE:
As chäeMil mentioned that has nothing to do with my changes.
Martinsh shader did not work with the latest versions of Blender. I don’t know why at the moment.
Try it with a older build from http://graphicall.org/linux.


(JohnnyBlack) #95

Thank you both, it works now!


(HG1) #96

I found out why the shader don’t work.
In the newer versions of Blender ImageRender and ImageMirror did not work any more.


(Ace Dragon) #97

This may be due to an attempted fix on another issue where videoTexture wasn’t working by Ben2610.

It might just require a bit of tweaking or the fix, while fixing something broke something else.


(MarcoIT) #98

too cool!

i tryed now water surface(1).blend.
is really beautifoul , but , is fast exactly as one plane + 1 lamp! (46 FPS in fullscreen and 60 with 3/4 screen)

exactly the same , no one FPS less! :smiley:

if it were possible to decrease a bit the resolution could be used in fullscreen! at 60 FPS!

great!!

win 7 CPU 2.80 GHz
512 MBGeForce 8400 GS

Attachments



(MarcoIT) #99

yes, “little error” solved with version water_surface_1.2 ClipFix.blend

:wink:


(Yoda Almighty) #100

didn’t fix it for me :frowning: