Hi Blender-OSG folks, As Jan pointed out, there are difficulties that arise from Blender and OSG/OpenGL having different lighting models. There is no way to specify values such as ambient in Blender, so the next best option is for the exporter to allow the user to specify them. I have made changes to osgexport along those lines, with with a few other improvements, and submitted them to the project maintainer, Rubén López.
I must say that learning a bit about Python, Blender's GUI API, and the .osg format, in order to make these changes, was all really pleasant and straightforward. Here is a summary of what i did: 1. Changed default export from 'Selected' to the more commonly used 'All'. 2. Exposed the diffuse+ambient values of textured materials as a user option in the GUI. Previously, it would fall to inappropriate OSG defaults. This gives control to users, permitting such things as surfaces which are both textured and lit. 3. Save the output path to the registry, so the user doesn't have to re-type it every time. (The texture material values are also remembered in the registry.) 4. Write an ambient component for each material (equal to half the diffuse) which is a better behavior than defaulting to OSG grey. 5. Adjusted the indentation of the .osg output slightly, so that braces are more aligned. I plan to write full documentation on how to use Blender + osgexport correctly and usefully with OSG. I spent many difficult days trying to learn it, so hopefully i can save other people the trouble i went through. Thanks, Ben > -----Original Message----- > From: Ben Discoe > Sent: Monday, August 21, 2006 12:07 PM > To: 'osg users' > > Thanks to Jan, Nop, and Alan, most of Blender+osgexport's > series of required steps, strange behaviors and pitfalls have > some to light. I hope i can do the community a service by > summarizing them on an educational web page when the > mysteries are finally settled. > > Here are some remaining major limitations of the Blender->OSG > process, which seem insurmountable to me, but might in fact > have known solutions to someone with deeper Blender/OSG experience: > > 1. Texture material colors: OpenGL's regular "modulate" > means that a > material consists of a texture and color. Exporting from > Blender only seems to let you define one or the other. This > means, for example, you can't use the same "brick" texture > for both red bricks and yellow bricks. More signifiantly, it > also means you can't control ambient shading of a textured > surface, because ambient is a component of the material > color, so every textured surface is fully illuminated all the time. > > 2. Ambient material values: In fact, you can't define the ambient > property of even non-textured materials, because Blender > seems to lack an 'ambient' slider in its material dialog! > Exporting to .osg and loading into OSG seems to produce OSG's > default ambient (grey) on the unlit side of every object. It > is exceeding weird to have objects which are green on the lit > side, and grey on the unlit side. Even _black_ objects are > grey on the unlit side. > > Can anyone <ahem> shed any light on these problems? _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
