Ok, thankyou for the advice. I had no idea that affect the Y axis. I have a light now. Anyways I´ll try some code and change other values in the main code and shaders to see if I can workaround with this.Bate wrote:The CLIP_PLANE_OFFSET is meant to be used for slight adjustments only, which means it should be kept close to 0 (exactly 0 at best)...
Blood & Water Effects [Irrlicht 1.7.1]
-
- Competition winner
- Posts: 117
- Joined: Wed Jun 30, 2010 8:44 am
- Location: Portugal
- Contact:
-
- Competition winner
- Posts: 117
- Joined: Wed Jun 30, 2010 8:44 am
- Location: Portugal
- Contact:
Ok, after a few days everything goes great so far. Irrlicht is amazing indeed, every past day I find great irrlicht functions, that I dunno. I can see with a bit of imagination and irrlicht, there is nothing that you cant do. I´ve solved transparency and many other issues. (Not irrlicht issues, but only a newbie issues as is the firsts steps on it).
The water shaders do their work great!
HELP: There is a way to do NOT reflex some nodes? (In the case I want to hide/remove texts and lensflare reflexions, I´ve been trying with no luck)
The water shaders do their work great!
HELP: There is a way to do NOT reflex some nodes? (In the case I want to hide/remove texts and lensflare reflexions, I´ve been trying with no luck)
hmm... I'm having issues with the GLSH shaders for the Blood effect.. It works - but while any of the blood effects are active, my skybox/dome has 'fog' enabled which makes it turn colors. Same with the particle system itself, all the particles have the fog color'd background. I can't figure out why it's toggling the skybox fog enabled on/off, and why it wont be transparent... My code is the default stuff.
EDIT
Wait a minute, upon closer inspection that isnt my skybox fog being toggled, it's just a giant yellowish circle that takes up the entire back buffer (rendered on top of the skybox, but before everything else). Something to do with world projection or?
EDIT
Wait a minute, upon closer inspection that isnt my skybox fog being toggled, it's just a giant yellowish circle that takes up the entire back buffer (rendered on top of the skybox, but before everything else). Something to do with world projection or?
__________________________________
...you'll never know what it's like, living your whole life in a dream...
...you'll never know what it's like, living your whole life in a dream...
Okay, so I successfully got this implemented in my scene, and it looks great -- until I try to move it. As long as I just move it up and down, it continues to work. If I try to move its position, it does this:
It will flicker as I move and turn the camera, fluctuating between the blue and the grey seen in the picture, with no reflectivity. I don't really understand why this is happening, as all I did was change its position. I tried moving the reference camera in CWaterSurface.cpp, to no avail. Here's what I have:
It works when vector3df is set to (0,-3590,0), but not if I change either 0. Yet it works with any value replacing -3590, as long as both of the other values are 0. I'm using Irrlicht 1.7.2, if that makes a difference.
It will flicker as I move and turn the camera, fluctuating between the blue and the grey seen in the picture, with no reflectivity. I don't really understand why this is happening, as all I did was change its position. I tried moving the reference camera in CWaterSurface.cpp, to no avail. Here's what I have:
Code: Select all
CWaterSurface *waterplane = new CWaterSurface(smgr,vector3df(0,-3590,34147),
511.99,127.99,true,true,dimension2du(512,512),0,-1);
-
- Posts: 70
- Joined: Tue Oct 28, 2008 12:59 pm
Sure, here's my project folder. This is just a test scene, to get used to the workings of Irrlicht; as such, it's a pretty sloppy mashing together of several tutorials. The project file is for Code::Blocks, and the problematic line is 120 in main.cpp.
http://www.mediafire.com/?f5pcaitcepabbm4
http://www.mediafire.com/?f5pcaitcepabbm4
@Aterious:
The bug you are experiencing comes from the design of the water node itself... I bet the node only supports a fully horizontal water surface (that is with the normal 0,1,0 ) and it doesnt use a TRUE reflect() function but merely flips the camera position by doing this
vector3df distance = camera.pos-waterpos;
watercamera.pos = waterpos-distance;
which only works correctly when the X and Z are null, to correct this behaviour
float distance = camera.pos.Y-waterpos.Y;
watercamera.pos.Y = waterpos.Y-distance;
watercamera.pos.XZ = camera.pos.XZ;
Unless the behaviour comes from another thing.... Your camera might be a child of some node, or the water could. Check if the positions used are not ->getPosition() but ->getAbsolutePosition()
The bug you are experiencing comes from the design of the water node itself... I bet the node only supports a fully horizontal water surface (that is with the normal 0,1,0 ) and it doesnt use a TRUE reflect() function but merely flips the camera position by doing this
vector3df distance = camera.pos-waterpos;
watercamera.pos = waterpos-distance;
which only works correctly when the X and Z are null, to correct this behaviour
float distance = camera.pos.Y-waterpos.Y;
watercamera.pos.Y = waterpos.Y-distance;
watercamera.pos.XZ = camera.pos.XZ;
Unless the behaviour comes from another thing.... Your camera might be a child of some node, or the water could. Check if the positions used are not ->getPosition() but ->getAbsolutePosition()
Sorry I didn't reply earlier; today was the first day I had a chance to work on this. I've tried various permutations of
(changed to suit my code, of course), and nothing I tried has worked after about three hours of working on it. Finally, I've just moved everything else in my scene by -37147. That's annoying to do, of course. In the first post, Bate states that this scene node is "...movable, scalable and works with parents", however, I've not found this to be the case at all. I've not worked with parents with it, and it is definitely scalable, but it doesn't seem to be movable except in the vertical, no matter what I do.
Code: Select all
float distance = camera.pos.Y-waterpos.Y;
watercamera.pos.Y = waterpos.Y-distance;
watercamera.pos.XZ = camera.pos.XZ;
-
- Competition winner
- Posts: 117
- Joined: Wed Jun 30, 2010 8:44 am
- Location: Portugal
- Contact:
Bate wrote:in OnAnimate() right before SceneManager->drawAll() simply set all nodes that shouldn't reflect invisible and afterwards visible again. You probably wanna add a member array of scenenodes to be excluded.
Thankyou all for the tips! Got it! It is working like i want to, now!hybrid wrote:You might even separate them into two scene managers, which makes work sometimes much simpler.
Last edited by jorgerosa on Tue May 08, 2012 8:46 pm, edited 2 times in total.