Page 1 of 1

xEffects - rendering problem

Posted: Wed Aug 20, 2014 11:38 am
by Rama112
Hello all,

I already posted this issue on the official xEffects topic, but it seems that there is nobody there, so I try with a new topic here.

Actually, I'm experiencing some rendering problems with xEffects 1.3 (on Irrlicht 1.7.3)
Image

full picture: http://www.image-share.com/upload/2663/230.jpg

As you can see on the picture, the textures of the mesh looks as if it was separated from the car model as long as the speed of the mesh increases (if the model is just standing, their is no separation). That creats something like a "ghost effect". The problem occurs using either EDT_OPENGL or EDT_DIRECT3D9.
However, if I switch to irr::f32 TexVar = 0 in EffectCB.h and use EDT_OPENGL, the problem desappears but the light also desappears!
On this screen shot, I use a standard irrlicht light for the grass and a xEffect light for the road and the car.

The code of the xEffect light is below (SCALE=1 and shadowDimen=1024) :

Code: Select all

    effect->addShadowLight(SShadowLight(shadowDimen, irr::core::vector3df(0, 15*SCALE, 0), irr::core::vector3df(0*SCALE, 0, 0*SCALE),
        irr::video::SColor(0, 200, 200, 200), (float)0.5*SCALE, 30*SCALE,60*DEG2RAD ,false));
At each frame, the light is moved to be approximatly 15m (or Irrlicht unit) upon the car just before calling effect->update().
I tried on two different laptop (a Lenovo T520, and a HP Zbook with a K5100m) and got exactly the same problem.

Does someone ever experienced this strange effect? Do you have some idea of what could be the reasons?

Thank you for your help!

Re: xEffects - rendering problem

Posted: Fri Aug 22, 2014 9:56 pm
by Rama112
up!

Still the same problem of rendering. I tried with a simpler car mesh, exacty the same problem. The change of the global scale (ratio between meter and irrlicht unit) makes no change.
I'm really considering on quitting Irrlicht maybe to direct openGL or Ogre if i'm not able to render shadows at high FPS. Do you have another technic for shadow rendering except the standard stencil shadows and the xEffects?

help please! :(

thanks

Re: xEffects - rendering problem

Posted: Sat Aug 23, 2014 12:07 am
by kklouzal
XEffects was created back in 2008, that's over 6 years ago now, It's not supported with any version of Irrlicht past 1.7.3. I've never used it and don't know anyone who does. You may want to look at entity's irr renderer http://irrlicht.sourceforge.net/forum/v ... =6&t=49713 I don't know if it will help you, I'm afraid XEffects is dead though.

Re: xEffects - rendering problem

Posted: Sat Aug 23, 2014 2:21 am
by mongoose7
A big statement! You can still use XEffects today but there may be a problem setting the sampler (though it seems to be OK on Nvidia cards).

It is difficult to get a handle on the problem. The shadows for the car appear to be drawn behind the car, but the shadows for the wheels seem to be drawn in front of the wheels. I wonder if you've changed the XEffects code. Anyway, the way the code works is that the scene is first drawn normally (to a render target) and then the shadows are merged with the scene. See if anything happens between these two events. Like, do you move the car at this point. In fact, you could print out the position that you set for the car each time you set it. See if you set the position twice per frame. (You should set the position based on frame or time, not increment it at each call.)

Re: xEffects - rendering problem

Posted: Sat Aug 23, 2014 10:38 am
by Rama112
Many thanks for your answers!

I check about the correct setPosition - RenderFrame order il the loop, all is ok.
The only thing I tried to change in the Irrlicht code is the irr::u32 TexVar = 0 in EffectCB.h but I went back to the original code.

Here is another picture with a low poly mesh:
Image
full pic: http://www.image-share.com/upload/2669/22.jpg

As you can see, it really looks like the lighting was separated from the mesh. The distance of separation is a function of the speed of the car (or maybe the camera), and the global scale has no influence.
I've no problem with the standard Irrlicht renderer (except the very slow stencil shadows...)

Two other pics, the first when the car is stopped and the second when driving:

Image
Image


Even the lighing of the terrain is altered...

I think, I will have a look to IrrRenderer (at least to compare the performances (in terms of fps) with xEffects).

I'll keep you informed of my results.

Re: xEffects - rendering problem

Posted: Thu Sep 04, 2014 6:18 pm
by Rama112
Hi!

I found the problem, It was due to the fact that the camera was attached (ie a child node) of the car it self. I attached it to the root node and no more problem occured.

However, xEffects is really not suited for exterior rendering, it's really difficult to set the lights as sun light...

I tried out irrRender, but it provides only .a and I use VC++ so i need .lib.

Re: xEffects - rendering problem

Posted: Thu Sep 04, 2014 7:26 pm
by kklouzal
You silly goose you've got to compile irrRenderer from source ^.^

Re: xEffects - rendering problem

Posted: Thu Oct 09, 2014 11:10 am
by BlindSide
Rama112 wrote:Hi!

I found the problem, It was due to the fact that the camera was attached (ie a child node) of the car it self. I attached it to the root node and no more problem occured.

However, xEffects is really not suited for exterior rendering, it's really difficult to set the lights as sun light...

I tried out irrRender, but it provides only .a and I use VC++ so i need .lib.
Hey mate,

For outdoor rendering please try an orthogonal shadow that follows the camera, I even created a tutorial here: http://irrlicht.sourceforge.net/forum/v ... hp?t=29105

On the other topic, kklouzal is right, I haven't really touched it in 6 years so a few things might be outdated.