Realistic water scene node

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Insomniacp
Posts: 288
Joined: Wed Apr 16, 2008 1:45 am
Contact:

Post by Insomniacp »

exciting I may have to use this if it gets updated :) I had issues before with the water turning a solid blue and didn't know how to fix it at the time but I am close to needing to add water again to the new map editor so this is definitely going to be in the test group for water :).
blackMasoon
Posts: 149
Joined: Wed Sep 09, 2009 4:57 pm
Contact:

Post by blackMasoon »

I was woundering how should be the shader modified to add this tipe of light reflection to water:

Image
Josh1billion
Posts: 125
Joined: Thu Dec 11, 2008 9:50 pm
Location: Wisconsin
Contact:

Post by Josh1billion »

I ran the demo, and it looks absolutely amazing! My new Irrlicht project will most likely include this (with credit given, of course). Since my next project is written in Java with Jirr, I'll have to port the code from C++ to Java; I'll post the resulting code for all to use when that happens. :)
www.JoshForde.com

Latest release: Super Orbulite World.
In development: Season of Dreams and others
Josh1billion
Posts: 125
Joined: Thu Dec 11, 2008 9:50 pm
Location: Wisconsin
Contact:

Post by Josh1billion »

Update: I tried to port it to Jirr/Java, and just when I had almost gotten it to compile, I found that RealisticWaterSceneNode uses plane3d, which is a class that Jirr apparently doesn't have implemented. Was plane3d added after version 1.4.1 (the current Jirr version)? If so, that would explain it.

Here's what I came up with, anyway. Aside from the plane3d issue, only a few more lines of code would need to be changed to get it to compile:

http://www.copypastecode.com/49458/
www.JoshForde.com

Latest release: Super Orbulite World.
In development: Season of Dreams and others
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

blackMasoon wrote:I was woundering how should be the shader modified to add this tipe of light reflection to water:

Image
It's just bumpmapped specular lighting, you can google for the shader code.
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 »

After a long break, I finally updated Realistic Water Scene Node. This update mostly contains code cleanup and one shader fix (commented the View).

The URL is: http://www.gamedev.lv/files/RealisticWa ... ode016.zip
elvman
Posts: 253
Joined: Sun Sep 17, 2006 9:37 am
Location: Riga, Latvia
Contact:

Post by elvman »

I would like to see some bug reports from you, so that I can fix them.
elvman
Posts: 253
Joined: Sun Sep 17, 2006 9:37 am
Location: Riga, Latvia
Contact:

Post by elvman »

Fixed problems with reflection and cleaned code a little bit.
http://www.gamedev.lv/files/RealisticWa ... ode017.zip

Here is the screenshot of new version:
Image
Seven
Posts: 1034
Joined: Mon Nov 14, 2005 2:03 pm

Post by Seven »

adding to CobbleStones object database now. Nicely done!
elvman
Posts: 253
Joined: Sun Sep 17, 2006 9:37 am
Location: Riga, Latvia
Contact:

Post by elvman »

Seven wrote:adding to CobbleStones object database now.
Sorry, but haven't heard of this project. Maybe you could post some screenshots with the water.
Seven
Posts: 1034
Joined: Mon Nov 14, 2005 2:03 pm

Post by Seven »

will do later today or tomorrow. for now, it's our first 80 degree day since last summer so I am off fishing :)
elvman
Posts: 253
Joined: Sun Sep 17, 2006 9:37 am
Location: Riga, Latvia
Contact:

Post by elvman »

Just finished working on the new version. Here is the link: http://www.gamedev.lv/files/RealisticWa ... ode018.zip

This version contains fully functional GLSL shader, so that now you can use Realistic Water Scene Node with OpenGL. Also cleaned up shader code.

Here is a screenshot with RWSN running on OpenGL:
Image
Seven
Posts: 1034
Joined: Mon Nov 14, 2005 2:03 pm

Post by Seven »

all i get is a blue square...........no errors, image loads fine....directx or opengl same situation.... any thoughts?

Code: Select all

#include "stdafx.h"
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

#include "realisticwater.h"

#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
//#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif
int main()
{
	IrrlichtDevice *device =
		createDevice( video::EDT_OPENGL, dimension2d<u32>(640, 480), 32, false, true, true, 0);
	if (!device) return 1;

	device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");
	IVideoDriver* driver = device->getVideoDriver();
	ISceneManager* smgr = device->getSceneManager();
	IGUIEnvironment* guienv = device->getGUIEnvironment();
	ICameraSceneNode* camera = smgr->addCameraSceneNode();
	camera->setPosition(vector3df(200,200,200));

	RealisticWaterSceneNode* water = new RealisticWaterSceneNode(smgr,512,512,driver->getTexture("..\\media\\waterbump.png"),device->getTimer());
	smgr->addLightSceneNode(0,vector3df(0,50,0));

	while(device->run())
	{
		driver->beginScene(true, true, SColor(255,100,101,140));
		smgr->drawAll();
		guienv->drawAll();
		driver->endScene();
	}

	device->drop();
	return 0;
}
elvman
Posts: 253
Joined: Sun Sep 17, 2006 9:37 am
Location: Riga, Latvia
Contact:

Post by elvman »

You haven't added any other objects to scene. What do you expect for water to look like if it has nothing to reflect and it has nothing under the surface?
elvman
Posts: 253
Joined: Sun Sep 17, 2006 9:37 am
Location: Riga, Latvia
Contact:

Post by elvman »

Tested on multiple machines and found some bugs in shaders. New URL:
http://www.gamedev.lv/files/RealisticWa ... ode019.zip
Post Reply