XEffects - Reloaded - New Release (V 1.4)

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: XEffects - Reloaded - New Release (V 1.3)

Post by mongoose7 »

1.8 changed how uniforms are set. I think you want to look at OnSetConstants().
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: XEffects - Reloaded - New Release (V 1.3)

Post by robmar »

1.8 is no longer compatible with GLSL! I´m staying with 1.7.3!
Jmgr
Posts: 2
Joined: Mon Nov 18, 2013 10:48 am

Re: XEffects - Reloaded - New Release (V 1.3)

Post by Jmgr »

Ah, yes, the solution was written a few posts before but somehow I thought that the fix was already applied...
I had to change the line

Code: Select all

irr::u32 TexVar = 0;
to

Code: Select all

irr::f32 TexVar = 0;
in the file EffectCB.h, line 90.

It does make sense, because casting a pointer to an int into a pointer to a float was doomed to fail. :|
I'm surprised it even worked before. Maybe if it's a 32 bit system and if the int value is 0 then the float would also have the value 0.0f. Otherwise it would probably have random results.

Anyway, thanks, it works now :)
My website: http://jmgr.net
xyz
Posts: 7
Joined: Thu Dec 12, 2013 4:42 pm

Re: XEffects - Reloaded - New Release (V 1.3)

Post by xyz »

I'm having weird issues with this on Linux.

If I compile it with Irrlicht 1.7.3:

Code: Select all

g++ example.cpp CShaderPre.cpp EffectHandler.cpp  -I ~/irrlicht-1.7.3/include/ -L ~/irrlicht-1.7.3/lib/Linux/ -lIrrlicht -lGL -lGLU -lXrandr -lXext -lX11 -lXxf86vm
and without any modifications to EffectCB.h then everything looks OK:

Image

If I change irr::u32 TexVar = 0; to irr::f32 TexVar = 0; then I get this:

Image

On Irrlicht 1.8.1 the results, however, are completely different.

Without any changes:
Image

After correcting u32 to f32:
Image ← only one light source

Is there anything I could do to fix this?
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: XEffects - Reloaded - New Release (V 1.3)

Post by robmar »

Best to use 1.7.3, more consistent!

1.9 really needs to be backwards compatible with 1.7.3. and have DX10 support with cube maps!

I´ve seen some neat and efficient (fast) shader techniques to handle shading without maxing out the CPU, but I guess that will be left to the experts!
Neomex
Posts: 3
Joined: Mon Oct 22, 2012 3:21 pm

Re: XEffects - Reloaded - New Release (V 1.3)

Post by Neomex »

Is it supposed to work with irr 1.8.1?

Did everything right( I think ) and don't see any results, tried all the provided hlsl files. (using dx9)
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: XEffects - Reloaded - New Release (V 1.3)

Post by robmar »

Try with 1.7.3. Truth is 1.8 has no real benefits and lots of problems
Rama112
Posts: 7
Joined: Mon Aug 18, 2014 7:08 am

Re: XEffects - Reloaded - New Release (V 1.3)

Post by Rama112 »

Hello All,

I'm also experiencing some 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 seems to separate 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_DIRECT3D9, 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 upon the car just before calling effect->update().

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 - Reloaded - New Release (V 1.3)

Post by Rama112 »

up! please!

thanks
johann_gambolputty
Posts: 28
Joined: Mon Nov 02, 2009 9:51 am

Re: XEffects - Reloaded - New Release (V 1.3)

Post by johann_gambolputty »

Hi .Is there a way to set the shadows color darker ? I'm using static lightmaps (EMT_LIGHTMAP) in combinations with XEffexts but the higher i set the ambient light , less the shadows are visible...

effect->setAmbientColor(irr::video::SColor(255, 180, 180, 180));

i'm satisfied with this color value , my scene , and all the models looks really cool , but unfortunately the shadows are almost invisible.
if i set the ambient color to a lower value the shadows are visible but the whole scene is totally dark. Is there a way to compensate this ? like render the shadows independetly of the ambient color ?

Thanks in advance !
Lee
Posts: 1
Joined: Wed Sep 03, 2014 6:50 am

Re: XEffects - Reloaded - New Release (V 1.3)

Post by Lee »

I finaly found what case the problem on irrlihct 1.8
CScreenQuad's Material doesn''t set the BlendOperation, so driver shut down the blend opertaion.
To fix this, just change codes in EffectHandler.cpp at line 350 from:
driver->setRenderTarget(ScreenQuad.rt[0], false, false);
ScreenQuad.getMaterial().setTexture(0, ScreenQuad.rt[1]);
ScreenQuad.getMaterial().MaterialType = (E_MATERIAL_TYPE)Simple;
ScreenQuad.render(driver);
To
driver->setRenderTarget(ScreenQuad.rt[0], false, false);
ScreenQuad.getMaterial().setTexture(0, ScreenQuad.rt[1]);
+ auto blendFunc = ScreenQuad.getMaterial().BlendOperation;
ScreenQuad.getMaterial().MaterialType = (E_MATERIAL_TYPE)Simple;
+ ScreenQuad.getMaterial().BlendOperation = EBO_ADD;
ScreenQuad.render(driver);
+ ScreenQuad.getMaterial().BlendOperation = blendFunc;
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Re: XEffects - Reloaded - New Release (V 1.3)

Post by BlindSide »

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

thank you for your help!
Yes, it seems that the shadow map is lagging a frame behind. It was not noticeable before I guess.

The reason this is difficult to fix is that the depth map rendering stage happens before "CSceneManager::drawAll()".

In "CSceneManager::drawAll()" the nodes get animated (Camera moves, car moves, etc). XEffects doesn't animate the nodes because we only want them animated once per frame, and it's not easy to disable animations when calling "CSceneManager::drawAll()".

This means that the depth map is always lagging behind the real scene by at least 1 frame.

The easiest way to fix this is to add a "bool animate" parameter to ISceneManager and CSceneManager drawAll, and disable animating if that is set to true (It's just a couple of lines you can wrap with an if statement). Infact I've hacked this into Irrlicht in the past for very similar reasons.

Once that is done, you will just need to call onAnimate() when you loop over the nodes in the depth pass inside XEffects.

Cheers,
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: XEffects - Reloaded - New Release (V 1.3)

Post by CuteAlien »

Yeah, allowing to split animation from rendering would be a good idea. I thought that as well in the past - adding a paramter to drawAll and maybe adding another function animateAll so the animation can also be done independent of the rendering (also sometimes useful). Or 2 flags or an enum so drawAll can do only animating.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: XEffects - Reloaded - New Release (V 1.3)

Post by mongoose7 »

I don't understand this at all. XEffects does not call CSceneManager::drawAll(). Also, XEffects calls OnAnimate() for each node, possibly multiple times.

Perhaps one fix might be to get the time at the top of update() and use this time in the calls to OnAnimate. Nodes should only animate again if the time changes. I know hybrid made some changes to the skinned-mesh animation so the nodes would not animate multiple times in the one frame, though this may have been frame-based, that is, skinned-mesh nodes would not animate more than once per frame. I guess this doesn't address the movement of nodes, but OnAnimate takes the current time, so it shouldn't animate twice if the time is the same?
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Re: XEffects - Reloaded - New Release (V 1.3)

Post by BlindSide »

Hey mongoose,

Ah I see. The problem is still the same as I mentioned, that the animations are happening in in drawAll() and then once again in XEffects. The timestamp idea is another solution.

Cheers,
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Post Reply