XEffects - Reloaded - New Release (V 1.4)

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

Even more, with dual Paraboloids you can render half shadow map at a time, and render the other half in the next frame, doing a sort of "double buffering" The frame-frame coherency is very consistent, and can achieve quite fast results.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

BlindSide wrote:... Sun != point, Sun == directional because of it's enormous size in comparison to the earth...
More because of the huge distance that separate it from our us and the size of our movements (meaning the 2 sides of the triangles are so much longer than the third one, which is not relevant to the size of the sun).
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

Mel wrote:Even more, with dual Paraboloids you can render half shadow map at a time, and render the other half in the next frame, doing a sort of "double buffering" The frame-frame coherency is very consistent, and can achieve quite fast results.
I just have to be a bit cynical here. What you were looking to say is that he can amortize the cost of rendering a point light shadow map over the span of two frames. You'll feel really good about yourself the next time a situation arises where you can use the word amortize, trust me. :lol:
TheQuestion = 2B || !2B
Insomniacp
Posts: 288
Joined: Wed Apr 16, 2008 1:45 am
Contact:

Post by Insomniacp »

so I converted my sun to a directional light as mentioned. Though since my map is large i have to set the near and far values to be rather large, near is 4000 and far is 6000, this allows light to reach every part of the map as the sun moves across the sky. Though with those values I get very poor shadows created, they look like blobs if they even show up (usually when sun is setting/rising since the distance to where the shadow is is larger than when above? When the sun is directly above there is now shadow underneath any character as I was expecting. Another issue is at night, the sun shines through the ground and lights up my characters for some reason). I was wondering if there would be a way to fix that, I am using 4098x4098 shadow maps. Changing the PCF doesn't effect it but it is set to 4.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Firstly I hope that is a typo because 4098 is not a power of two. ;)
Though with those values I get very poor shadows created
The near and far values won't really affect the quality in that sense so much as the width/FOV would. For the directional light you have to set the FOV to change the width of the light area (It's not actually the FOV for directional lights, just the width/height in units). Imagine the directional light being a big square slab the width of the FOV you set in Irrlicht units.

I recommend having 2 shadow lights, one smaller one directly over the player near the camera and a slightly bigger lower quality one that encompasses a larger area. Because they are directional lights they will line up perfectly because there is no perspective involved.

PSSM and other frustum splitting/perspective skewing techniques are yet to come.

@Dual Paraboloid discussion: Don't forget this won't really work with low tessellated meshes, because DP warping has to be done in the vertex shader, in most cases you would have to tessellate all the geometry to get enough vertex resolution to warp it correctly.

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

Halifax wrote:
Mel wrote:Even more, with dual Paraboloids you can render half shadow map at a time, and render the other half in the next frame, doing a sort of "double buffering" The frame-frame coherency is very consistent, and can achieve quite fast results.
I just have to be a bit cynical here. What you were looking to say is that he can amortize the cost of rendering a point light shadow map over the span of two frames. You'll feel really good about yourself the next time a situation arises where you can use the word amortize, trust me. :lol:
My english is very bad, thanks for pointing this out.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Insomniacp
Posts: 288
Joined: Wed Apr 16, 2008 1:45 am
Contact:

Post by Insomniacp »

dunno if this is a bug or not but I don't remember seeing any info on it. I had a 1609x1609x10 box in blender with only the 6 sides and this caused the entire box to be black even when under lights. I had to subdivide the box a few times on the top in order for the lighting to work. I am not sure what would cause this issue unless it goes by size of the polygon and since it was too large it couldn't apply light to it. Anyways, just thought I would let you know.
3D Ace
Posts: 66
Joined: Sun Oct 04, 2009 8:47 am
Location: Swakopmund, Namibia
Contact:

Post by 3D Ace »

Recently I recompiled XEffectsR1.3 with the latest Irrlicht svn 1.7alpha revision 3052. It works perfectly without any code changes. However i noticed some kind of line/seam glitch in Example 2.
heres the Pic
Image
It seems to be some kind of texture seam problem(you need to look hard to spot it, its on the roof) the line also moves as the lights move.
Does anyone have any ideas?
Everything is possible, IF you know how.
Checkout my website for my upcoming game.(Currently on hold!)
http://www.projectbattle360.webege.com
Image
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

That's normal with Example 2, it's actually 6 lights stuck together to make a single point light. With some tweaking of the FOVs you could probably make them less noticeable but the recommended route is to just stick to spot and directional lights for now.

I've been a tad busy lately so I'm not sure if my shadow maps will make it into Irrlicht 1.7 (I would say they are about 40% done). When they do make it in I'll make sure to include proper point light shadows using either Dual Paraboloids, Virtual Cubemaps or possibly real cubemaps used only within the driver. Bear in mind that the shadow maps I'm putting in Irrlicht are a completely brand new implementation from scratch and may not share many similarities with XEffects.

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Insomniacp
Posts: 288
Joined: Wed Apr 16, 2008 1:45 am
Contact:

Post by Insomniacp »

Hey, is there a way to remove seeing through objects Like seeing the branches in this photo.
Image

I also had this issue with grass when I added it and when I switch from effect->update() to smgr->drawAll it looks like it should (grass is infront of the zombie and you cannot see through the leaves). I tried removing the XEffects shaders but that did not help. Could it be that the leaves and the grass use shaders and that conflicts with the lighting somehow? I am using procedural trees from http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=10909 and grass from Andres, http://andresjesse.com/images/files/tkg ... ode.tar.gz If you need more info let me know, its opengl, 4096 for shadow map and 4 PCF I believe.
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

which material type you're using? (for the leaves) try (edited)EMT_TRANSPARENT_ALPHA_CHANNEL_REF instead
Last edited by Virion on Sat Dec 19, 2009 4:08 am, edited 1 time in total.
Insomniacp
Posts: 288
Joined: Wed Apr 16, 2008 1:45 am
Contact:

Post by Insomniacp »

the leaves are using EMT_TRANSPARENT_ALPHA_CHANNEL_REF and the grass is using EMT_TRANSPARENT_ALPHA_CHANNEL. Switching between them doesn't change anything and the one you posted doesn't exist? I looked in api and the only place I could find it in the video namespace was

Code: Select all

EAAM_ALPHA_TO_COVERAGE 	Enhanced anti-aliasing for transparent materials.

Usually used with EMT_TRANSPARENT_ALPHA_REF and multisampling. 
But it wasn't in the list of material types either so I think it was dropped maybe or typo. Thanks for the help though.

PS the grass is not in the above screenshot ;)
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

sorry i meant EMT_TRANSPARENT_ALPHA_CHANNEL_REF... didn't have time to check the api doc. hmm thats weird
Insomniacp
Posts: 288
Joined: Wed Apr 16, 2008 1:45 am
Contact:

Post by Insomniacp »

I also noticed this when I turned on my irrphysx debug data, I everything would be about 60% transparent and hard to tell where anything was.

If I remove lighting from one of the trees it shows normal but if i put an object with lighting in the leaves it is visible through them. The leaves themselves aren't lit by xeffects as they are billboards and have their own lighting. I lied. If I remove lighting from an object it becomes partially transparent. I remember seeing a function to not light a node I will see if that helps.

EDIT: well I removed lighting both ways using the exclude funciton and the ESM_EXCLUDE when adding shadow to it. Both methods do the same thing I believe after quickly looking at the code. It does remove the transparency issue but it then (since they are billboards), makes the entire image and everything behind it completely lit. So it doesn't exclude it rather just sets it to full light and objects behind it don't get shadows. This is an issue because it looks quite bad a screenshot of it with the leaves excluded is below.

Image

You can see in the circled spots that the area behind the leaf billboard is completely lit. The top left circle is showing that there is no transparency issue though. You can also see some grass on the right side. It is hard to see since it is transparent.

Once again thanks for your help :)
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Hmm if you look at the particles in the first example they manage to stay full-lit without affecting stuff behind them. Does it work if the leaves use EMT_TRANSPARENT_ALPHA_CHANNEL (Non REF) and exclude them?

The shadowed area of the zombies shouldn't look that bad, the backside should be darkened so that those parts of the shadow are invisible. What sort of lighting are you using for the zombies? Also the normals look kinda strange are you using the MS3D version of the model?
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Post Reply