Page 54 of 56

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

Posted: Mon Jun 22, 2015 9:59 pm
by Harch
Somebody repaired xEffects? What about other approaches?

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

Posted: Tue Jun 23, 2015 12:54 am
by christianclavet
Hi, This is Nadro answer about the transparency problem:
This is the best solution to handle alpha + shaders with Irrlicht from SVN:
- Use standard SOLID material as a base material.
- Set SMaterial::BlendOperation to EBO_ADD;
- Set SMaterial::BlendFactor to pack_textureBlendFunc(EBF_SRC_ALPHA, EBF_ONE_MINUS_SRC_ALPHA);
With this solution you don't need separate materialType for solid and transparent shaders, you can just change SMaterial::BlendFactor, however old solution should works too.
You can check this thread. Where I reported the problem.
http://irrlicht.sourceforge.net/forum/v ... =7&t=50805

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

Posted: Tue Jun 23, 2015 11:41 am
by Harch
I do so. It turned out that all the shadows drawn EXCEPT the shadow from a cube with an alpha channel. I would like to and from the shadows drawn. So, I could not just the cube add processing shadows ... But I want to see the shadow, and from the letters of the cube.

Give a link to the thread, please. Because the old solution does not work. I will write to it...

Code:

Code: Select all

 
cube->getMaterial(0).MaterialType = video::EMT_SOLID;
    cube->getMaterial(0).BlendOperation = EBO_ADD;
    cube->getMaterial(0).BlendFactor = pack_textureBlendFunc(EBF_SRC_ALPHA, EBF_ONE_MINUS_SRC_ALPHA);
    effect->addShadowToNode(cube, filterType, ESM_CAST);
 

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

Posted: Wed Aug 05, 2015 10:20 am
by mongoose7
Harch wrote:While mongoose7 is preparing an example may be someone who understands the shaders, look, why xEffects not work with a transparent material, please?
Done: http://irrlicht.sourceforge.net/forum/v ... 36#p294636

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

Posted: Mon Aug 10, 2015 10:19 am
by mongoose7
Harch wrote:Somebody repaired xEffects? What about other approaches?
Hmm, I don't know that XEffects is broken.

Image

I'm actually not convinced that you have fixed EffectCB.h as previously suggested. That is, change

Code: Select all

irr::u32 TexVar = 0;
to

Code: Select all

irr::s32 TexVar = 0;
and change

Code: Select all

((irr:f32 *)&TexVar)
to

Code: Select all

&TexVar
Note that the screenshot was taken with Irrlicht Trunk. I tried with 1.8.1 and could only get one light to show (green) but there was no trouble with the transparent cube. Is there a problem with TRANSPARENT_ADD_COLOR in 1.8.1? This is what XEffects uses to combine the lighting passes.

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

Posted: Mon Sep 07, 2015 3:32 am
by BlindSide
Good question Mongoose. If someone wants to share an updated package, I can put the link on the main page. Or perhaps I can chuck it on github and link to that? I'm surprised people are still using this to be honest.

Cheers,

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

Posted: Mon Sep 07, 2015 4:05 am
by BlindSide
Hi all, I've updated the first post to link to the new github page and fixed the TexVar issue while I'm at it. :D

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

Posted: Mon Sep 07, 2015 9:23 am
by CuteAlien
Yay, BlindSide is back!

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

Posted: Tue Sep 08, 2015 7:01 am
by Harch
Mongoose7, is this OpenGL or DirectX? In DirectX all is OK, but in OpenGL shadows from transparent objects (ALPHA_CHANNEL_REF) don't work.

My irrlicht is Irrlicht 1.8.1 (not latest build 1.9).

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

Posted: Tue Sep 08, 2015 3:37 pm
by mongoose7
You have to use 'trunk'. There appears to be a problem with 1.8.1. Fixes in trunk are not back-ported.

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

Posted: Wed Sep 16, 2015 8:34 pm
by Harch
I'll try that, thanks.

I will write when checking this.

P.S. Please give me a link to "trunk".

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

Posted: Wed Sep 16, 2015 9:53 pm
by CuteAlien
Link to trunk: http://sourceforge.net/p/irrlicht/code/HEAD/tree/
You will need a svn client to download it (on Windows people mostly use TortoiseSVN).

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

Posted: Thu Sep 17, 2015 1:47 am
by mongoose7
You can download a ZIP file ("Download snapshot").

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

Posted: Fri Sep 18, 2015 7:31 pm
by Harch
I downloaded a last irrlicht trunk. And also I downloaded the xEffects from the first post. I compiled Irrlicht in release-fast-math-dll(and accurate-math too) mode (Code::Blocks). I included xEffects. I compiled this. And I get the same error: with a transparent cube shadows is no all, but without a transparent cube all is works (with OpenGL driver).

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

Posted: Sat Aug 19, 2017 1:12 pm
by kilbith
Hello, Irrlicht newbie here.

I'm trying to add shadow mapping to a large mesh (a whole voxel terrain). But all I'm getting is some large "blinking" squarred shadows over the terrain. A screenshot explains better : http://imgur.com/MGWHgmf

Here is a code snippet :

Code: Select all

 
EffectHandler *effect = &(*(new PostProcess(device, driver))->m_effect);
 
effect->addPostProcessingEffectFromFile(core::stringc("client/shaders/postprocessing/BlurHP.glsl"));
effect->addPostProcessingEffectFromFile(core::stringc("client/shaders/postprocessing/BlurVP.glsl"));    
effect->addPostProcessingEffectFromFile(core::stringc("client/shaders/postprocessing/BloomP.glsl"));
 
scene::ISceneNode *m_map = smgr->getSceneNodeFromId(666);
 
m_map->setMaterialFlag(video::EMF_LIGHTING, false);
 
E_FILTER_TYPE filterType = (E_FILTER_TYPE)4;
effect->addShadowToNode(m_map, filterType, ESM_BOTH);
 
effect->addShadowLight(SShadowLight(512, v3f(-150, 500, -150), v3f(5, 0, 5), 
    video::SColor(255, 255, 255, 255), 20.0f, 60.0f, 30.0f * core::DEGTORAD));
 
What I'm doing wrong ?