Page 22 of 56

Posted: Mon Jul 20, 2009 9:33 am
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.

Posted: Mon Jul 20, 2009 11:02 pm
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?

Posted: Mon Jul 20, 2009 11:12 pm
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.

Posted: Mon Jul 20, 2009 11:27 pm
by wildrj
FuzzYspoON you were right. irrb was exporting a bad irr file :/.. So it was loading null nodes.

Posted: Mon Aug 03, 2009 3:56 pm
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?

Posted: Mon Aug 03, 2009 4:11 pm
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).

Posted: Mon Aug 03, 2009 7:25 pm
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)

Posted: Mon Aug 03, 2009 7:44 pm
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));

Posted: Sat Aug 08, 2009 8:19 pm
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.

Posted: Sat Aug 08, 2009 9:13 pm
by wildrj
You need the current svn.

Posted: Mon Aug 10, 2009 10:41 am
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?

Posted: Mon Aug 10, 2009 1:41 pm
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.

Posted: Tue Aug 11, 2009 7:16 am
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?

Posted: Wed Aug 12, 2009 6:12 am
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

Posted: Wed Aug 12, 2009 6:46 am
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.