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

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

Post by BlindSide »

Yeah sorry that was a stupid typo I left in, and MSVC failed to detect it (Well maybe I should turn the warning level up...), I'll fix it and upload new sources.

@Scripter, hey your game looks awesome, I love Mechs and stuff, and your models are superb. It's really not that hard to add a few additional lightsources, but if you want an unlimited number you would have to switch to an additive system that does an additional pass for each light and blasts it on a non-clearing RTT.

First I need to know why you need several lights and what type of lights they are. For you game shadows I recommend just using one orthogonal camera to represent the sun. To add additonal lights just do an extra render to a different shadow map with a different camera, and pass the matrices of that camera alongside the first one in the shaders. Then copy paste the part that does the shadow calculation but make it use the other matrices and shadow map, its not that tricky. PM me if you run into trouble.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
jingquan
Posts: 222
Joined: Sun Aug 20, 2006 4:10 am
Contact:

Post by jingquan »

Hello Blindside,

About the SSAO you've gotten it to work, could you show me an output image of your eyepoint: float3 ep = depth*eyeray.xyz/eyeray.z; I think I'm doing mine wrong. Here's a screenshot: http://www.orandysoftware.com/user_files/eyepoint.jpg

My points: se = ep + ao_range * samples.xyz;
http://www.orandysoftware.com/user_files/se_ssao.jpg

I had found the ogre samples but they didn't worked either when I tried them.
Gonna try and debug it myself.
Last edited by jingquan on Fri Feb 15, 2008 11:49 am, edited 2 times in total.
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

Scripter only took his models from http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=24767

To show in his image gallery as only screenshots the complete listing of the pack he bought is kinda weak. It looks as if he's the one who made it, but it's not.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

You're right Dorth, I actually already had that suspicion since I've seen that model pack before, and I saw a striking similarity. But I guess I can't hold it against them. (If they have something to show for in the programming side, other than the art, that is).

EDIT: Hmm you're right the only screenshots are of the models and not even shown in Irrlicht (I think).

@jingquan: Oh your using the MAD method from Crysis to create a world space position using only the depth and a ray created from the screen quads normals. Thats an interesting method but I'm using a totally different one based on the one described by Ysanaya (The guy whos making Infinity), it involves just averaging the difference in depth values and scaling this figure (Around 50 times maybe), this value is then used as the occlusion factor. Its alot simpler than the crysis method and it doesnt suffer from nasty noise artifacts or problems. But the effect produced is also alot simpler. To get rid of objects occluding far away stuff I scaled the value based on the difference in depth (Again!), to result in a kind of parabola intensity, increasing with the difference in depth then decreasing again when this difference starts to get too high.

On other news, Ive just started working on virtual cubemapping. Im gonna make a demo soon similar to the Unreal3 engine video, the one with the lamp and the physics. If I get additive lightsources I can make it so that you can shoot out as many lamps as you want and they will all cast dynamic point light shadows. The cubemapping itself is coming along smoothly, Ive already succefully (More or less) projected the default irrlicht skybox onto a room in all 6 directions.

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
vectorcorpse
Posts: 86
Joined: Thu Feb 14, 2008 7:30 pm
Location: Portugal

Post by vectorcorpse »

ok, thx for the tips, i managed to to compile and run the example on linux, but i had to create a Makefile, change the includes .h to .cpp and cut off some lines of code, related to directx and the include windows.h with an axe, and now i don't know why the resulting problems are happening. the example runs, the scenario and chars are shown, and the moving shadows too, but 3 in 5 attempts to run the example gives out a segfault on a GF6200 le but not in a old radeon 9200 (but on this one the shadows don't work, can only see the scenario chars and lights, also it seams to run faster than on the GF, but probably because there are no shadows being drawn), the code appears to be extremly heavy on the graphics card when compared to the shadow code used on irrlicht example, and the shadows appear with wripples and on the corner columns there are spots near top and side that are not shaded and we can see the wripples on the contour of the shadow :/ strange.
btw, is it possible to only cast a shadow on the ground and other objects but not on the object that is projecting the shadow? ex: a char projects his shadow on the ground and on other objects or chars but not on himself like arms projecting on torso or face. that would be enough to look nice and yet light and probably would work with the shadow code used on the irrlicht example. adding only a simple blur. that way when combined with the code from this example when used on a game, the player could select some more levels of detail to be used if his hardware is the same has my laptop (p4 Prescott 32bit single core, with a radeon 9200 igp :( yuk) and still be able to enjoy some acceptable graphics.
if anyone want the modifications i made to the code or anything else regarding programing in linux feel free to ask, i'll help in what i can, since i stopped programing some years ago and only restarted recently.
jingquan
Posts: 222
Joined: Sun Aug 20, 2006 4:10 am
Contact:

Post by jingquan »

Cool. Even thought I've seen the name a few times I think I missed the paper. I'll check it out too and triple check my code again....

WAit, did I hear you mention pointlight, shadows and physics? That's incredibly UE3 cool! Can't wait for a demo.

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

Post by BlindSide »

vectorcorpse wrote:ok, thx for the tips, i managed to to compile and run the example on linux, but i had to create a Makefile, change the includes .h to .cpp and cut off some lines of code, related to directx and the include windows.h with an axe, and now i don't know why the resulting problems are happening. the example runs, the scenario and chars are shown, and the moving shadows too, but 3 in 5 attempts to run the example gives out a segfault on a GF6200 le but not in a old radeon 9200 (but on this one the shadows don't work, can only see the scenario chars and lights, also it seams to run faster than on the GF, but probably because there are no shadows being drawn), the code appears to be extremly heavy on the graphics card when compared to the shadow code used on irrlicht example, and the shadows appear with wripples and on the corner columns there are spots near top and side that are not shaded and we can see the wripples on the contour of the shadow :/ strange.
btw, is it possible to only cast a shadow on the ground and other objects but not on the object that is projecting the shadow? ex: a char projects his shadow on the ground and on other objects or chars but not on himself like arms projecting on torso or face. that would be enough to look nice and yet light and probably would work with the shadow code used on the irrlicht example. adding only a simple blur. that way when combined with the code from this example when used on a game, the player could select some more levels of detail to be used if his hardware is the same has my laptop (p4 Prescott 32bit single core, with a radeon 9200 igp :( yuk) and still be able to enjoy some acceptable graphics.
if anyone want the modifications i made to the code or anything else regarding programing in linux feel free to ask, i'll help in what i can, since i stopped programing some years ago and only restarted recently.
I used to own a 9200, It doesnt support pixel shaders in OpenGL in Irrlicht. There are some tricks around this but this basically requires mapping the pixel shader to the primitive ATI shader techniques. Doing this alone requires around 5000 lines of code, so I don't think anyones going to bother doing this for Irrlicht especially for an outdated video card.

You can do a very simple form of shadow mapping with an orthogonal camera in DX however, but it seems your a linux fan . :P

I'm not sure what the segfault is, but I'm sure its unrelated to my wrapper. Driver or compile configuration problems maybe? (You can try commenting out the line in CShaderPre.cpp with the "driver->getVendorInfo()", thats been known to sometimes cause issues on linux I think.).

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
vectorcorpse
Posts: 86
Joined: Thu Feb 14, 2008 7:30 pm
Location: Portugal

Post by vectorcorpse »

sorry. i managed to found the problem with the segfault, the driver->getVendorInfo() line is not even supported and i had it comented already, so that was not the problem, then i remember something, in the hurry to test the new tip i forgot to reboot to the generic kernel, i have 2 kernels, the generic one and a realtime kernel for audio creation and editing and for midi to wav rendering. the fast rt kernels are not so stable and have some issues with closed source drivers like the ones for the gf6200 i have on that computer and do not integrate well with the kernel.
Vsk
Posts: 343
Joined: Thu Sep 27, 2007 4:43 pm

Post by Vsk »

Bitplane, hybrind, someone, please put this features on the next irrlicht version! :D. (The license allows it right?)
Continue the great job BlindSide!.
vectorcorpse
Posts: 86
Joined: Thu Feb 14, 2008 7:30 pm
Location: Portugal

Post by vectorcorpse »

ok i'v now tested on 4 diferent computers (laptop 3.2 p4 32bit with ati 9200 igp and shared ram, laptop 3.2 turion 64 with gforce 7300 go with dedicated ram, desktop 3.4 athlon 64 with gforce 6200 le pci express and 3.0 athlon 64 with gforce 6200 le agp) in all of them i tested this demo and the tutorial example 08.specialfx from irrlich1.4 and the problem is similar. they both show a good shadow on the ground and other objects, but they both have problems on self projected shadow. the original irr shadow is not well spread and get cuted along the model and on this example it gets a triangular shape has in a saw wave on the edges and don't fill faces near the edges. (i have some screenshots but i don't have were to store them, ill try to get them somewere and then link them here) anyway, the problem seams to be only on vertical self casted shadows since they cast the shadows well on the walls and ground but when a wall is under it's own shadow it gets a fuzzy effect and some strips.
FuzzYspo0N
Posts: 914
Joined: Fri Aug 03, 2007 12:43 pm
Location: South Africa
Contact:

Post by FuzzYspo0N »

funny ebough we CANT see all the results you get and words fail you.

Where are your screenshots to aid in your conclusions?

Im sure blindside loves feedback but he needs to see too
vectorcorpse
Posts: 86
Joined: Thu Feb 14, 2008 7:30 pm
Location: Portugal

Post by vectorcorpse »

hey Mr. aggressive no need to be sarcastic as for the screenshots i do have a daughter and a life and has i told before (i have some screenshots but i don't have were to store them, ill try to get them somewere and then link them here) and has promissed i uploaded them to my company server (i only needed the time to do it) so here they are
Image
Image
Image
Last edited by vectorcorpse on Sun Feb 17, 2008 12:57 pm, edited 1 time in total.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Easy guys, no need for fighting.

Yeah those artifacts are common to all normal shadow maps, and they are more apparent when using a low shadow map resolution.

I recommend just using dynamic lighting (As you seem to have disabled it) to make the artifacts less apparent, or just disable self shadowing by excluding the level scene node from the depth pass.

Also it would be nice if you crop your screenshots to show only the Irrlicht screenshots, for your own privacy, and to keep the thread nice and tidy. Horizontal scrollbars are not nice.

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
vectorcorpse
Posts: 86
Joined: Thu Feb 14, 2008 7:30 pm
Location: Portugal

Post by vectorcorpse »

sorry for the ultra large screenshots, i was in a bit of a hurry at the moment, i'll have them cropped and compressed 1st thing tomorrow.
as for the dynamic lightning i don't recall disabling them... either i did accidentally or i have something wrong in my version of the code... it is possible that in linux and when compiling the irrlicht sources i got something wrong. anyway it is late, i'll double check it tomorrow both irr and the example i may had broke it when adjusting to be able to compile in linux after all i did have to remove the window.h and change some things in the code to be able to compile.
thx for the tips :D
vectorcorpse
Posts: 86
Joined: Thu Feb 14, 2008 7:30 pm
Location: Portugal

Post by vectorcorpse »

ok, i'v now fully tested the code and it is working fine.
Btw i am a linux user and fan but i am not a linux fanatic :P so i reshaped the xeffects package zip to be crossplatform (at least linux/unix and windows, sill trying to figure out how to include mac) and heres the link to it.
cross-xeffects
all u have to do is extract the xeffects folder to the examples folder on irrlicht sdk and type make or make all_linux to compile on linux, make all_win32 to compile on windows and make linuxtowin32 to compile a windows executable on a linux box, u wond get directx support with this method, ,only opengl (i dont even know if it is possible to get directx with this yet). this is a good solution for those with a small pocket like me that can't afford to pay 4000$ ok visual studio or 500$ for windows pro and still be able to develop for it :P

PS: u will need mingw32 to use make linuxtowin32
Post Reply