Showing posts with label display. Show all posts
Showing posts with label display. Show all posts

Monday, July 14, 2008

MOSAIC feature ramblings - part 6

Part 6 - The Scene Setup tab and display drivers:



The "Scene Setup" tab represents the currently selected Blender scene, and since MOSAIC uses scenes as passes most of the settings here are related to render passes. All tabs from this point forward begin having a direct relationship to Blender's GUI and data structure, meaning selections in Blender will affect MOSAIC and selections in MOSAIC affect Blender. This becomes especially helpful when dealing with complex scenes where mouse selection is difficult and the outliner clutters the project space... for instance if dealing with lights just leave the "Lights Setup" tab open, select the light you want from a list of only lights, not sure it was right? just spin the 3D view around and see what was selected, etc. This also means that all settings in each tab are written to whatever is selected (its datablock properties), so whatever you're setting up you can be sure that those settings will link and append as you'd expect into other projects. To aid in navigating, MOSAIC also color codes each tab, and controls in each tab are grouped visually according to similar tasks ;)

Render passes in MOSAIC also automatically use Blender's scene format controls "SizeX", "SizeY", "AspX", "AspY" and the Anim controls "Sta" and "End".

Now let's begin listing the controls, I'll break them down by group explaining what each group does and then outline each control in that group.

Navigation and RIBset management:Scene Setup
This group of controls is at the top of this and all the remaining tabs in MOSAIC and allows you to select available scenes, updating all controls and Blender selections accordingly. It also has controls for creating, deleting and selecting RIBsets for this tab.

Here's a breakdown of the controls in this group:

  • Select Scene -This will show a list of available scenes for selection, once selected it will update Blender's current scene and all controls in this tab.

  • Select RIBset -This will show a list of available RIBsets for selection, once selected it will update all controls in this tab.

  • Create New RIBset -This will create a new RIBset from the current RIBset control settings and select it.

  • Delete This RIBset - This will delete the currently selected RIBset and select the DEFAULT RIBset.


Code management:
This group of controls is for attaching user created code fragments (text file with the "cf_" prefix in their names) to the beginning and end of different RIB blocks. As the previous group, this group of settings is available in various configurations for all the remaining tabs.

Here's a breakdown of the controls in this group:

  • Frame Archive -This menu allows you to specify whether the exported RIB code for scenes is exported into separate RIB archives or inlined into the main RIB.

  • Header Begin Code -This allows insertion of custom code fragments into the beginning of the header block which is after all of MOSAIC's Options (search paths, etc), but before the RiFrame blocks.

  • Frame Begin Code -This allows the insertion of custom code fragments into the beginning of the RiFrame block (this is immediately after the FrameBegin call, before anything MOSAIC exports).

  • World Begin Code - This allows the insertion of custom code fragments into the beginning of the RiWorld block (this is immediately after the WorldBegin call, before anything MOSAIC exports).

  • World End Code - This allows the insertion of custom code fragments into the end of the RiWorld block (this is immediately before the WorldEnd call, after anything MOSAIC exports).

  • Frame End Code - This allows the insertion of custom code fragments into the end of the RiFrame block (this is immediately before the FrameEnd call, after anything MOSAIC exports).


Shader management:
This group of settings is available in various configurations for all the remaining tabs and is for selecting shaders for the selection.

Here's a breakdown of the controls in this group:

  • Atmosphere Shader -This will select an atmosphere (fog) shader that will affect everything in this scene. RenderMan and MOSAIC allows multiple types of atmosphere shading such as shading an entire scene in the scene tab, or individual objects in the geometry tab, or groups of objects in the group tab, and materials using interior and exterior volume shading. Be aware of this as you setup your scene, for instance if you only want a particular object to have fog you would disable the shader in the scene tab and enable it in the geometry tab of that object, etc.
  • Notes - This will display a popup of any notes attached to shader fragment by the author (usually containing information about which Blender controls are used by this shader).

Also note that the built-in vs_MOSAICfog shader automatically uses all Blender's world Mist settings and uses the HorRGB color for the mist. This means that setting up and using the world mist should feel identical to using it in Blender.

Note : Immediately following this blog series I will be rewriting the built-in shader system so some shader related information may change.


Pass utilities:
This group of controls is for creating specialty render passes related to this scene.

Here's a breakdown of the controls in this group:

  • Enable Occlusion Mapping -This will generate a scene and render pass entry for occlusion depth mapping using the current scene as its beauty pass. There will be a future blog covering this in more detail latter.

  • Edit - This will pop-up the occlusion map dialog for editing the occlusion pass if it exists.

  • Enable IBL Environment Map -This will generate a scene and render pass entry for making a global cube map for things like image based lighting or global environment maps, etc. There will be a future blog covering this in more detail latter.

  • Edit -This will pop-up the IBL map dialog for editing the IBL pass if it exists.

  • Custom Render Call - This allows you to manually type the call to the renderer for this pass only, this is handy for doing custom parameters to the renderer on a pass-by-pass basis (such as disabling threads of a photon map pass).


Options and attributes:
This group of controls is for setting frame and world related options and attributes for this pass.

Here's a breakdown of the controls in this group:

  • SizeX -This will bypass Blender's SizeX control if greater then 0 and allows for a much higher image width of up to 1000000000.

  • SizeY -This will bypass Blender's SizeY control if greater then 0 and allows for a much higher image height of up to 1000000000.

  • Steps -This sets how many steps to skip in-between frame animations.

  • Shading Rate - This sets RiShadingRate (0 is off, won't export).

  • eyesplits - This sets the eye plane failure detection (0 is off, won't export).

  • gridsize - This sets the number of micropolies shaded at once (0 is off, won't export).

  • bucketsize - This sets the render bucket size (0 is off, won't export).

  • Xsamples - This sets RiPixelSamples xwidth (0 is off, won't export).

  • Ysamples - This sets RiPixelSamples ywidth (0 is off, won't export).

  • Filter - This sets RiPixelFilter type (blank is off, won't export).

  • Xwidth - This sets xwidth for filter (off if no filter).

  • Ywidth - This sets ywidth for filter (off if no filter).

  • Xwidth - This sets xwidth for filter (off if no filter).

  • Hider - This sets the Hider to use (DEFAULT doesn't export anything).

  • Emit - This sets hiders emit value (-1 is off, won't export).

  • Jitter - This sets hiders jitter value (-1 is off, won't export).

  • Irr maxerror - This sets the irradiance maxerror attribute, see renderer's documents for details (0 is off, won't export).

  • Trace maxdepth - This sets the trace maxdepth option, see renderer's documents for details (0 is off, won't export).

  • Shadow bias - This sets the global shadow bias option, see renderer's documents for details (0 is off, won't export).

  • Trace bias - This sets the global trace bias attribute, see renderer's documents for details (0 is off, won't export).

  • Photon globalmap - This sets the photon globalmap attribute, see renderer's documents for details (0 is off, won't export).

  • Photon causticmap - This sets the photon causticmap attribute, see renderer's documents for details (0 is off, won't export).


Mapping Utility Controls:
This group of controls are normally setup and used by different autopass dialogs throughout MOSAIC's GUI automatically, they are responsible for controlling how MOSAIC handles the exporting of shadow and environment maps. You should rarely need to access these directly but are provided to offer full control in the spirit of the rest of MOSAIC's design decisions.

Here's a breakdown of the controls in this group:
  • Shadow - This will pop-up a dialog for entering parameters for MakeShadow (normally automatically filled in by autopass dialogs).

  • LatLong - This will pop-up a dialog for entering parameters for MakeLatLongEnvironment (normally automatically filled in by autopass dialogs).

  • Cube - This will pop-up a dialog for entering parameters for MakeCubeFaceEnvironment (normally automatically filled in by autopass dialogs).

  • Texture - This will pop-up a dialog for entering parameters for MakeTexture (normally automatically filled in by autopass utilities).

  • Projections: - This menu allows you to select the active camera projection type for active cameras that are lights or objects. Active cameras as lights are used for shadow mapping and active cameras as objects are used for environment mapping (usually this control is setup automatically by the autopass dialogs).

  • Degrees/Scale - The degrees for projection camera types and scale for orthographic projection types (only used if active camera is not a camera).

  • Near Clip - Cameras near clipping (only used if active camera is not a camera).

  • Far Clip - Cameras far clipping (only used if active camera is not a camera).

  • Dupli Index - This is used to select which object/light perspective position to use if active camera is in a dupli system (normally automatically filled in by autopass dialogs).

  • Area Index - Similar to the dupli index, this selects which x/y samples perspective position to use if this is an area light (area lights are translated into light arrays using the x/y samples to determine grid divisions, normally automatically filled in by autopass dialogs).

  • EnvDOF - This will enable the DOF effect for this object active camera to fake glossy reflections for environment maps (normally automatically filled in by autopass dialogs).

  • focalL - The focal length for DOF if EnvDOF is enabled.

  • fstop - The fstop for DOF if EnvDOF is enabled.

  • dist - The view distance for DOF if EnvDOF is enabled.

  • Image Shader - The image shader for active object camera.

  • Autopass Filter Setup - Shows the filter pop-up with a series of filters that control how this scene is updated if it is a autopass. MOSAIC uses these settings to determine how to rebuild this scene for updating against its beauty scene if its for shadow maps, environment maps, etc (normally automatically filled in by autopass dialogs).


Display Setup:
This group of controls is responsible for managing the export of display codes. RenderMan uses display codes to determine what to render to and is capable of not only writing images to file but also to framebuffers for preview and arbitrary output data. To make this as unrestricted as possible MOSAIC allows the user to directly type the display code exactly as they want it, then enabling and disabling them as they like. To get the user up and running quickly most MOSAIC renderer presets automatically include the default file and framebuffer displays so a render will preview and write to file automatically.

Here's a breakdown of the controls in this group:

  • Quantize -This will export RiQuantize for HDRI images (blank is off, won't export).

  • Add Display Driver - This will add a new file display to the display list as a starting place for user setup.

  • Use -This will enable or disable the display code on the same line (notice that this is achieved by simply adding a '#' to the beginning of the code, this is nice because it will still be exported in RIB and can be re-enabled in a text editor later).

  • Display Code - This contains the actual display code and can be edited as you see fit. Also note the use of the '#' for enabling and disabling the code and the use of the <###> token for inserting frame numbers in file names.

    Note : Even though the default display codes contain '+' on every line for appending, the exporter will actually strip it for the first display code by default.

  • Del - Deletes the display code on the same line.


Well that's it for the scene setup tab, as promised I'll cover the autopass dialogs for occlusion and IBL on a latter post ;) Next up cameras setup tab.

Thanks for reading, WHiTeRaBBiT

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