> De: "Anders Gidenstam" > > On Fri, 2 Mar 2012, Frederic Bouvier wrote: > > > * Register all transparent surfaces > > Just a quick question: Doesn't OSG already detect translucent meshes > and treat them differently from the rest during rendering? Hence, > couldn't this classification be done more or less automatically and > only require manual intervention in special cases? > > (Maybe I misunderstood what you meant above but to me it does seem > like you are suggesting that all all such objects should be enumerated > in the model XML file - something that IMO seems both error-prone and > inconvenient. There must be a better way.) > > Do I look forward to implement cockpit lighting with real lights.
OSG doesn't detect transparent surfaces. It offers Render Bins that allow to control rendering order. Primitives put in "RenderBin" are sorted by their OpenGL state only and are for opaque objects. Primitives put in "DepthSortedBin" are sorted back to front and are used for transparent objects. If you put opaque objects in a transparent bin, it has only a performance impact, but has no effect on the rendered scene. The inverse is not true. Now something has to put primitives in the right bins. This is done by the loader. It use material color and texture to do that : if an alpha channel is found and has values less than 1.0, the object goes to the transparent bin. But usually you use few texture images to map the entire model. You can have the windshield in the same texture than the wings. With the loader strategy, the windshield is put in the transparent bin, which is good, and also the wings, which is not so good in the context of Rembrandt. Rembrandt use deferred rendering and the technique only apply to opaque surfaces. For transparent objects, it fallbacks to traditional rendering. If all objects are flagged as transparent, it defeats the purpose of Rembrandt. Transparent objects are detected by their membership to the transparent bins, so it is important to have the right classification. To override the selection made by the loader, Rembrandt use effect declaration to set the bin. Effects for opaque objects use alpha testing, and effects for transparent objects will use alpha blending after all lights are rendered. Transparent objects don't cast shadows and are not lit by additional lights. So registering all transparent surfaces means setting a effect for transparency to those surfaces, regardless of the presence of an alpha channel in the texture of the object. Regards, -Fred ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel