Realistic water scene node

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
m_krzywy
Posts: 133
Joined: Sat Nov 04, 2006 2:05 pm

Post by m_krzywy »

Virion wrote:
m_krzywy wrote:http://www.geocities.com/zaros64/Realis ... ode015.zip

reuploaded on previous site
i thought geocities has closed?

http://news.portalit.net/fullnews_yahoo ... _2268.html
sry my link is dead too :(
wing64
Competition winner
Posts: 242
Joined: Wed Jul 23, 2008 2:35 am
Location: Thailand
Contact:

Post by wing64 »

new link RealisticWaterSceneNode015.zip
http://www.mediafire.com/download.php?jayfdrjz0mt
m_krzywy
Posts: 133
Joined: Sat Nov 04, 2006 2:05 pm

Post by m_krzywy »

I'm using this water scene node with xeffects and it seems to have some problems with:

RealisicWater.cpp

Code: Select all

VideoDriver->setRenderTarget(RefractionMap, true, true, video::SColor(0,0,0,255)); //render to refraction

VideoDriver->setRenderTarget(ReflectionMap, true, true, video::SColor(0,0,0,255)); //render to reflection
With these lines screen is just black. Commenting them makes water ugly but there's some image on the screen.

First of all i tryed commenting:

Code: Select all

VideoDriver->setRenderTarget(0,true,true,video::SColor(255,255,255,255));
Because that rendered texture should pass through xeffects but that makes no difference. Screen is black. Have anyone using it with diferent postprocessing? How?
Chet
Posts: 53
Joined: Wed Sep 10, 2008 5:34 am

Post by Chet »

I had this node working a week or 2 ago (got a few warnings on compile tho) then I switched from codeblocks to dev-cpp and now I have this lovely stuff

Code: Select all

Irrlicht Engine version 1.5.1
Microsoft Windows XP Professional  (Build 2600)
Using renderer: OpenGL 2.1.1
GeForce 7025 / NVIDIA nForce 630a/PCI/SSE2/3DNOW!: NVIDIA Corporation
OpenGL driver version is 1.2 or better.
GLSL version: 1.2
Generated terrain data (1025x1025) in 2.0030 seconds
Loaded texture: E:\ALLNEW\tools\irrlicht-1.5.1\media2\output1.jpg
Loaded texture: E:\ALLNEW\tools\irrlicht-1.5.1\media\detailmap3.jpg
Loaded texture: E:\ALLNEW\tools\irrlicht-1.5.1\media\skydome.jpg
Loaded texture: E:\ALLNEW\tools\irrlicht-1.5.1\media2\waterbump.png
GLSL shader failed to compile
(39) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals

(43) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals

(43) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals

(44) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals

(44) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals

(50) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals

(50) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals

(51) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals

(51) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals

(59) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals

(65) : warning C7011: implicit cast from "int" to "float"
(67) : error C0000: syntax error, unexpected '=' at token "="
(67) : error C0501: type name expected at token "="
(67) : warning C7011: implicit cast from "int" to "float"

:(
EDIT: I managed to make the errors go away and the water looks pretty good except for the small detail that the water plane is perpendicular to the terrain.

Code: Select all

  Water->setPosition(core::vector3df(0,0,0));
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

irrlicht is missing one small feature... it is getting the current render target... it causes problems

render to 0 or some rtt in case of xeffects
then render to refraction (which is fuckloads inefficient because the render target above could be copied to this one)
then render to reflection
then its supposed to render to screen!!!! or to the "some rtt"
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

@devsh,

It's not in my refraction demo but I didn't find it too hard to render the scene, preserve the depth buffer and then render the transparent refraction object without having to do another pass, all you do is not clear the zbuffer, copy the rtt to another (Using a screenquad or something) and then use the copy to refract. The only issue is the clipping, but there're ways around that.

We do plan to add faster, low level copying functions so you don't have to use the screen quad. There was a snippet on the forums for "copyBackbufferTo" which I use quite frequently in my own projects as it allows me to do anti-aliasing on the backbuffer (Not allowed on RTTs in D3D9) and copy it over. You could use this for copying the refraction aswell. I couldn't get the OpenGL implementation working though which I posted in the same topic but I feel that I was very close.

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
P1SQ4M
Posts: 66
Joined: Sat Sep 19, 2009 1:47 am

Post by P1SQ4M »

Pictures are down, could you republish them?
dalerank2
Posts: 121
Joined: Thu Dec 03, 2009 7:41 am

Wrong work in nVidia

Post by dalerank2 »

This code wrong work on 1.6 irr with nVidia card... 9600Pro
oldskoolPunk
Posts: 199
Joined: Wed Nov 29, 2006 4:07 am

Post by oldskoolPunk »

Anyone still using this? The refraction looks good but my reflection is messed up. Here is a render of the reflection.

Image

Seems I had this problem with shadow projection too ...
Signature? I ain't signin nuthin!
oldskoolPunk
Posts: 199
Joined: Wed Nov 29, 2006 4:07 am

Post by oldskoolPunk »

Hey I got it!
Image

I had to change a line in onAnimate

from

Code: Select all

CurrentCamera->getPosition();
to

Code: Select all

CurrentCamera->getAbsolutePosition();
because of my wacky camera setup.

Thank you!

OpenGL seems fine here in irrlicht 1.5, from some angles ...
Signature? I ain't signin nuthin!
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

make changes to the shader... can you see the wacky edge on the left side

clamp()
elvman
Posts: 253
Joined: Sun Sep 17, 2006 9:37 am
Location: Riga, Latvia
Contact:

Post by elvman »

Hi!
Haven't visited this forum for about 2 years. Had to do my own things. Sorry for not replying to your messages. I don't know what happened here for all this time, but it seams that you are still using this scene node. So I guess my duty is to make it up to date and fix things I didn't fix back then. Whenever I have some free hours, I will try to fix it, if still needed of course.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Image

Sorry I had to :P

Nice to see you again elvman
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I guess we should move this node to irrext in order to have it more easily accessible. Please notice me once you're done with updating and I'll add it to the repository.
elvman
Posts: 253
Joined: Sun Sep 17, 2006 9:37 am
Location: Riga, Latvia
Contact:

Post by elvman »

Ok, hybrid.
Post Reply