Realistic water scene node

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki

Re: Realistic water scene node

Postby Mars_999 » Mon Mar 17, 2014 1:01 pm

Did you read my post? You need to adjust the clip plane
Mars_999
 
Posts: 136
Joined: Sat Dec 08, 2012 7:59 pm

Re: Realistic water scene node

Postby Christi258 » Mon Mar 17, 2014 3:45 pm

Ok, thanks.
But how do I do that?
Christi258
 
Posts: 62
Joined: Wed Feb 06, 2013 12:11 pm

Re: Realistic water scene node

Postby elvman » Tue Mar 18, 2014 12:32 am

I will look into this. Thanks for feedback.
Ouzel – 2D game engine
Realistic water node
elvman
 
Posts: 253
Joined: Sun Sep 17, 2006 9:37 am
Location: Riga, Latvia

Re: Realistic water scene node

Postby Mars_999 » Tue Mar 25, 2014 1:03 am

cpp 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
    }
}
 
Mars_999
 
Posts: 136
Joined: Sat Dec 08, 2012 7:59 pm

Re: Realistic water scene node

Postby Seven » Sun Mar 30, 2014 8:02 pm

where can i get waterNormal.png and waterDvDv.png file from?
Seven
 
Posts: 868
Joined: Mon Nov 14, 2005 2:03 pm

Hello (water)World

Postby pyandrea » Thu Oct 02, 2014 6:56 pm

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?
pyandrea
 
Posts: 11
Joined: Sun Jul 13, 2014 7:01 pm

Re: Realistic water scene node

Postby elvman » Mon Nov 24, 2014 9:48 pm

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
Ouzel – 2D game engine
Realistic water node
elvman
 
Posts: 253
Joined: Sun Sep 17, 2006 9:37 am
Location: Riga, Latvia

Re: Realistic water scene node

Postby diho » Thu Feb 18, 2016 3:17 pm

What causes this:

Image

-Diho
diho
 
Posts: 46
Joined: Fri May 20, 2011 9:01 pm
Location: Netherlands

Re: Realistic water scene node

Postby chronologicaldot » Fri Feb 19, 2016 2:58 am

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.
User avatar
chronologicaldot
Competition winner
 
Posts: 518
Joined: Mon Sep 10, 2012 8:51 am

Re: Realistic water scene node

Postby diho » Fri Feb 19, 2016 3:54 pm

The only code I use is:

cpp Code: Select all
RealisticWaterSceneNode *water = new RealisticWaterSceneNode(smgr, 102400.0f, 102400.0f);
    smgr->getRootSceneNode()->addChild(water);
    water->setPosition(spawnPoint);
diho
 
Posts: 46
Joined: Fri May 20, 2011 9:01 pm
Location: Netherlands

Re: Realistic water scene node

Postby elvman » Wed Mar 02, 2016 2:58 pm

Can you try the demo app that I uploaded?
Ouzel – 2D game engine
Realistic water node
elvman
 
Posts: 253
Joined: Sun Sep 17, 2006 9:37 am
Location: Riga, Latvia

Re: Realistic water scene node

Postby The_Glitch » Mon May 16, 2016 8:48 pm

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.
User avatar
The_Glitch
Competition winner
 
Posts: 521
Joined: Tue Jan 15, 2013 6:36 pm

Previous

Return to Project Announcements

Who is online

Users browsing this forum: No registered users and 1 guest