Friday, February 08, 2008

Built-in shaders for MOSAIC

Greetings BlenderHeads and RenderMan Junkies :-)

Before talking about what's going on in MOSAIC I just wanted to give a big thanks to the sponsors of BlendertoRenderMan, the other developers of such wonderful tools (whom I feel very humble to be included with) and all the great people in the Blender and RenderMan communities! Everybody has been extremely supportive and encouraging, when so much time and trouble has been put into something kind words and support mean more then I could ever say :'-)

Now on to MOSAIC!
For some quick background I've been been developing MOSAIC since February of last year in VERY intense all nighters and all weekend sessions! My goal is to go from concept to fully functional project (either late stages of Beta or version 1.0) within a year. The reasoning behind this is simple, I'm more interested in making art then programming but needed a good tool to leverage Blender's capabilities with RenderMan (at least until some of these other great tools are ready). Once it leaves beta I intend on actually using MOSAIC as much as possible and polishing it from personal use and community feedback (which has already been extensive and very helpful!). As it stands now it looks that I'm about a month or two from reaching that goal :-) Right now I'm pushing to finish the last large internal changes so the beta-0.2 download can be setup and the wiki and examples can be updated with the latest changes.

The current CVS version of MOSAIC is using the standard shaders that are in the RiSpec to loosely simulate Blender's most basic materials and lights. The beauty of this approach was it insures that ALL RenderMan renderers will work "out-of-the-box", but has proven too limited for new users who are not able or willing to write their own shaders. So with much debate I have chosen to write custom shaders that tie in most of Blender's standard material and lighting capabilities to RenderMan. This approach is nice for the end user but has the problem of being exceedingly difficult to make SL code that is compatible with all renderers both in language and concepts.

After 3 weeks of heartache I currently have 4 built-in shaders and fragments that tie in most material and light features of Blender including:
  • All light features and light types (with auto light array to simulate Blender's area type), nodiffuse, nospec, hooks for spot, distant and point shadow mapping as well as projector
  • All fog settings including ground fog
  • Ambient Occlusion and HDRI Occlusion (for raytracing renderers)
  • Standard material specular and diffuse controls, Shadeless, Translu, Emit, Amb, Fresnel, Raytrace, Reflect and Refract, hook for environment map, texture offset and scaling, all map channels (with 1 texture per channel limit) and working channel controls (for instance spec maps, ref maps, reflect maps, etc).
So far this technique is simulating Blender's materials behavior pretty well, but I fully expect there to be a lot of bugs and renderers they don't work with. I'm currently integrating the shaders as defaults when NONE or custom shaders are not selected, hopefully all this will be updated to CVS in about a week :-/

After extensive testing and CVS release of this I plan to move onto building utilities for automatically creating shadow map passes, cube and lat-long environment maps and maybe integrating the depth map technique for SSS.

Thats about it, sorry for the long post but I had a lot to say. If you hadn't already, try MOSAIC and while you're at it try all the other great tools here just follow the links to the right.


  1. This is very good.

    Can you please list the renderers MOSAIC is known to work with so far ?

    I also wonder if you ever used the Texblender shader for BMRT, that was designed several years ago to provide an interface creating the same functions as Blender's texture options, within a shader ?

  2. I'll look into "Texblender" tonight, I think I had looked at it about a year ago but I can't remember.

    I'm primarily testing with 3Delight, Pixie and Aqsis since those are the most common but I'm also testing with Air, RenderDotC, and BMRT. Theoretically PRMan and any other RiSpec compliant renderer should work (since I strictly adhere to the spec), but I don't have access to it so I don't know :-(

    I'm using new style header comments, inline declarations and archive calls in the RIB by default so you have to turn alot of features off and use alot of custom code fragments to get BRMT to work (but its possible). In general I haven't had much success with it though.
    Also I'm using the new Integer style raytracing attributes so Air won't work without custom code, but I'm sure there'll get compliant eventually.
    That's whats good about MOSAIC, if your not scarred you can always add custom code fragments ;-)