Realistic water scene node
-
- Posts: 288
- Joined: Wed Apr 16, 2008 1:45 am
- Contact:
-
- Posts: 149
- Joined: Wed Sep 09, 2009 4:57 pm
- Contact:
-
- Posts: 125
- Joined: Thu Dec 11, 2008 9:50 pm
- Location: Wisconsin
- Contact:
-
- Posts: 125
- Joined: Thu Dec 11, 2008 9:50 pm
- Location: Wisconsin
- Contact:
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/
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/
It's just bumpmapped specular lighting, you can google for the shader code.blackMasoon wrote:I was woundering how should be the shader modified to add this tipe of light reflection to water:
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
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
The URL is: http://www.gamedev.lv/files/RealisticWa ... ode016.zip
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:
http://www.gamedev.lv/files/RealisticWa ... ode017.zip
Here is the screenshot of new version:
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:
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:
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;
}
Tested on multiple machines and found some bugs in shaders. New URL:
http://www.gamedev.lv/files/RealisticWa ... ode019.zip
http://www.gamedev.lv/files/RealisticWa ... ode019.zip