Jump to content
The Dark Mod Forums

Value of Shadowmeshes


Springheel

Recommended Posts

It's easy to make a shadowmesh for an animated mesh, but it's not easy to make a *good* one. You have to make sure the shadowmesh doesn't stick out anywhere (otherwise it casts ugly shadows onto the visible mesh) both at rest AND while in motion.

 

I was getting a bit drained working on it, so I decided to confirm that it really was important.

 

I ran the following test in a cube room with two shadow-casting lights and 10 AI in motion.

 

With the shadowmesh on: 15 FPS.

 

With the shadowmesh turned off and the full mesh casting shadows: 9-10 FPS.

 

So yes, in case anyone else was wondering, the shadowmeshes are important. :blush:

Link to comment
Share on other sites

It's easy to make a shadowmesh for an animated mesh, but it's not easy to make a *good* one. You have to make sure the shadowmesh doesn't stick out anywhere (otherwise it casts ugly shadows onto the visible mesh) both at rest AND while in motion.

 

I was getting a bit drained working on it, so I decided to confirm that it really was important.

 

I ran the following test in a cube room with two shadow-casting lights and 10 AI in motion.

 

With the shadowmesh on: 15 FPS.

 

With the shadowmesh turned off and the full mesh casting shadows: 9-10 FPS.

 

So yes, in case anyone else was wondering, the shadowmeshes are important. :blush:

 

The shadowmesh should become even more important with complex environment, because every shadow casting polygon will be computed against every shadow-receiving polygon. Could you do a quick test (with maybe some complex models or just some duplicated patches/brushes) to see what the effect really is?

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

The shadowmesh should become even more important with complex environment, because every shadow casting polygon will be computed against every shadow-receiving polygon.

 

Shadow volumes are computed once for each light, the number of "receiving" polygons doesn't make any difference to the calculation.

 

A complex environment will of course generate more shadows, and be more expensive to render in itself, but shouldn't have any effect on the shadows which are falling on it.

Link to comment
Share on other sites

Shadow volumes are computed once for each light, the number of "receiving" polygons doesn't make any difference to the calculation.

 

A complex environment will of course generate more shadows, and be more expensive to render in itself, but shouldn't have any effect on the shadows which are falling on it.

 

But what if a shadow polygon falls on 1 vs. 3 polygons. Doesn't this make the shadow-casting process more complicated?

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

But what if a shadow polygon falls on 1 vs. 3 polygons. Doesn't this make the shadow-casting process more complicated?

 

No, because the algorithm does not involve calculating intersections between shadow volumes and rendered geometry; it is per-pixel, not per-vertex or per-poly.

 

Wikipedia has a reasonably good description of stencil shadows. Note how the shadow effect arises from rendering the shadow volume itself into the stencil buffer, and then using this buffer to test against the depth values of the final rendered scene to determine whether a given pixel is in shadow or not.

Link to comment
Share on other sites

No, because the algorithm does not involve calculating intersections between shadow volumes and rendered geometry; it is per-pixel, not per-vertex or per-poly.

 

Wikipedia has a reasonably good description of stencil shadows. Note how the shadow effect arises from rendering the shadow volume itself into the stencil buffer, and then using this buffer to test against the depth values of the final rendered scene to determine whether a given pixel is in shadow or not.

 

Ah thanx. So the amount of work in this technique (which is used in D3) is a per-light pass, and thus depends only on the shadow polygons and the screen resolution, not what is in shadow or not. (If I understood that correctly)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Ah thanx. So the amount of work in this technique (which is used in D3) is a per-light pass, and thus depends only on the shadow polygons and the screen resolution, not what is in shadow or not. (If I understood that correctly)

 

Yes, exactly. That is why light count and shadow-mesh complexity are so much more important than the polycount of rendered objects themselves.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • JackFarmer

      Somehow I admire the fact that the material from Dune has now been filmed for the third time. Personally, I could never do much with the material, but as a child of the 80s, I of course know the David Lynch movie...and that movie was at least funny!
      · 2 replies
    • Baal

      Episode 3 of the second best Doom 3 mod, Phobos,  was just released.
      · 5 replies
    • snatcher

      TDM Modpack v4.2 released!
      · 1 reply
    • The Black Arrow

      Hey @nbohr1morehow come the zombies in The Dark Mod don't have a "resurrection" mechanic to it, similar to how Thief has it?
      They're quite a weak creature as of right now, it's merely a walking corpse that slashes you, making attacking them to kill them an actual strategy.
      Would be better if they had some cool mechanism to it that truly makes them a danger, such as the resurrection idea itself.
      · 7 replies
    • Ansome

      Query: when was the last time a zombie in a video game was unnerving or scary to you? I'm chipping away at my anniversary submission and I've been trying to gather opinions on the subject. I'm perfectly capable of lighting them well, changing their sfx, and creating effective ambience, but I'm worried that zombies at their core are just too overdone to be an effective payoff to the tension I'm creating.
      · 14 replies
×
×
  • Create New...