Debugging RB-D3-BFG (crashing on monster spawning)

Started by qModR, March 07, 2015, 06:59:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

motorsep

Quote from: BielBdeLuna on March 17, 2015, 03:00:35 PM
it's not a competition, it would be great to have this soft shadow bug sorted out.

It's a nature of shadow mapping. You can't fix easily it per se to fit all the cases. That's why most games have baked high quality lightmaps, and only characters cast dynamic shadows from sunlight (even indoors). In that case shadow map is fine tuned for characters only.

That's what separates indies working on their engines and AAA - amount of resources poured into solving non-trivial problems associated with rendering.

UE4 for example has several shadowing technique to combat all these issues you see with shadow maps in RBDoom 3.

I am sure it could be sorted out in a long run, with a lot of test cases and desire to do so by trebor (or availability of funds and qualified programmer on my side), and having variety of hardware on hands to test against.

And nowadays it's becoming increasingly hard to come by such programmers because everyone cares to use UE4 / Unity / CE / Source 2 (when it's out), and more advanced programmers all being taken into AAA companies to work on in-house engines (or to Crytek, Epic, Valve, Unity, idSoftware, etc.). Sad but true.

BielBdeLuna

#16
the world wouldn't be the same without the good old negative Motorsep  :))

Motorsep is this related to the issue you posted on thedarkmod forum?

motorsep

Quote from: BielBdeLuna on March 18, 2015, 02:16:47 PM
the world wouldn't be the same without the good old negative Motorsep  :))

I am just being a realist :)

Quote from: BielBdeLuna on March 18, 2015, 02:16:47 PMMotorsep is this related to the issue you posted on thedarkmod forum?

Not quite. My issue was associated with limited number of entities per area, which I solved with placing portals to split it into several areas (I don't know if this needs fixing, but splitting map is the easiest solution).

BielBdeLuna

Quote from: motorsep on March 18, 2015, 02:24:04 PM
Not quite. My issue was associated with limited number of entities per area, which I solved with placing portals to split it into several areas (I don't know if this needs fixing, but splitting map is the easiest solution).

I bet that in the long run it would be smart to have it sorted out in some sort of way independent of static dev-placed portals

but, anyway, going back then to the OP's issue, have you identified the root of the problem?

trebor

#19
I fixed the shadowmap bug. Shadowmaping has bias problems in every implementation.
However this one could be fixed easily by using a relative offset instead of a fixed offset for all content.

See here:

https://github.com/RobertBeckebans/RBDOOM-3-BFG/commit/319b65930294779823a93203cef3c4a76e154823
https://github.com/RobertBeckebans/RBDOOM-3-BFG/commit/395ef525b12a044d7e70a1fba57ca1de2f11c1e3

trebor

Try these binaries: https://dl.dropboxusercontent.com/u/22890478/RBDOOM-3-BFG/RBDOOM-3-BFG-1.0.3-win32-20150319-git-395ef52.7z

You can tweak the shadow bias to fight the shadow acne and peter panning with r_shadowMapSunDepthBiasScale or r_shadowMapRegularDepthBiasScale.

oneofthe8devilz

#21
Quote from: trebor on March 18, 2015, 08:45:08 PM
Try these binaries: https://dl.dropboxusercontent.com/u/22890478/RBDOOM-3-BFG/RBDOOM-3-BFG-1.0.3-win32-20150319-git-395ef52.7z

You can tweak the shadow bias to fight the shadow acne and peter panning with r_shadowMapSunDepthBiasScale or r_shadowMapRegularDepthBiasScale.

I can confirm that tweaking "r_shadowMapRegularDepthBiasScale" fixes the shadow mapping lightbleeding/bias issues in my "hooded character" test showcase...

(click the image for a high-res version)


(click the image for a high-res version)
I got six little friends and they all run faster than you ;)


Check out our mods at
moddb or the SPS Homepage

motorsep

@oneofthe8devilz: sounds like you can upgrade to RBDoom 3 BFG now ;)

motorsep

@trebor: good job! I wish my programmer fixed all these issues already :/

qModR

#24
Thank you trebor, that helps. I used values of 1 and 1.00044 for a comparison. 1.00044 is almost enough but going any higher makes all geometry black. This is what I could achieve with my assets:
screens.
Even at 1.00044 there are some issues.
Still, I'm wondering what's wrong with shadow-volumes. Is it my model or it's the engine itself that can't handle such complexity under given circumstances?
It would be great to have the option of working shadow-volumes.
-----------------------
Hm... Scratch that...
I just tested this same map in vanilla D3 - there are similar bugs with shadow-volumes. I think D3 doesn't like concave/multi-element geometry, as in self-shadowing...
Any thoughts (or facts) on this?
Is there a limit on number of entities per map in D3? I wonder if I could export every wall fragment of that maze as a separate model (or even brush).
Need to do some testing...

motorsep

Quote from: qModR on March 20, 2015, 04:36:01 PM
Thank you trebor, that helps. I used values of 1 and 1.00044 for a comparison. 1.00044 is almost enough but going any higher makes all geometry black. This is what I could achieve with my assets:
screens.
Even at 1.00044 there are some issues.
Still, I'm wondering what's wrong with shadow-volumes. Is it my model or it's the engine itself that can't handle such complexity under given circumstances?
It would be great to have the option of working shadow-volumes.
-----------------------
Hm... Scratch that...
I just tested this same map in vanilla D3 - there are similar bugs with shadow-volumes. I think D3 doesn't like concave/multi-element geometry, as in self-shadowing...
Any thoughts (or facts) on this?
Is there a limit on number of entities per map in D3? I wonder if I could export every wall fragment of that maze as a separate model (or even brush).
Need to do some testing...

I am not sure why would you have peter panning effect with shadow volumes :/ It shouldn't happen.

Shadow volumes have x3 more polygons than models, from what I recall. So, the more models and shadows, the more tris in the scene. With shadow maps you only have models tris as shadows don't have any. Also, shadow volumes are processed on CPU (partially). Shadow maps are purely on GPU.

4096 entities (everything that isn't brush is entity) is the limit. Could be extended, but back in the days I was explained that expanding this limit, we reduce limit for dynamic  entities (decals, brass, particles, etc.) Don't quote me on this, that's what I recall. Maybe trebor has a better idea about this.

qModR

I don't have peter panning with sh-vols. They're just corrupted, unusable with this type of assets. You can watch the last video to see what I mean.
Peter panning was happening with sh-maps. But with the fix that trebor provided it's almost perfect now.
I've read a bit on sh-vols and sh-maps and made a conclusion that sh-vols are not a good thing at all for a type of scenery I have in mind...
So yeah, sh-maps it is, from now on... Case closed I guess.

motorsep

@qModR:

Looking at your screenshots, some of them have extra crisp shadow maps with sun lights. What resolution do you have them at ? (shadow map settings)

qModR

The default I guess. I don't know any shadow settings in rbd3bfg, where are they? Some of my textures have scaling of 0.125 (8 pixels per unit, uni-dimensional) if that has anything to do with shadow-map quality.