|
From: Roger H. <rog...@mi...> - 2008-10-10 14:08:03
|
On 10 Oct, 2008, at 03:30, James Walker wrote: > Some 3D formats allow applying different materials to the front and > back > faces of materials, Yes but why? Any real world material has thickness even if its only 1 Angstrom unit so there should be two surfaces with some separation. But of course that does not help when importing from a format which is plain stupid. As long it does not slow down the rest of Quesa then your solution sounds fine, I might even use it in my importers. Best regards, Roger. > and I was thinking about how to do that with Quesa. > Preferably, I'd want to do it without duplicating the geometry, to > save memory. At first I thought that backface culling plus > orientation > styles would do the trick: > > Counterclockwise orientation + backfacing-remove means that we define > the counterclockwise faces to the the front, and cull out the > clockwise > ones. Clockwise orientation + backfacing-remove means that we define > the clockwise faces to the the front, and cull out the > counterclockwise > ones. > > However, we need to take the vertex normals into account. If the > normals were created to face toward the counterclockwise face, then > when > rendering the clockwise face, we need to flip the normals. Currently, > Quesa will only flip normals (OpenGL two-sided lighting) when it's not > doing backface culling. > > What I'm considering is adding a new backfacing style, call it > kQ3BackfacingStyleRemoveFront, which will cull out the front faces > (where "front" respects the orientation style), but also use two-sided > lighting. With this addition, one could render two faces with a > structure like this: > > Group > front attribute set > backfacing style remove > geometry > Group > back attribute set > backfacing style remove-front > another reference to the same geometry > > Does that make sense? > -- > James W. Walker, Innoventive Software LLC > <http://www.frameforge3d.com/> > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win > great prizes > Grand prize is a trip for two to an Open Source event anywhere in > the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Quesa-develop mailing list > Que...@li... > https://lists.sourceforge.net/lists/listinfo/quesa-develop |