xEffects - rendering problem

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Rama112
Posts: 7
Joined: Mon Aug 18, 2014 7:08 am

xEffects - rendering problem

Post 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!
Rama112
Posts: 7
Joined: Mon Aug 18, 2014 7:08 am

Re: xEffects - rendering problem

Post 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
kklouzal
Posts: 343
Joined: Sun Mar 28, 2010 8:14 pm
Location: USA - Arizona

Re: xEffects - rendering problem

Post 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.
Dream Big Or Go Home.
Help Me Help You.
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: xEffects - rendering problem

Post 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.)
Rama112
Posts: 7
Joined: Mon Aug 18, 2014 7:08 am

Re: xEffects - rendering problem

Post 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.
Rama112
Posts: 7
Joined: Mon Aug 18, 2014 7:08 am

Re: xEffects - rendering problem

Post 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.
kklouzal
Posts: 343
Joined: Sun Mar 28, 2010 8:14 pm
Location: USA - Arizona

Re: xEffects - rendering problem

Post by kklouzal »

You silly goose you've got to compile irrRenderer from source ^.^
Dream Big Or Go Home.
Help Me Help You.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Re: xEffects - rendering problem

Post 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.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Post Reply