Showing posts with label rsl. Show all posts
Showing posts with label rsl. Show all posts

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

Tuesday, March 04, 2008

Another update in MOSAIC's recent progress

Greetings everyone!

Just thought I'd post an update on several things just added to MOSAIC :)

After a few conversations with Syoyo and Tenzin as well as questions asked over the last couple of months, I have added more direct control of some of MOSAIC's internal exporter. In particular there is now a dialog in the "MOSAIC settings" tab that has a series of toggles for turning on/off some of the structural RIB export stuff. At this point the only things that can't be turned off in export are RiFormat and RiAttributeBegin/End which I think is the bare minimum valid RIB you could have. Also these toggles are tied into the preset system so they can be automatically set depending on what renderer is selected. Because of this I have added Angel, Gelato, jrMan and Lucille to the preset list. I tried adding PBRT and LuxRender but unfortunately they are using a heavily modified version of RIB that's not translatable (unless someone know about a translator out there).

I have Angel and jrMan setup like BMRT except for their render call so they can use BMRT's compiler and shader info.

Gelato can read standard RIB files (with a added module) but unfortunately uses its own GSL instead of RSL, If you use Gelato you'll need to translate MOSAIC's built in shaders with a utility you can get with Gelato or just use the shaders provided with Gelato. Also I have Gelato's shader extension added to the preset so you can include Gelato GSL source in Blender just like you can with RSL :)

Here's the Killeroo test scene (with shaders already translated) rendered with Gelato:



And here's the file if you want to play with it (warning 16meg file!)
http://www.dreamscapearts.com/Public/gelato_killeroo.blend

For comparison I decided to try and reproduce this scene in Blender's internal renderer. I used high res SDS with displacement modifier and normals. It was soo slow I ended up leaving the ground flat because it was too costly, this took 10.6 hours! I think this clearly shows the benefit of micropoly displacement :)



And here's the file if you want to play with it (warning 16meg file!)
http://www.dreamscapearts.com/Public/blender_killeroo.blend

And last but not least, because of the new exporter and preset controls I was able to get Lucille working in MOSAIC. I was having some problems with the meshes rendering properly but did manage to get this simple render ;)



Here's the project file
http://www.dreamscapearts.com/Public/lucille_killeroo.blend

I already have everything setup to render so hopefully this will help you with Lucille's development Syoyo ;)

Thats it, thanks for reading my rantings!!

>WHiTeRaBBiT<

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.

Thursday, February 07, 2008

Labels

Labels to apply, so posts can be searched by topic.

Blender to Renderman tools :

blenderman, neqsus, btor, blenderpixie, blenderlucille, ribkit, ribber, sler, svat, ribmosaic, blendergelato, blenderpbrt, luxblend

Renderers :

prman, bmrt, entropy, 3delight, rdc, air, angel, aqsis, pixie, lucille, gelato, pbrt, luxrender

RenderMan terms :

rib, rsl, shader, dso, shadeop

This post might be edited to add more.