Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: Problems with flat shadows.  (Read 4634 times)

0 Members and 1 Guest are viewing this topic.

ErV

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 54
  • I regret nothing!
    • View Profile
Problems with flat shadows.
« on: October 17, 2006, 10:38:23 PM »

Hello.
I've noticed that in certain situations flat shadows causes graphical artifacts.The model rendered to the texture simply doesn't fit in some cases. Because texture uses D3DTADDRESS_CLAMP, edges of texture, filled with non-transparent color, stretch to inifnity and make shadow look unrealistic. How can this be avoided?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Problems with flat shadows.
« Reply #1 on: October 19, 2006, 05:23:58 PM »

Well, it could be avoided 1) by using stencil shadows 2) by limiting the light position to certain ranges to avoid too long shadows.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

ErV

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 54
  • I regret nothing!
    • View Profile
Re: Problems with flat shadows.
« Reply #2 on: October 19, 2006, 09:29:40 PM »

Well, it could be avoided 1) by using stencil shadows 2) by limiting the light position to certain ranges to avoid too long shadows.
Well... problem isn't with long ranges, but with the certain angles/points of view. When the camera direction gets close to 45 degrees, sometimes part of model gets clipped by frustrum and stretches to infinity. Another problem is that flat shadows disappear when applied to a VERY large model. (Models gets clipped by ZFar, I suppose).

Right now I'm using stencil shadows, but they're 2times slowdown...

P.S. Why don't you use D3DPRESENTINTERVAL_IMMEDIATE? It would be a big speedup for a game. (what about 200 fps on Riva TNT?)
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Problems with flat shadows.
« Reply #3 on: October 20, 2006, 08:33:56 AM »

P.S. Why don't you use D3DPRESENTINTERVAL_IMMEDIATE? It would be a big speedup for a game. (what about 200 fps on Riva TNT?)
IMO that's not something a game should force the player into. At least it should be user-selectable.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

ErV

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 54
  • I regret nothing!
    • View Profile
Re: Problems with flat shadows.
« Reply #4 on: October 20, 2006, 11:24:36 AM »

P.S. Why don't you use D3DPRESENTINTERVAL_IMMEDIATE? It would be a big speedup for a game. (what about 200 fps on Riva TNT?)
IMO that's not something a game should force the player into. At least it should be user-selectable.
That's your choice.

But what can I do with disappearing shadows?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Problems with flat shadows.
« Reply #5 on: October 20, 2006, 02:42:59 PM »

Ok, try this: http://dead-code.org/download/wme_latest.zip

I removed the infinite clamping, increased the far clipping for shadow projection and fixed the disabled light loading from 3ds.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

ErV

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 54
  • I regret nothing!
    • View Profile
Re: Problems with flat shadows.
« Reply #6 on: October 20, 2006, 08:01:39 PM »

Ok, try this: http://dead-code.org/download/wme_latest.zip

I removed the infinite clamping, increased the far clipping for shadow projection and fixed the disabled light loading from 3ds.
You mean - zFar/zNear for shadow renderer is static? And, maybe FOV, too? Wouldn't be better to change zFar, zNear and FOV for rendering shadows dynamically, based on character bounding box/distance from light? (Calculations are quite easy) It would solve model clipping problem. What do you think?
Logged
 

Page created in 0.021 seconds with 24 queries.