Andy Ross wrote:

* Stated exactly: the silhouette is a subset of triangle pairs sharing
 an edge where one triangle is front-facing with respect to the light
 source, and the other is back-facing may be on the silhouette.

There is a pre process step where I look for the 2 triangles that share an edge. For rendering we only consider triangles facing the light. For each of its 3 egdes we check if the neighbour triangle is facing the light or not. The edge shared by 2 triangles facing the light is not a silouhette edge, if the neighbour triangle is not facing the
light (or does not exist) then this edge is a silouhette.

The problem is that detecting this silhouette (or at least an
approximation) in a situation where the object and light source can
have any orientation is a big mess, and I never found a good way to do
it.  Lots of really complicated code got me nowhere.

The idea is to use a light in model space, not in world space. So if the object move it's like if the light was moving in the opposite direction. When I compute the silouhette for an object I climb the scene graph to find all the ssgtransform node and then I use the inserve matrix to rotate my light vector. The translation part of this matrix is nullified since the sun if far way I do as if the sun was moving with the object. The silhouette computation is only done when my sun vector change enought and I cache the list of silouhette
edges so the cpu is not too stressed every frame while nothing changes.

Basically, the whole experience convinced me that a shadow buffer
approach, which is *much* simpler conceptually (just draw the thing
into a texture from the point of view of the light source), was a
better idea.  Shadow buffers don't need the really complicated
silhouette optimization work to make them run fast.  It is true that
shadow buffers don't work for self-shadowing objects (shadow of the
vertical stabilizer on the wing, etc...), though.


I started a prototype before using hardware shadow maps. You are right it's a lot simpler, but it can't run on all hardware (and nvidia don't have the shadow ambient extension so shadows would be black...) and I think that shadows should be available to all users. And of course shadow maps a problem of


Flightgear-devel mailing list

Reply via email to