Realistic water node
-
- Competition winner
- Posts: 523
- Joined: Tue Jan 15, 2013 6:36 pm
Realistic water node
Has anyone gotten this to work with there main application that is using some rtt effects?
I've looked into changing some things but can't get it to render the water the plane is just black. I believe the waterscenenode does it's own render to texture method and my application does it's own render to texture effect and I believe that is the problem as both are trying to render to texture and causing conflicts.
I've looked into changing some things but can't get it to render the water the plane is just black. I believe the waterscenenode does it's own render to texture method and my application does it's own render to texture effect and I believe that is the problem as both are trying to render to texture and causing conflicts.
-
- Competition winner
- Posts: 523
- Joined: Tue Jan 15, 2013 6:36 pm
Re: Realistic water node
No need to watch. While I've been away I looked into paraboloid reflections and made a shader for it and set it up in irrlicht it's seems pretty decent it's not as accurate as a cubemap but it only takes two passes as cubemapping takes up to six. And since I made it, it works fine in my application. I'll upload some screenshots of it. It's just like the video below minus the shadows as I did not need this.
https://youtu.be/xoTMdEoMlhQ
https://youtu.be/xoTMdEoMlhQ
-
- Competition winner
- Posts: 523
- Joined: Tue Jan 15, 2013 6:36 pm
Re: Realistic water node
You can make the water more transparent by adjusting your materials alpha channel. I'm going to try to improve the water normal mapping effect as I feel it can be better.
Take 2 passes you can angle the two cameras for this effect in any direction you want. I mostly have the pass camera pointing up to capture everything right above the water.
I haven't added refraction yet.
Not as accurate as a cubemap but I've noticed it very performance friendly
Re: Realistic water node
Are you talking about my water scene node (https://github.com/elvman/RealisticWaterSceneNode)? If so, feel free to fork it, make your changes and send a pull request afterwards .
-
- Competition winner
- Posts: 523
- Joined: Tue Jan 15, 2013 6:36 pm
Re: Realistic water node
No elvman this water is using dual paraboloid reflection shaders. I created this as I could not get your water scene node to work with my main app that is using screen effects.
Re: Realistic water node
The problem is at Line 174:elvman wrote:Are you talking about my water scene node (https://github.com/elvman/RealisticWaterSceneNode)? If so, feel free to fork it, make your changes and send a pull request afterwards .
Code: Select all
//set back old render target
_videoDriver->setRenderTarget(0, false, true);
Re: Realistic water node
What do you mean by that? I am setting back the previous render target (setRenderTarget(0)) after rendering the water, so to render the water to your render target, just set it before rendering the water node.
-
- Competition winner
- Posts: 523
- Joined: Tue Jan 15, 2013 6:36 pm
Re: Realistic water node
I think I tried that the water plane was always black. But if you rendered the scene with screen effect the water worked fine. Maybe what mongoose7 said??
Re: Realistic water node
No, you are setting the framebuffer as the render target. There is no such thing as "the previous render target", the render target must be specified explicitly.elvman wrote:What do you mean by that? I am setting back the previous render target (setRenderTarget(0)) after rendering the water, so to render the water to your render target, just set it before rendering the water node.
Re: Realistic water node
Oh, ok, line 602 of IVideoDriver.h (driver->setRenderTarget(0); // set previous render target) and line 3781 of COpenGLDriver.cpp (COpenGLTexture* renderTargetTexture = static_cast<COpenGLTexture*>(prevRenderTarget->getTexture());) really got me confused. But there is no way to get current render target, so there is no way to reset back the previous render target in the OnAnimate method.
Re: Realistic water node
But you can store it. Either RealisticWater(..., rtt=0) or water->setRTT(rtt). Then you can do driver->setRenderTarget(rtt ...);
Re: Realistic water node
elvman.. You sir, are a Genius!! Your water node compiles with Irrlicht 1.8.3 and the blue GL artifact (GLSL mode) is solved by referring to textures using S32 instead of f32!
I'm really enjoying dissecting your project! Also the Screenquad based FXAA is the ultimate in Antialiassing! (I even turned off my Hardware AA)
I am learning at a geometric rate! I love the way you incorporated NVIDIA shader library shaders into the project!
This is really inspiring stuff! Are you a quantum physicist?
Wow...
I'm really enjoying dissecting your project! Also the Screenquad based FXAA is the ultimate in Antialiassing! (I even turned off my Hardware AA)
I am learning at a geometric rate! I love the way you incorporated NVIDIA shader library shaders into the project!
This is really inspiring stuff! Are you a quantum physicist?
Wow...
Re: Realistic water node
Ha ha, thanks! What do you mean by "referring to textures using S32 instead of f32"?