Realistic water scene node
-
- Posts: 326
- Joined: Wed Dec 14, 2005 10:08 pm
The code is not compiling under 1.3.1 :
Code: Select all
18 cpp\RealisticWater.cpp no matching function for call to `irr::scene::ISceneManager::addHillPlaneMesh(const char[15], irr::core::dimension2d<irr::f32>&, irr::core::dimension2d<irr::u32>)'
312 cpp\main.cpp `Water' undeclared (first use this function)
312 cpp\main.cpp `width' undeclared (first use this function)
312 cpp\main.cpp `height' undeclared (first use this function)
312 cpp\main.cpp `VideoDriver' undeclared (first use this function)
312 cpp\main.cpp `Irrlicht' undeclared (first use this function)
In irrlicht 1.3.1 you will have to change the line 18 in .cpp file to this:
VideoDriver is the pointer to your IVideoDriver and Irrlicht is the pointer to your IrrlichtDevice.
Code: Select all
scene::IAnimatedMesh* WaterMesh=SceneManager->addHillPlaneMesh("realisticwater",Size,core::dimension2d<s32>(1,1));
You can do it like this:312 cpp\main.cpp `Water' undeclared (first use this function)
312 cpp\main.cpp `width' undeclared (first use this function)
312 cpp\main.cpp `height' undeclared (first use this function)
312 cpp\main.cpp `VideoDriver' undeclared (first use this function)
312 cpp\main.cpp `Irrlicht' undeclared (first use this function)
Code: Select all
RealisticWaterSceneNode* Water=new RealisticWaterSceneNode(SceneManager, 256.0f, 256.0f, VideoDriver->getTexture("data/waterbump.png"),Irrlicht->getTimer());
So here is what it looks like to me:
Here is the code I used:
Here is the code I used:
Code: Select all
RealisticWaterSceneNode* pWater;
pWater = new RealisticWaterSceneNode(irrSceneMan, 2100.0f, 2100.0f, irrDriver->getTexture("data/textures/env/waterbump.png"),irrDevice->getTimer());
It looks like your backbuffer is smaller than the RTT of the water. You will have to do it like this:
Code: Select all
RealisticWaterSceneNode* pWater;
pWater = new RealisticWaterSceneNode(irrSceneMan, 2100.0f, 2100.0f, irrDriver->getTexture("data/textures/env/waterbump.png"),irrDevice->getTimer(),core::dimension2di(256,256));
Hmm, nope, using that exact code I got the same result as the image. Also, now using this code gives me an error in IUnknown.h
Code: Select all
bool drop()
{
_IRR_DEBUG_BREAK_IF(ReferenceCounter <= 0) // someone is doing bad reference counting.
--ReferenceCounter;
if (!ReferenceCounter)
{
delete this;
return true;
}
return false;
}
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Hi Elvman.
I was able to successfully implement your codes into my demo!
I've had only a texture problem (a file as DDS extension.) Converted it as a PNG file.
Here some screenshots of the implementation (Developping with DEVCPP with IRRLICHT 1.3.1)
I noted your nickname and your site for the water rendering in the text file accompagning my demo.
I was able to successfully implement your codes into my demo!
I've had only a texture problem (a file as DDS extension.) Converted it as a PNG file.
Here some screenshots of the implementation (Developping with DEVCPP with IRRLICHT 1.3.1)
I noted your nickname and your site for the water rendering in the text file accompagning my demo.
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Just found out something weird... Refraction seem to fade on certain angles of the camera (X angles)
I've played in my demo and seen that if im checing the water in the direction of my sun (skybox); I see the refraction.
But, if I'm turning around 180 degrees, the refraction is not there anymore.
Can you check this? I'm using the FPSCamera can this have an incidence over this problem?
I've played in my demo and seen that if im checing the water in the direction of my sun (skybox); I see the refraction.
But, if I'm turning around 180 degrees, the refraction is not there anymore.
Can you check this? I'm using the FPSCamera can this have an incidence over this problem?
-
- Posts: 326
- Joined: Wed Dec 14, 2005 10:08 pm
Hey elvman, thank you very much for your quick response.
But I still can't get it to compile, I get :
[/size]
My header from main.cpp looks like this :
I have no ideea what to search for ,in order to fix.
Cheers.
But I still can't get it to compile, I get :
Code: Select all
RealisticWater.o(.text+0x0):RealisticWater.cpp: multiple definition of `RealisticWaterSceneNode::RealisticWaterSceneNode(irr::scene::ISceneManager*, float, float, irr::video::ITexture*, irr::ITimer*, irr::core::dimension2d<int>, irr::scene::ISceneNode*, int)'
main.o(.text+0x100):main.cpp: first defined here
RealisticWater.o(.text+0xa80):RealisticWater.cpp: multiple definition of `RealisticWaterSceneNode::RealisticWaterSceneNode(irr::scene::ISceneManager*, float, float, irr::video::ITexture*, irr::ITimer*, irr::core::dimension2d<int>, irr::scene::ISceneNode*, int)'
main.o(.text+0xb80):main.cpp: first defined here
RealisticWater.o(.text+0x1508):RealisticWater.cpp: multiple definition of `RealisticWaterSceneNode::~RealisticWaterSceneNode()'
main.o(.text+0x1608):main.cpp: first defined here
RealisticWater.o(.text+0x1722):RealisticWater.cpp: multiple definition of `RealisticWaterSceneNode::~RealisticWaterSceneNode()'
main.o(.text+0x1822):main.cpp: first defined here
RealisticWater.o(.text+0x193a):RealisticWater.cpp: multiple definition of `RealisticWaterSceneNode::~RealisticWaterSceneNode()'
main.o(.text+0x1a3a):main.cpp: first defined here
RealisticWater.o(.text+0x1b52):RealisticWater.cpp: multiple definition of `RealisticWaterSceneNode::OnRegisterSceneNode()'
main.o(.text+0x1c52):main.cpp: first defined here
RealisticWater.o(.text+0x1ba2):RealisticWater.cpp: multiple definition of `RealisticWaterSceneNode::OnAnimate(unsigned int)'
main.o(.text+0x1ca2):main.cpp: first defined here
RealisticWater.o(.text+0x1ef0):RealisticWater.cpp: multiple definition of `RealisticWaterSceneNode::render()'
main.o(.text+0x1ff0):main.cpp: first defined here
RealisticWater.o(.text+0x1ef6):RealisticWater.cpp: multiple definition of `RealisticWaterSceneNode::getBoundingBox() const'
main.o(.text+0x1ff6):main.cpp: first defined here
RealisticWater.o(.text+0x1f1c):RealisticWater.cpp: multiple definition of `RealisticWaterSceneNode::OnSetConstants(irr::video::IMaterialRendererServices*, int)'
main.o(.text+0x201c):main.cpp: first defined here
RealisticWater.o(.text+0x2318):RealisticWater.cpp: multiple definition of `RealisticWaterSceneNode::setWindForce(float)'
main.o(.text+0x2418):main.cpp: first defined here
RealisticWater.o(.text+0x232a):RealisticWater.cpp: multiple definition of `RealisticWaterSceneNode::setWindDirection(irr::core::vector2d<float>)'
main.o(.text+0x242a):main.cpp: first defined here
RealisticWater.o(.text+0x2356):RealisticWater.cpp: multiple definition of `RealisticWaterSceneNode::setWaveHeight(float)'
main.o(.text+0x2456):main.cpp: first defined here
RealisticWater.o(.text+0x2368):RealisticWater.cpp: multiple definition of `RealisticWaterSceneNode::setWaterColor(irr::video::SColorf)'
main.o(.text+0x2468):main.cpp: first defined here
RealisticWater.o(.text+0x238e):RealisticWater.cpp: multiple definition of `RealisticWaterSceneNode::setColorBlendFactor(float)'
main.o(.text+0x248e):main.cpp: first defined here
My header from main.cpp looks like this :
Code: Select all
#include <irrlicht.h>
#include <iostream>
#include <audiere.h>
#include <irrXML.h>
#include "windows.h"
#include <string>
using namespace irr;
using namespace io;
using namespace scene;
using namespace core;
using namespace video;
using namespace gui;
using namespace std;
using namespace audiere;
#include "RealisticWater.cpp"
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(lib, "audiere.lib")
Cheers.
elvman
you've done a great job with this!
Thanks a lot!
andrei25ni
as hybrid says, this line of code looks really strange...
I can't really help you any more than this, because I haven't tried to compile it for myself yet
you've done a great job with this!
Thanks a lot!
andrei25ni
Code: Select all
#include "RealisticWater.cpp"
I can't really help you any more than this, because I haven't tried to compile it for myself yet
-
- Posts: 326
- Joined: Wed Dec 14, 2005 10:08 pm