Jump to content


Photo

Springheel's Modular Building assets, 2.05


  • Please log in to reply
57 replies to this topic

#51 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1597 posts

Posted 06 October 2018 - 10:43 AM

 

Shadow Map–Friendly Geometry

Creating geometry that works well in shadow maps allows for more flexibility when combating artifacts like Peter Panning and shadow acne.

Hard edges are problematic for self-shadowing. The depth disparity near the tip of the edge is very small. Even a small offset can cause objects to lose their shadows.
Sharp edges cause artifacts stemming from low-depth disparity with offsets

Narrow objects such as walls should have backs even if they are never visible. This will increase the depth disparity.
 
It's also important to make sure that the direction the geometry is facing is correct; that is, the outside of an object should be back facing and the inside of an object should be front facing. This is important for rendering with back-face culling enabled, as well as for combating the effects of depth bias.

 

AFAIK, that's why we have shadows cast from backfaces to combat Peter Panning and shadow acne, the so-called Carmack's reverse.


Edited by Judith, 06 October 2018 - 10:45 AM.


#52 Skaruts

Skaruts

    Member

  • Member
  • PipPip
  • 242 posts

Posted 06 October 2018 - 11:02 AM

 
The engine requires the model to be triangulated, so that count on the striped image is really not accurate as the model is in quads
 

Well the triangle count is just quads * 2 plus any tris that already exist. I avoid n-gons, so at least in my case I think the count should be pretty accurate. 

 

EDIT: there are 6 triangles in that shadow model I had there (1 on each side of each rim), the rest is all quads, so that's (600 faces - 6 tris) * 2 = 1188 tris + 6 tris = 1194 tris

 

Thanks for the article on the shadow maps.


Edited by Skaruts, 06 October 2018 - 11:16 AM.

  • Judith likes this

#53 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1597 posts

Posted 06 October 2018 - 11:11 AM

Btw. "polygon count" in DR model browser is actually triangle count. And at least in max, you don't need to convert your model to editable mesh to have proper triangulation, exporter should handle this automatically.

#54 Skaruts

Skaruts

    Member

  • Member
  • PipPip
  • 242 posts

Posted 06 October 2018 - 11:21 AM

Even if shadow maps require back faces, since the nature of the engine requires that you place a brush behind walls to seal things up, doesn't that mean that brush itself will act as the backside of the wall model and so adding that extra geometry is useless anyway?

 

Or am I missing something?



#55 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 708 posts

Posted 06 October 2018 - 11:24 AM

AFAIK, that's why we have shadows cast from backfaces to combat Peter Panning and shadow acne, the so-called Carmack's reverse.

 
Does Carmack's Reverse has really any effect on shadow maps? I thought that was a trick to improve performance and also solve some stencil shadows artifacts only.  "Carmack's Reverse" is patented by Creative, if shadow maps needed that we would see more developers in trouble by Creative patent trolling like they did with idSoftware. 
 

Well the triangle count is just quads * 2 plus any tris that already exist. I avoid n-gons, so at least in my case I think the count should be pretty accurate. 
 
Thanks for the article on the shadow maps.

 
Ok don't really know about blender but in Modo, the tool i use the most the geometry count (GL count) changes, depending if a model is in quads or triangulated.
 
No problem.
 

Even if shadow maps require back faces, since the nature of the engine requires that you place a brush behind walls to seal things up, doesn't that mean that brush itself will act as the backside of the wall model and so adding that extra geometry is useless anyway?
 
Or am I missing something?


Afaik brushes are treated differently to mesh's, not when being lighted but at dmap time, so having a brush behind a flat mesh plane should have no effect for shadow casting, it does have for selling the void and also for the AI navigation.

 

But this should be easy to test.


Edited by HMart, 06 October 2018 - 11:28 AM.


#56 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1597 posts

Posted 06 October 2018 - 11:28 AM

You will need bsp to seal models against void and to have proper sound propagation with visportals. You will need to use caulk material for that. Caulk doesn't generate geometry or shadows.

https://modwiki.xnet.fi/Caulk

Edited by Judith, 06 October 2018 - 11:35 AM.

  • HMart likes this

#57 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37380 posts

Posted 06 October 2018 - 12:22 PM

You don't have to use caulk to seal rooms.  You can use brushes with a regular texture, and if you do, they will take care of shadows.  However, a lot of people do like to use caulk because it is see-through and doesn't obscure models if it should happen to clip through them.  That's why I generally did put backs on the wall modules.  That, and because it's also hard to select models in DR if there are no visible faces facing the camera.


TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#58 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 842 posts

Posted 14 October 2018 - 06:13 PM

There's a shadowcaulk material that does cast shadows. I ended up replacing a lot of regular caulk with it recently to fix some problems with light bleed.


Some things I'm repeatedly thinking about...

- louder scream when you're dying





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users