Page 17 of 18

Re: Realistic water scene node

Posted: Mon Mar 17, 2014 1:01 pm
by Mars_999
Did you read my post? You need to adjust the clip plane

Re: Realistic water scene node

Posted: Mon Mar 17, 2014 3:45 pm
by Christi258
Ok, thanks.
But how do I do that?

Re: Realistic water scene node

Posted: Tue Mar 18, 2014 12:32 am
by elvman
I will look into this. Thanks for feedback.

Re: Realistic water scene node

Posted: Tue Mar 25, 2014 1:03 am
by Mars_999

Code: Select all

 
void RealisticWaterSceneNode::OnAnimate(u32 timeMs)
{
    ISceneNode::OnAnimate(timeMs);
 
    _time = timeMs;
 
    //fixes glitches with incomplete refraction
    const f32 CLIP_PLANE_OFFSET_Y = 250.0f;//5.0f
 
    if (IsVisible)
    {
        setVisible(false); //hide the water
 
        //refraction
        _videoDriver->setRenderTarget(_refractionMap, true, true); //render to refraction
 
        //refraction clipping plane
        core::plane3d<f32> refractionClipPlane(0, RelativeTranslation.Y + CLIP_PLANE_OFFSET_Y, 0, 0, -1, 0); //refraction clip plane
        _videoDriver->setClipPlane(0, refractionClipPlane, true);
 
        _sceneManager->drawAll(); //draw the scene
 
        //reflection
        _videoDriver->setRenderTarget(_reflectionMap, true, true); //render to reflection
 
        //get current camera
        scene::ICameraSceneNode* currentCamera = _sceneManager->getActiveCamera();
 
        //set FOV anf far value from current camera
        _camera->setFarValue(currentCamera->getFarValue());
        _camera->setFOV(currentCamera->getFOV());
 
        core::vector3df position = currentCamera->getAbsolutePosition();
        position.Y = -position.Y + 2 * RelativeTranslation.Y; //position of the water
        _camera->setPosition(position);
 
        core::vector3df target = currentCamera->getTarget();
 
        //invert Y position of current camera
        target.Y = -target.Y + 2 * RelativeTranslation.Y;
        _camera->setTarget(target);
 
        //set the reflection camera
        _sceneManager->setActiveCamera(_camera);
 
        //reflection clipping plane
        core::plane3d<f32> reflectionClipPlane(0, RelativeTranslation.Y - CLIP_PLANE_OFFSET_Y, 0, 0, 1, 0);
        _videoDriver->setClipPlane(0, reflectionClipPlane, true);
 
        _sceneManager->drawAll(); //draw the scene
 
        //disable clip plane
        _videoDriver->enableClipPlane(0, false);
 
        //set back old render target
        _videoDriver->setRenderTarget(0, false, true);
 
        //set back the active camera
        _sceneManager->setActiveCamera(currentCamera);
 
        setVisible(true); //show it again
    }
}
 

Re: Realistic water scene node

Posted: Sun Mar 30, 2014 8:02 pm
by Seven
where can i get waterNormal.png and waterDvDv.png file from?

Hello (water)World

Posted: Thu Oct 02, 2014 6:56 pm
by pyandrea
I hope not to be off-topic, but I realize that many people here are using elvman's Realistic Water (https://github.com/elvman/RealisticWaterSceneNode).
As a newbie, I am looking for a simple example ('Hello World style') using elvman's Realistic Water.
Please, can you suggest the corresponding source code?

Re: Realistic water scene node

Posted: Mon Nov 24, 2014 9:48 pm
by elvman
I uploaded a sample app, that runs on OSX. If it doesn't run on Windows, please let me know, I will try to fix it later.
http://elviss.lv/files/water_sample.zip
Image

Re: Realistic water scene node

Posted: Thu Feb 18, 2016 3:17 pm
by diho
What causes this:

Image

-Diho

Re: Realistic water scene node

Posted: Fri Feb 19, 2016 2:58 am
by chronologicaldot
diho wrote:What causes this:

Image

-Diho
Your image isn't appearing, but I found the redirect to the actual image for anyone interested:
http://postimg.org/image/xsvoezvqj/

I can't answer the question, though, sorry. Hard to say what's going on without knowing how you set things up.

Re: Realistic water scene node

Posted: Fri Feb 19, 2016 3:54 pm
by diho
The only code I use is:

Code: Select all

RealisticWaterSceneNode *water = new RealisticWaterSceneNode(smgr, 102400.0f, 102400.0f);
    smgr->getRootSceneNode()->addChild(water);
    water->setPosition(spawnPoint);

Re: Realistic water scene node

Posted: Wed Mar 02, 2016 2:58 pm
by elvman
Can you try the demo app that I uploaded?

Re: Realistic water scene node

Posted: Mon May 16, 2016 8:48 pm
by The_Glitch
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 which is the issue just not sure what to change in the waterscenenode as my attempts are not working.

Re: Realistic water scene node

Posted: Sun Sep 18, 2022 3:22 pm
by kas1e
@All
Can anyone explain, why there: https://github.com/elnormous/RealisticW ... r.cpp#L120

In the "RealisticWaterSceneNode::OnAnimate()" we do have 2 times _sceneManager->drawAll(); : one time after refraction, and another after reflection. This reduce FPS x2.

I mean, should't it be calcualted refraction, the refletion, and only then one single "drawall()" call ?

Re: Realistic water scene node

Posted: Sun Sep 18, 2022 6:47 pm
by CuteAlien
Maybe because Irrlicht didn't have multi render targets when it was coded (wasn't in Irrlicht 1.8 I think).

Re: Realistic water scene node

Posted: Sun Sep 18, 2022 7:32 pm
by kas1e
@CuteAlien
Maybe because Irrlicht didn't have multi render targets when it was coded (wasn't in Irrlicht 1.8 I think).
Strange.. I just comment out one single DrawAll() call (first one), and keep just second one, and do have instead of 14 FPS, 24 FPS, and everything working as before.

Did it mean that 1.8.4 do have multi-render targets ?