XEffects - Reloaded - New Release (V 1.4)

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Yeah technically it should work, you would need a modified depth shader that reads from a heightmap and offsets the pixel position along the normal based on the heightmap and texcoords and then recalculates the depth using that position. The parallax shader itself can stay the same.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
wildrj
Posts: 301
Joined: Thu Mar 23, 2006 12:49 am
Location: Texas/ Cyberspace
Contact:

Post by wildrj »

I Believe i found a bug in xEffects even though i haven't figured out how to solve it i thought maybe someone has. At a time i had XEffects running but then suddenly i started getting a access violation in this segment of code. Noticed that this if statement gets ran twice successfully before crashing..

Code: Select all

if(ShadowNodeArray[i].shadowMode != ESM_CAST)
{
//Specifically this line of code below.
ShadowNodeArray[i].node->getMaterial(m).MaterialType = (E_MATERIAL_TYPE)Solid[ShadowNodeArray[i].filterType];
	ShadowNodeArray[i].node->getMaterial(m).setTexture(0, currentShadowMapTexture);
	ShadowNodeArray[i].node->getMaterial(m).TextureLayer[0].BilinearFilter = false;
}
Any thoughts?
http://wild.deathtouchstudios.com << My gamedev blog
<Programming is a way of life>
If at first you don't succeed press the delete key till you do :)
FuzzYspo0N
Posts: 914
Joined: Fri Aug 03, 2007 12:43 pm
Location: South Africa
Contact:

Post by FuzzYspo0N »

seems like you might be adding a null node somewhere, ill test this but if you addShadowToNode on a null/messed node it will be causing the crash. Check all your variables for sanity and see if they arent broken.
wildrj
Posts: 301
Joined: Thu Mar 23, 2006 12:49 am
Location: Texas/ Cyberspace
Contact:

Post by wildrj »

FuzzYspoON you were right. irrb was exporting a bad irr file :/.. So it was loading null nodes.
http://wild.deathtouchstudios.com << My gamedev blog
<Programming is a way of life>
If at first you don't succeed press the delete key till you do :)
Skomakarn
Posts: 18
Joined: Mon Aug 03, 2009 1:03 pm

Post by Skomakarn »

I got the shader set up, and everything, and I had no problems thus far, but when I had written enough code to actually render my model out, it appears all blurry and weird.

I am using an old, crappy, badly modelled statue, just to test the lighting and shadows, and this is what I get:

Image

It looks smooth and unblurred with the standard Irrlicht shader, but it doesn't really suit my needs, so I would really like to get XEffects to work.

What might be the problem?
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

This is being looked into, for now try using a larger ScreenRTT value. Make sure it is not falling back to 512x512 like in the example code under AMD cards. Some users reported that using a resolution 1.5x larger than the screensize aided with this issue.

It is most likely caused by the misalignment of the screenquad texcoords with the screen's pixels (Or in your case it may just be a low ScreenRTT value, as it shouldn't look THAT bad).
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
FuzzYspo0N
Posts: 914
Joined: Fri Aug 03, 2007 12:43 pm
Location: South Africa
Contact:

Post by FuzzYspo0N »

One thing i noticed blindside, its got to do with the HBLUR and VBLUR shaders. If you take these out of the "stack" it should get clear, but then the other shaders that rely on the blur, wont be blurred.

I changed my pipeline to work differently, and it went away (but often you can get away with the blur etc)
Skomakarn
Posts: 18
Joined: Mon Aug 03, 2009 1:03 pm

Post by Skomakarn »

BlindSide wrote:This is being looked into, for now try using a larger ScreenRTT value. Make sure it is not falling back to 512x512 like in the example code under AMD cards. Some users reported that using a resolution 1.5x larger than the screensize aided with this issue.

It is most likely caused by the misalignment of the screenquad texcoords with the screen's pixels (Or in your case it may just be a low ScreenRTT value, as it shouldn't look THAT bad).
Here is how I create my EffectHandler:

Code: Select all

effectHandler = new EffectHandler(window,"plugins/shaders",videoDriver->getScreenSize(),roundedShadows);
Here is how I add my shadow and light:

Code: Select all

E_FILTER_TYPE filterType = (E_FILTER_TYPE)core::clamp<u32>((u32)8 - '1', 0, 4);
effectHandler->addShadowToNode(model,filterType);

Code: Select all

effectHandler->addShadowLight(SShadowLight(1024,vector3df(x,y,z),vector3df(0,2,0),SColor(0,255,255,255),0.0f,80.0f,radius));
Geomaster
Posts: 71
Joined: Tue Oct 21, 2008 3:39 pm

Post by Geomaster »

When I include XEffects, I get plenty of errors saying me that I don't have dimension2du specified. What's the problem? I'm using 1.5.1.

Thanks,
Geo.
wildrj
Posts: 301
Joined: Thu Mar 23, 2006 12:49 am
Location: Texas/ Cyberspace
Contact:

Post by wildrj »

You need the current svn.
http://wild.deathtouchstudios.com << My gamedev blog
<Programming is a way of life>
If at first you don't succeed press the delete key till you do :)
Skomakarn
Posts: 18
Joined: Mon Aug 03, 2009 1:03 pm

Post by Skomakarn »

Geomaster wrote:When I include XEffects, I get plenty of errors saying me that I don't have dimension2du specified. What's the problem? I'm using 1.5.1.

Thanks,
Geo.
Either you do a quick replacement of any occurence of dimension2du and change it to dimension2di, or you make a type definition, after loading Irrlicht, and before loading XEffects, like this:

Code: Select all

namespace irr
 {
    namespace core
     {
        typedef dimension2di dimension2du;
     }
 }
By the way, BlindSide, do you have any ideas, now that you see my code? Is it just my fault, or does it have to do with XEffects?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

We also have compile defines to check for the version since 1.5, so you can make an #ifdef and provide both versions.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Ok

Does this happen in the demo executables?

I took a screenshot of the demo here:
Image

I can see some aliasing on the viking's horn against the bright particle background but its not as bad as your image, it just looks like ordinary aliasing. What do you think? It may be a problem with the screen quad's position relative to the screen texels too, theres a D3D article about it here: http://drilian.com/category/development/graphics/d3d9/

Do you get bad results in both D3D and OpenGL?
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Skomakarn
Posts: 18
Joined: Mon Aug 03, 2009 1:03 pm

Post by Skomakarn »

I just get a segmentation fault when trying to get the video driver after creating the Irrlicht device with D3D (both 8 and 9, so is it just not installed?), so I can't try it out, it seems.

Here are two screenshots from the first example, running at the settings 123 (OpenGL, 1024, 8):

Image Image
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

I still can't tell, is the example as bad as your previous screenshot? It doesn't look quite as bad to my eyes, I'd like to hear your opinion though since you can see it in realtime. It's hard to tell in those shots.

Oh and very important, what video card is this? In another thread you mention a "NVIDIA Quadro FX 570M" so I'm guessing it's that, which rules out any ATI-specific issues (And boy are there a lot of those!).

I'm gonna look closer into this when I have time, which is pretty scarce these days.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Post Reply