Realistic water scene node

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Post Reply
elvman
Posts: 253
Joined: Sun Sep 17, 2006 9:37 am
Location: Riga, Latvia
Contact:

Realistic water scene node

Post by elvman »

Water scene node with reflections and refractions.

Screenshot:
Image

Download:
GitHub

Usage on Windows:

Code: Select all

water = new RealisticWaterSceneNode(SceneManager, width, height);
Usage on OSX:

Code: Select all

std::string resourcePath()
{
    NSString* path = [[NSBundle mainBundle]resourcePath];
    
    return [path cStringUsingEncoding:NSASCIIStringEncoding];
}
 
water = new RealisticWaterSceneNode(SceneManager, width, height, resourcePath().c_str());
 
Future plans:
Support fog in HLSL
Tessellated look
Caustics
Light support
Optimization in render count

License
Realistic water scene node is released under BSD license. It means that you can use Realistic water scene node in any commercial or noncommercial product, but you (the licensee) must mention my name in the credits of your product and the credits must stay in the source code of the Realistic water scene node.
Last edited by elvman on Tue Aug 20, 2013 5:49 pm, edited 28 times in total.
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Hi!

Cool. Just what I needed to put in my demo!

Do you have a quick example to how to use your code?

From what I saw from the source code It need the shader v2, but you have made the code for DirectX9 and OpenGl. That's very good.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

I think that's the most beautiful irrlicht project i've ever seen! Well done! I think i'll have to take a sneaky peak at your code as the water in my project isn't working quite right.. the reflections and refractions are a bit messed up probably due to me having limited shader knowledge and having nicked the shaders from PS3 tutorials :lol:
Image Image Image
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

It would be great if irr developers can add this into the engine core.
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

Looks realy good ...keep it up :)
elvman
Posts: 253
Joined: Sun Sep 17, 2006 9:37 am
Location: Riga, Latvia
Contact:

Post by elvman »

Corrected some problems with reflection.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Hey good job, looks like your skill with shaders is improving! :D
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
elvman
Posts: 253
Joined: Sun Sep 17, 2006 9:37 am
Location: Riga, Latvia
Contact:

Post by elvman »

Added OpenGL support (at least tried) and made some minor changes.
There is a problem with OpenGL render targets: it logs the following string to a log: "FBO has one or several image attachments with different dimensions
FBO error", I looked up for this error and found out, that this is OpenGL's GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT error. I tried changing the dimensions of the render target, but had no success. Can anybody test this on your computer and post the results here, please?
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Hey wait a second, is DDS already supported in irrlicht? :? Thats good to hear :D (Seems to me I keep learning of new features in your threads :P )

PS: Have you thought about moving all the update() stuff over to onprerender() (I think thats what its called they may have changed the name) considering that you are already inheriting the scene node interface? This will help it integrate more smoothly with Irrlicht if need be.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Excellent! Thanks for the example! I'll try this.

Thanks.
benny53
Posts: 131
Joined: Fri May 26, 2006 10:21 pm
Location: Ohio

Post by benny53 »

so does this have refraction as well?

ps: I can't test until my new computer arrives with my 8600gts... so thats why I'm asking here.
Monochrome
Posts: 122
Joined: Thu Oct 19, 2006 11:43 am

Post by Monochrome »

holy poop, this is made of win and god \o/
elvman
Posts: 253
Joined: Sun Sep 17, 2006 9:37 am
Location: Riga, Latvia
Contact:

Post by elvman »

Released a new version. The first post was edited.
  • Removed the update function (everything is now done in OnAnimate function).
  • Added the water color (setWaterColor, setColorBlendFactor) so the water now looks more realistic
Screenshot:
Image

P.S. Why does OnAnimate starts with a capital letter? Shouldn't it be onAnimate?
benny53
Posts: 131
Joined: Fri May 26, 2006 10:21 pm
Location: Ohio

Post by benny53 »

@ elvman - does this have refraction?
krama757
Posts: 451
Joined: Sun Nov 06, 2005 12:07 am

Post by krama757 »

Damn this looks beautiful! Elvman I'm going to try to implement this into my game. Thanks a bunch for the code!

There are some problems though. Firstly, we dont have a "setClipPlane()" function in irrlicht 1.3.1. Also, reflection in the water shows the borders between the skybox planes. Any plans on fixing these errors?
Post Reply