self shadowing

honkFactory
Unregistered
 
Post: #1
Howdy,
I am working with a shape defined by triangles and I was wondering what the best method would be for have such a shape cast shadows on itself. I know this is not a trivial subject and have read some of other posts on the subject, but if anybody thinks they have the definite answer, I'm all ears. I;m not sure if adding shadows to the shapes rendered here is really warth the effort but I'm curios as to how it would be done. Thanks.
A.W.
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #2
There is an apple example on this, where a rotating cross shadows itself and some other objects, but I can't recall the name. Or maybe it was at nehe.gamedev.net .

To be honest, I think you are having far too many triangles on that asteroid for self-shadowing to be effective, and there is no need for it on the sphere.

- D.G
Quote this message in a reply
w_reade
Unregistered
 
Post: #3
I don't know anything about self-shadowing, so I can't actually help, but I do have an opinion.

IMO, an asteroid is the perfect shape for dramatic self-shadowing - you could get some lovely rushes of shadow across the surface as it spins - but it's probably not worth bothering with unless your asteroids are going to be big enough that people'll actually notice.
Quote this message in a reply
honkFactory
Unregistered
 
Post: #4
Yes, I agree that there are probably too many triangles on the asteroid for shadowing to be efficient, but I could prerender the asteroid to a texture before a level since the game I am working on is essentially 2D.
Then nehe lighting example uses the stencil buffer. For the sake of compareison, are there any other methods that for self shadowing.
A.W
Quote this message in a reply
Apprentice
Posts: 5
Joined: 2009.01
Post: #5
Quote:Originally posted by honkFactory
Yes, I agree that there are probably too many triangles on the asteroid for shadowing to be efficient, but I could prerender the asteroid to a texture before a level since the game I am working on is essentially 2D.
Then nehe lighting example uses the stencil buffer. For the sake of compareison, are there any other methods that for self shadowing.
A.W


Well, if you're preredering you might as well raytrace it. Since it's only one object you don't have to worry about cameras and such. Should be really fast and would'nt take more than an hour to code.

Cheers,
Johan
Quote this message in a reply
Feanor
Unregistered
 
Post: #6
For an asteroid, I would have thought that bump mapping would be more than sufficient to give a good effect for a game. Self shadowing, just to make sure we're on the same page, is when one part of a dynamic object throws a shadow on another part -- specifically, one poly blocks the light hitting another poly. I guess this would look really nice if you had the bumpy edges of a crater throwing long shadows across the face of the asteroid nearby it. How much will this add to your game, though? The computational effort is probably better spent elsewhere.

If you just want interesting shadow effects that look better than the geometrical complexity of the asteroid would otherwise produce, then do bump mapping. I can imagine times when lack of self shadowing would look bad to the user, but you can usually avoid those times by putting the light source between the user and the lit object, or even behind the user. Remember, the look of shadows depends on the viewpoint, something far easier to manipulate than detailed shadows.

Every use of shadows I've seen in a game to date looks phony. Even Doom 3 alpha has all kinds of obvious areas where the shadow algorithms aren't being applied. Usually the player has other things on his mind.
Quote this message in a reply
Member
Posts: 164
Joined: 2002.04
Post: #7
I would burn the shadows onto the asteroid texture, unless its rotating or something, then don't bother.
Quote this message in a reply
w_reade
Unregistered
 
Post: #8
Surely a non-spinning asteroid would be a bit out-of-the-ordinary?

I think this was the reason I was never able to get that into The Belt - try as I might, I couldn't silence the internal voice going "but asteroids move... and spin... Hah! this can't be a real asteroid belt".

Yes, I do know how sad that is.
Quote this message in a reply
Member
Posts: 164
Joined: 2002.04
Post: #9
And how many asteroid belts have you seen lately Smile I'm actually not sure if they spin or not in real life. I much prefer when they spin in games, but they often don't. Of course you could always just make a few different shadow textures for different angles and interpolate
Quote this message in a reply
Member
Posts: 177
Joined: 2002.08
Post: #10
Pretty much all asteroids spin... Angular momentum is very difficult to get rid of, especially in a vacuum.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  iPhone 3GS Shadowing Bug Bersaelor 6 10,428 Dec 28, 2010 04:08 PM
Last Post: jarodl
  Shadowing bug TomorrowPlusX 6 4,787 Feb 1, 2010 12:00 PM
Last Post: DoG
  Shadow Mapping - Self-Shadowing Z-Fighting Artifacts Bachus 16 21,262 Feb 11, 2009 12:24 PM
Last Post: arekkusu
  2D lighting/shadowing demo Skorche 7 6,255 Nov 22, 2004 09:53 AM
Last Post: Skorche
  Static Shadowing with shadow maps NYGhost 1 3,710 Jun 28, 2003 06:21 PM
Last Post: Feanor