Page 41 of 56

Posted: Fri Aug 20, 2010 9:17 pm
by roelor
I got some problems, it compiles just fine (for one reason or another) but it just shuts down if I open it. it opens, rendering window stays white, then I get a message "this program has stopped working". And I am forced to exit it, Ive tryed multiple dll's now to no avail. I allways have compiler issues so I am afraid compiling the irrlicht dll is out of the question. (Im allways stuck learning more of c++ because of compiler failure or "outdated" examples. but this time, it just stops working)

the precompiled examples work, but as soon as you swap the dll, they die. I tried a dll in this topic aswell, to no avail. (if I use the dll in this topic with the precompiled ones, they crash too)

Im using irrlicht 1.7.1, do you reccomend going back to an older version of irrlicht?

I hope I am being a good n00b (even after all these years here, still struggeling with compiling issues...)

Edit:
Ive tried using irrlight 1.6x same issue.

Posted: Sat Aug 21, 2010 11:49 pm
by AW111
What are the geometry limits of XEffects' lighting and shadowing? Fairly small meshes work fine, but when I add my own custom (procedurally-generated) terrain mesh using addShadowToNode(), I get a run-time error which says something like "Cannot load file: "XEffects_SM_1024". But it works fine when I add the same terrain mesh to the water effect using addNodeToDepthPass().
I assume that the problem is caused by the fact that shadowing (unlike the water effect) needs a shadowmap scaled to the size of the terrain mesh, and my terrain mesh is enormous both in terms of the number of polys and the size of each poly. I'll eventually put in a LOD method to scale down the distant portions of it, but that would only reduce the number of polys, not the 'scale' of the mesh since the more distant 'sectors' would still need to cover the same total size in order to fit correctly against the closer sectors. The author of "Infinity" solved a similar problem by using several shadow maps with different resolutions depending on distance. I think my situation is simpler and perhaps could be solved by only shadowing the nearest sector(s) and manually shading the distant sectors based on the slope of the terrain. But I suspect this might not work seamlessly.
I'm hoping someone can give me an idea of what the size limits are ? How do I use XEffects to create a sun with a large-scale reach over a vast terrain which has different levels of detail? Would it work just to reduce the size of each poly?

Posted: Sun Aug 22, 2010 12:16 am
by stefbuet
This is called cascaded shadow maps or Parallel-Split Shadow Maps, and it's not implemented in XEffect. If you want better quality, you can either use bigger RTT for shadow maps, and if possible reduce camera far Z as possible.

Posted: Sun Aug 22, 2010 12:23 am
by AW111
stefbuet wrote:This is called cascaded shadow maps or Parallel-Split Shadow Maps, and it's not implemented in XEffect. If you want better quality, you can either use bigger RTT for shadow maps, and if possible reduce camera far Z as possible.
Well, what about my idea of only shadowing the nearest sector (which is probably all I need for real-time shadows cast by trees, buildings, etc), and only approximating the terrain shading for more distant sectors - i.e., a hill will be shaded based on the slope of each poly, and will cast a shadow which is easy to "fake" just by using a very course-grained, simple version of raytracing and then changing the shade color for those polys (or vertices) which would be in shadow. Since terrain shadows would only change slowly as the sun moves across the sky, this type of crude shadowing wouldn't need to be recalculated very often.
The chief problem, I think, would be getting both methods to work seamlessly so that there isn't a jarring difference between terrain sectors.

Posted: Mon Aug 23, 2010 9:13 pm
by AW111
After further testing, I found that XEffects' shadowing does actually work even on a mammoth terrain mesh - I had previously made the mistake of trying to add my terrain using addShadowToNode after I had dropped the reference to my terrain node. :oops: Some tutorials recommend dropping the reference right after setting up the node, and I forgot that my code was doing that.
Once this foolish mistake was fixed, it works extremely well even with over a million polys. And it runs relatively quickly even on my machine.

Posted: Wed Aug 25, 2010 12:49 am
by stefbuet
Oh! Nooo! I failed :(
I wanted to do :
1 depth pass from cam
for each light {
1 depth from light
compare with cam depth post process
}

However this can only work if depths are computed in camera view space, else depth pass from cam have to be done everytime. But, it NEED to be in light space to be able to compare correctly depths (I was doing if (abs(lightDepth-camDepth)>0.001) { ...). I've managed to get some shadows with my patern but It contain lot of artefacts, too bad! I'm now going to switch to your method : 2 pass per light :(

Posted: Fri Aug 27, 2010 12:30 pm
by sylpheed
I've been using XEffects for this week and it's a very nice addon for Irrlicht, congratulations BlindSide :wink:

It helped me a lot for creating real Ambient Occlussion, shadow maps are really easy to manage with XEffects. I only have a little "problem". If bloom and blur effects are disabled aliasing is very present when using shadow mapping (obviously, it's due to render to texture problem). I need an antialias filter for the final image. In the past, I used OpenGL EXT functions to multisample final texture image, but now I'm in Irrlicht so I'm not able to use that. Please, could anyone help me please? I desperate need to remove that disgusting aliasing.

Thanks in advance!

Posted: Fri Aug 27, 2010 2:07 pm
by BlindSide
Did you see the VSM shadow demo? It can help a lot with that.

If that doesn't help then it would need to be extended with techniques like PSSM, there are some examples around but it can be quite tricky to implement.

Posted: Mon Aug 30, 2010 7:35 am
by sylpheed
BlindSide wrote:Did you see the VSM shadow demo? It can help a lot with that.

If that doesn't help then it would need to be extended with techniques like PSSM, there are some examples around but it can be quite tricky to implement.
Thanks for posting and help BlindSide :D . VSM shadow is great, but it only blur shadows, I need antialias for whole scene. My app is not running in fullscreen mode, so antialias is not applied in render to texture by default. Sorry for my English, it's not very good :(

Posted: Tue Aug 31, 2010 4:51 pm
by milkshakeman
I can't say when Irrlicht 1.8 will be released but personally I plan to have a test shadow map system integrated around July.
BlindSide, I don't know if it is the right place for my question, but is there already some kind of test, demo or screenshot from the shadow map system you are making for the 1.8 release?

Posted: Mon Sep 06, 2010 1:19 am
by AW111
I've been trying to get my "sun" to cast bluish shadows as in real life - that's why shadows on a white wall (or snow etc) appear almost blue rather than gray. As far as I can tell, XEffects will produce this shadow color only if you tint the light bluish, or perhaps add a second light which is mostly blue. The problem, of course, is that actual sunlight has a yellow tint to it.
What's the best way to solve this problem?

Posted: Mon Sep 06, 2010 6:27 am
by BlindSide
AW111 wrote:I've been trying to get my "sun" to cast bluish shadows as in real life - that's why shadows on a white wall (or snow etc) appear almost blue rather than gray. As far as I can tell, XEffects will produce this shadow color only if you tint the light bluish, or perhaps add a second light which is mostly blue. The problem, of course, is that actual sunlight has a yellow tint to it.
What's the best way to solve this problem?
You should probably add a bluish ambient lighting. You can set the ambient light color directly through the xeffects wrapper.

Posted: Mon Sep 06, 2010 6:13 pm
by AW111
BlindSide wrote:
AW111 wrote:I've been trying to get my "sun" to cast bluish shadows as in real life - that's why shadows on a white wall (or snow etc) appear almost blue rather than gray. As far as I can tell, XEffects will produce this shadow color only if you tint the light bluish, or perhaps add a second light which is mostly blue. The problem, of course, is that actual sunlight has a yellow tint to it.
What's the best way to solve this problem?
You should probably add a bluish ambient lighting. You can set the ambient light color directly through the xeffects wrapper.
Won't that tint the entire geometry, rather than just the shadows?
It occurred to me today that the reason some shadows are bluish in real life is because certain materials are reflective enough to take on the color of the sky in areas where there isn't any strong light to provide a different color - that must be why snow and smooth white walls often have blue shadows, but most other materials do not. I was looking closely at shadows today, and most of them are gray unless there is something to cause reflected light to color the shadow.
I suppose it's not a big enough deal to worry about... but it would add a degree of realism for winter scenes or white buildings.
How feasible would it be to modify the shadow code to add a bluish tint to shadows on certain textures?

Posted: Wed Sep 15, 2010 9:37 am
by Amaroker
I'm a beginner, but just like sylpheed I have problem with aliasing. I'm trying to render a simple cube and it looks fine when I use drawAll(), but with effect->update() the smoothness is gone. That is, the shadows are smooth but not the cube itself.

Here's an example: http://irrlichtirc.g0dsoft.com/BlindSide/inshad5.JPG . Extra noticeable at the far wall and cubes, the edges are very jagged).

Is there a simple solution?

Posted: Wed Sep 15, 2010 2:20 pm
by sudi
i bet thats bc he renders the scene to an RTT for postprocess effects. Unfortunatly there is no fix bc RTTs don't support hardware aliasing. To fix it you have to write a AntiAlias postprocess effect.