[gameprogrammer] Re: shadow volumes

  • From: Alan Wolfe <alan.wolfe@xxxxxxxxx>
  • To: gameprogrammer@xxxxxxxxxxxxx
  • Date: Sun, 29 Mar 2009 17:04:24 -0700

as it turns out i didnt need to know if a model had holes, i just found
edges where a polygon was facing away from a light meeting a polygon facing
towards the light and extended that edge along the light direction.

That handled holes auto-magically so it is working well now.

Thanks Milos!

On Sun, Mar 29, 2009 at 4:59 PM, milos chmel <xchmelmilos@xxxxxxxxx> wrote:

> 2009/3/20 Alan Wolfe <alan.wolfe@xxxxxxxxx>:
> > Heya,
> >
> > I'm trying to code some shadow volume code (ie this
> > http://en.wikipedia.org/wiki/Shadow_volume) and am hitting a snag.
> >
> > To render the shadows right you have to find the silouette of the model
> in
> > relation to the light source.
> >
> > If a model has holes in it for the light to shine through (like a
> doughnut
> > or swiss cheese), finding one silouette edge isn't enough.
> >
> > I think i have a way to find all the silouette edges (basically check
> every
> > triangle on the mesh that isnt back face culled from the light to see if
> > it's and edge, and if so if it's not already part of a siloette edge find
> > the edge that contains that triangle)
> >
> > but thats a much costlier thing i think, so i'm trying to figure out, how
> > can you tell if a model has holes in it?  That way i could set a flag on
> the
> > mesh saying it's ok to use the simpler test if there's no holes.
> >
> > Does anyone know a way to tell if a mesh has holes in it?
> If I understand it what You do is You create 2d silhouette from those
> edges?
>
> I presume You have to build some binary trees to speed-up searching
> "does new edge connect to other edges". If You found edge which
> connects to other edges - merge it to the tree. Otherwise create new
> one. You had to also merge the trees. ..... ;)
>
> It is just a guess. I imagine it as creating outlines and then finding
> out which outline is inside of which. If You have some lone edges -
> delete them .
>
> >
> > Thanks!!
> > Alan
> >
>
>
>
> --
> "Brevity is the soul of wit." by William Shakespeare
> " It IS NOT all FACTS. It IS TRUE. I believe it SHOULD NOT BE BELIEVE
> LITERALLY. It IS TRUE."  - jorgipogi
>
> ---------------------
> To unsubscribe go to http://gameprogrammer.com/mailinglist.html
>
>
>

Other related posts: