Thursday, July 10, 2008

MOSAIC feature ramblings - part 3

Part 3 - The MOSAIC Settings tab and shader libraries:


The "MOSAIC Settings" tab gives you a wide range of settings for defining exactly what and how MOSAIC exports. It allows you precise control over which RenderMan binaries are called and with which parameters, which RiSpec elements are exported in the RIBs, which default display codes are used, which file extensions are recognized, where projects are exported, it even allows you to change the prefixes used to recognize code fragments internally. Everything set in this tab is saved to the Blender registry so they are retained for all new projects.

To help make setting up MOSAIC for the most common RenderMan systems easy, there's also a preset menu at the top of the tab that automatically fills-in all controls based on your selection.

Before beginning the outline of the controls I also want to describe shaders and shader libraries. RenderMan shaders are simply text files written in a C like programming language that describe light, surface, displacement, volume and image shading to the renderer. Before a renderer can use these source files they have to be compiled into something the renderer understands.

To use shaders in your project you'll either need to load shader source files into Blender's text editor (MOSAIC will automatically see and compile these files) or put the shader sources and/or pre-compiled shaders in a folder and add a shader library to point to it the "Add Shader Library" at the bottom of this tab allows you to do this and will do a couple of things:

  • It will add that path to the "searchpath" Option in the exported RIB files making all compiled shaders in that path accessible to all RIBs.

  • It will automatically list any compiled shaders in that path in the "Generate Shader Fragment" utility.


To create a library just click the "Add Shader Library" button and then navigate your file system to the path that contains your shaders. When done MOSAIC will add each library to the bottom of the tab. Once you create a shader library you will notice several things from the interface:

  • You can enable and disable each library, allowing you to limit which shaders are available to the "Generate Shader Fragment" utility (if you group your shaders in folders by type then this can be used to limit selections to certain shader types).

  • You can compile all shader sources in this path. This is extremely helpful when dealing with large numbers of shader sources. A great way to get started using this quickly is to add libraries for each folder in the "shaders" folder that comes with MOSAIC and compile each one and you'll have a whole slew a new shaders to play with :)

  • The last control lets you delete each shader library entry.

    Note : This only deletes MOSAIC's reference to the shaders,
    not the shaders or paths themselves.


Now that we have an idea about what this tab does let's outline what each control does.

Renderer Presets:
This allows you to select which renderer you want to automatically setup.

Renderer Binary:
This allows you to specify how you want the renderer to be called.

Note : You can use the <RIB> token to tell MOSAIC to insert the RIB file call in-between custom parameters otherwise the RIB file is appended to the end.

Shader Compiler:
This allows you to specify how you want shaders to be compiled.

Note : You can use the <SHADER> token to tell MOSAIC to insert the shader file call in-between custom parameters otherwise the shader file is appended to the end.

Texture Optimizer:
This allows you to specify how you want textures to be optimized.

Note : You can use the <TEXIN> and <TEXOUT> tokens to tell MOSAIC to insert the texture file calls in-between custom parameters otherwise the input and output files are appended to the end.

LatEnv Optimizer:
This is the same as above but allows you to specify special optimizing commands for optimizing latitude/longitude maps.

Shader Info:
This allows you to specify how shader info is called. This calls a special binary that comes with most RenderMan system that will display verbose shader parameters on the console when passed a compiled shader. MOSAIC's "Generate Shader Fragment" uses this utility to generate shader fragments automatically.

Note : The fragment utility only understands BMRT style info output, the default for most info utilities but some require special parameters to produce this kind of output.

Shader Extension:
Which extension does this renderer use for compiled shaders?

RIB File Extension:
Which extension does this renderer use for RIB files (usually always .rib)?

Texture Extension:
Which extension does this renderer use for optimized maps (usually always .tx)?

Fragment Filters:
This allows you to change which prefix MOSAIC uses to identify text fragments with. You can use this to change each of the 8 fragment types individually (if maybe an existing prefix interferes with your naming conventions). In practice you should probably never mess with these unless in an emergency.

File Display:
This allows you to specify the default file display code used for creating new scenes.

Note : You can use the <###> token for inserting frame numbers in file names and also add a '#' to the beginning of the code to disable this in the scene's display list.

Frame Display:
This allows you to specify the default framebuffer display code used for creating new scenes.

Note : You can use the <###> token for inserting frame numbers in file names and also add a '#' to the beginning of the code to disable this in the scene's display list.

Depth Display:
This allows you to specify the depth file display code used for creating new shadow maps.

Note : You can use the <###> token for inserting frame numbers in file names and also add a '#' to the beginning of the code to tell MOSAIC this renderer does not support shadow maps.

Append Display:
This allows you to specify the appended depth file display code used for creating new occlusion maps.

Note : You can use the <###> token for inserting frame numbers in file names and also add a '#' to the beginning of the code to tell MOSAIC this renderer does not support occlusion maps.

Deep Display:
This allows you to specify the deep depth file display code used for creating new deep shadow maps.

Note : You can use the <###> token for inserting frame numbers in file names and also add a '#' to the beginning of the code to tell MOSAIC this renderer does not support deep shadow maps.


Exporter Switches:
This will popup a dialog box full of toggles that control the exporter states for export of all RIB structures and features. This can allow you to almost completely disable all internal RIB structures making it possible to get MOSAIC to work with even "loosely" compliant renderers.

Embed Above Settings In Project:
This very handy feature lets you embed all the above settings directly into the current blend file instead of in the local Blender registry. This makes it possible to distribute your MOSAIC settings along with the blend file. Once enabled any changes made to the above settings will only effect the embedded registry and will not effect the Blender registry. Once un-toggled, the embedded registry is destroyed and the Blender registry is used restored.

Export Directory:
This is the directory that all MOSAIC projects will be exported into, default is "/tmp" just like Blender's export directory.

Add Shader Library:
This will add multiple shader library paths to aid in shader management (see above description for more details).

Well that's it for this rambling, next post will focus on the "Project Setup" tab as well as discuss how render passes work in MOSAIC.

Thanks for reading, WHiTeRaBBiT

4 comments:

  1. Thank you, you're a great!
    Now I too hope to do some good image with RIB. Pa_furijaz

    ReplyDelete
  2. Anonymous30/7/08 15:55

    The renderer preset tab does not appear so as to choose a renderer. i got aqsis on my pc. Is there a way to handle that. Thanks for your work.
    dag

    ReplyDelete
  3. Hey, very cool tutorials, good work. I love MOSAIC ! ;)

    But, I was wondering, could you add coordinate systems export (with empties) ? Maybe is this already implemented, but didn't saw it.

    Cheers.

    really, love it!

    ReplyDelete
  4. Sorry for the delay in response (no notification of comments for these).

    pa:
    Best luck with your journey in RenderMan :)

    anonymous:
    If you can't find the preset control then your probably using an old version of MOSAIC. If you go to http://sourceforge.net/projects/ribmosaic and download the latest package you should see the preset control ;)

    cedric:
    Hi again and thanks :)
    At the moment MOSAIC completely ignores empty. Are you thinking of maybe attaching custom RIB to an empty? If you are another technique I've been using is create a cube and remove all geometry but vertex points. This is handy because the points wont export but any custom RIB will however you can still see the bounding box for placement ;) Either way I'll add using empties to my long list of changes :D

    ReplyDelete