XEffects - (Indoor Soft-Shadows + Post-Processing)

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 »

Probably a bug with Irrlicht. There is nothing in my code that relies on anti-aliasing code or has anything to do with it.

Probably best to file a bug report in the bug reports forum concerning Anti-Aliasing + HLSL Shaders.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

i played around with the demo, looks good.

tested on a radeon 9550 card.

i'll try putting up a demo of my mesh models with some pre-built shader fx files later. see if it is possible to include a solution to the shadow artifacts. gpugems3 has one chapter in book showing an algorithm on improving shadowing.

if this works, my workflow will definitely improve as i'm trying to move into cg shading more than anything.

thanks for posting the package, it looks awesome for shading development.

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

Post by BlindSide »

I've improved the shadow algorithm a bit, the edges are much smoother now.

Here is a shot from the old technique (For comparison): (Doing 32 fps)
Image

And this is the new technique: (Doing 37 fps)
Image

Notice there is no pixelation no matter how close you get. This is because the shader emulates bilinear filtering.

I may (If I am not too lazy these holidays hehe), release a demo showcasing this and some other features (Such as 32-bit depth packing, which eliminates the ugly cutoff of the shadow near the models feet that is apparent in this demo, due to only 8 bit precision.).

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Vsk
Posts: 343
Joined: Thu Sep 27, 2007 4:43 pm

Post by Vsk »

This is amazing, but I wonder, why this is not integrated on irrlicht 1.4.
I think lisence allows it.
This would be a wonderfull incorporation at leat for 1.5 wouldn't?
This kinda of thing is what make difference between qualiti engines.
Beside it is simple to use so it will be acomplish with irrlicht filosophie
:wink:

I hope niko take it in count.
Vsk
Posts: 343
Joined: Thu Sep 27, 2007 4:43 pm

Post by Vsk »

umm gotta problems :(.

I read the readme file, change up an down maxdistance but nothing (or almost nothing):
First at all on my project I get the ground all yellow ????? (Just like the one who put a picture with the gournd all RED but mine put it sefl yellos???.

So I try you example.
I works fine, so try to scracht it to know which is the problem.
So I began to imititate my game conditions.
The first thing I have a large terrain scale (370).
So I enlarge the terrain fromo your example * 40 just to try and there were no shadow or much artefacts.
So I try changin values from maxdistance but i found some little better but still very-very artefact.

What else could I touch? do the rezize make imposible use the shadow mappp??
Any idea.
Thanks and greta contribution (As I said in las post).
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

What video card do you have?

What shadow map resolution are you using?

It is probably best to not apply shadow map over entire terrain area, but make it follow the camera around so that objects near the camera recieve shadows. This is best for both quality and performance.

Are you using OGL or DX?
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Vsk
Posts: 343
Joined: Thu Sep 27, 2007 4:43 pm

Post by Vsk »

Oops sorry about the little details.
Am using Dx, all your old examples works fine (except if choose the higher resolution map).
As I told you the problem began when for example I change your example terrain scale. If I no change it, your example works fine.
So the problem is the scale change. And then I didn't find any valud of max distance that can fixed.
How do I do what you said about only shadow the near camera area?
I have a Nvidia 7300 LE.

I think I have the same problem that has the one wicht his terrain get red coloured, well mine is yellow colored :? .

Thanks again and any suggestion will be helpfull.
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

BlindSide,
this is good work! :)

I tried examples (compiled by you) and on my RadeonX200M it works fine (opengl and direct3d9).

but i cannot make it working in my scene :(
i'm getting some errors in console:
alot of
HLSL pixel shader compilation failed:
error X3539: ps_1_x is no longer supported; use /Gec in fxc to automatically upgrade to ps_2_0
error X3539: Alternately, fxc's /LD option allows use of the old compiler DLL
and this
First-chance exception at 0x7c81eb33 in MyProject3D.exe: Microsoft C++ exception: long at memory location 0x0012fc58..
and this
Error: Tried to set a render target texture which is bigger than the screen.
this is all at runtime goes into console, the programs is runs OK but no shadows is visible.

What is the problem?


and another question:
i'm trying to add same caster and receiver like this:

Code: Select all

g_effect->addShadowToNode(world, EFT_NONE);
g_effect->addNodeToDepthPass(world);
is this OK?


Thank You!
Vsk
Posts: 343
Joined: Thu Sep 27, 2007 4:43 pm

Post by Vsk »

I also receive the error of "more render area than..." if I set for a huge mapping, but THIS IS NOT my problem because I have not this problem with smaller map but anyway have no showdow. (Well I have "something")
greenya:
Did you try with smaller mapps resollutions?
Did you try with changin your game scale (this one can help you a little).

Any suggestion for both of us?

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

Post by BlindSide »

Sorry guys for the delay, I was on holiday to the south island :P
greenya wrote:BlindSide,
this is good work! :)

I tried examples (compiled by you) and on my RadeonX200M it works fine (opengl and direct3d9).

but i cannot make it working in my scene :(
i'm getting some errors in console:
alot of
HLSL pixel shader compilation failed:
error X3539: ps_1_x is no longer supported; use /Gec in fxc to automatically upgrade to ps_2_0
error X3539: Alternately, fxc's /LD option allows use of the old compiler DLL
and this
First-chance exception at 0x7c81eb33 in MyProject3D.exe: Microsoft C++ exception: long at memory location 0x0012fc58..
and this
Error: Tried to set a render target texture which is bigger than the screen.
this is all at runtime goes into console, the programs is runs OK but no shadows is visible.

What is the problem?


and another question:
i'm trying to add same caster and receiver like this:

Code: Select all

g_effect->addShadowToNode(world, EFT_NONE);
g_effect->addNodeToDepthPass(world);
is this OK?


Thank You!
This is simple, you are using a too new version of DX which abandoned PS1_X support, so use a shader that is PS2.0+, an easy way is to just add some filtering, eg by using EFT_4PCF (Or was it EFT_PCF4 ?), this should fix that error.

The other problem is that the shadow map resolution you have selected is too large, in Irrlicht, DX RTT cant be bigger than the screen, so use OpenGL or wait till Irrlicht supports large RTT for DX (There are also some patches you can use).

For the runtime error, this probably has nothing to do with the shadows, but if you can use a debugger and tell me what line it crashes on, then maybe I can be of some assistance ;).
I also receive the error of "more render area than..." if I set for a huge mapping, but THIS IS NOT my problem because I have not this problem with smaller map but anyway have no showdow. (Well I have "something")
greenya:
Did you try with smaller mapps resollutions?
Did you try with changin your game scale (this one can help you a little).

Any suggestion for both of us?

Thanks
How large did you make the terrain? The shaders I have now are bad because they divide by the W coord in the Vertex shader, I did this for speed and compatibility to old shader models before, but it relies upon the vertices for the division and in models where the vertices are spread far apart or complex models this can make the shadows appear skewed, so enlarging the terrain too much can have undesired effects if you end up having low detail with vertices spread apart.

I can fix this in the shaders quickly (And maybe also clean up the design of the shadow wrapper, as it is very messy if you look at the code inside). I will get around to this maybe tomorrow or sometime this week.

How is your "light camera" positioned? Also, a screenshot would help.

Thanks :D
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

BlindSide wrote: This is simple, you are using a too new version of DX which abandoned PS1_X support, so use a shader that is PS2.0+, an easy way is to just add some filtering, eg by using EFT_4PCF (Or was it EFT_PCF4 ?), this should fix that error.

The other problem is that the shadow map resolution you have selected is too large, in Irrlicht, DX RTT cant be bigger than the screen, so use OpenGL or wait till Irrlicht supports large RTT for DX (There are also some patches you can use).

For the runtime error, this probably has nothing to do with the shadows, but if you can use a debugger and tell me what line it crashes on, then maybe I can be of some assistance ;).
thanks for the comment.

1) i used EFT_NONE
2) i used 512 x 512 resolution (as i remember)
3) the runtime errors i have shown -- is just prints into irrlicht console but the app doesn't crashes. it run OK but i do not see shadows. (the errors prints into console simillar to "mesh must be tangents type" or "texture foo.jpg couldnt be loaded" -- this errors just a notices and do not crashes the app..... so as do the errors i provided above).
Vsk
Posts: 343
Joined: Thu Sep 27, 2007 4:43 pm

Post by Vsk »

BlindSide wrote: How large did you make the terrain? The shaders I have now are bad because they divide by the W coord in the Vertex shader, I did this for speed and compatibility to old shader models before, but it relies upon the vertices for the division and in models where the vertices are spread far apart or complex models this can make the shadows appear skewed, so enlarging the terrain too much can have undesired effects if you end up having low detail with vertices spread apart.

I can fix this in the shaders quickly (And maybe also clean up the design of the shadow wrapper, as it is very messy if you look at the code inside). I will get around to this maybe tomorrow or sometime this week.

How is your "light camera" positioned? Also, a screenshot would help.

Thanks :D
Yes, indeed my terrain is very large scaled about a 126 pixel hightmap loaded with the terrain irrlicht loader scaled * 396. So in fact vertices stay very apart .. so ¿could be this the problem?.
If there a way to solve this? (without smalling the terrain?)
I'll try to post an image soon.
Thanks.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

@ greenya:
Try using EFT_PCF4 filtering like I said, it may help with the "PS1_X" error. Do you mind trying in OpenGL? There should be no problems there.

@ Vsk:
Yeah there is a way to fix it easily, just give me a few days and I'll have it fixed in the wrapper. Ill post here and upload a new one when Im done.

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Vsk
Posts: 343
Joined: Thu Sep 27, 2007 4:43 pm

Post by Vsk »

BlindSide wrote:
@ Vsk:
Yeah there is a way to fix it easily, just give me a few days and I'll have it fixed in the wrapper. Ill post here and upload a new one when Im done.

Cheers
thank you very much :D.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Big update, check out first post.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Post Reply