Showing posts with label air. Show all posts
Showing posts with label air. Show all posts

Monday, November 17, 2008

Aqsis/Air Depth-Mapped Occlusion using multiple light rigs

Hey gang :-)

The short version of this post...

I decided to do a 35 second video demonstrating multiple Depth-Mapped Occlusion maps using Aqsis :-D

Here's the low quality YouTube version...


Or you can download a 25meg high quality version here: http://www.dreamscapearts.com/Public/MultiOccDemo.mp4

The long version of this post...

I noticed a post last week over at Aqsis asking how to use multiple occlusion maps in large scenes or animations. This is something thats has crossed my mind several times while designing MOSAIC's render pass system but not something I've actually tested. Since the BBB shader work is going to be a lot of work and I've needed a little distraction (not to mention just wanting to use MOSAIC at least a little) I decided to do a little 35 second movie using multiple occlusion maps :-D For those of you who don't know ambient occlusion lighting is simply indirect ambient lighting usually from hemispherical directions such as the sky. In RenderMan there are several ways of achieving ambient occlusion depending on your renderer such as irradiance caching, photon mapping, point clouds (usually with in combination with other techniques), depth-mapped occlusion, and plain old light arrays. Depth-Mapped Occlusion is a technique specific to Air and Aqsis similar to a light array however the depth maps are combined into a single file and the file is fed into a shaderop that uses the depth data to figure occlusion shading on the surface. I'm particularly interested in this technique because I'm looking into very, very high resolution renders on a farm that require highly "parallel" techniques, that is the image is broken into many tiles but the tiles can't be rendered until the support data is calculated but usually only by one computer holding up the whole farm. With Depth-Mapped Occlusion each depth pass can be distributed to the farm so the entire farm can contribute to the occlusion data as well as rendering tiles which is more "parallel" in nature ;-)

I decided a good simple scene to demonstrate multiple maps would be a fly through of a city scape broken into blocks with a central subject. The objects of the scene would then be attached to groups and multiple occlusion passes would be generated filtering for each group. The reason large scenes need to be broken down into multiple occlusion maps is because of there scale, it becomes impractical to use a single really high resolution occlusion map for everything (to long to calculate not to mention file sizes). Its also beneficial to break them up for greater controls, such as baking the occlusion maps on the first frame in the background and only calculating occlusion for animation on the subject in the foreground, ect.

As a result of doing this project I've added several new features as well as tweaked several things in MOSAIC, however they are currently only in my developer copy and won't be available to CVS until I finish the shader work :-( Some of the things done for this project are:
  • Added the ability to use the "Enable Occlusion Mapping" utility in the "Scene Setup" tab to generate occlusion passes with user defined names.
  • The occlusion passes are now using the pass names for the outputted occlusion file so the user can know what its name will be for the shader parameter.
  • Made each occlusion rig in the occlusion passes unique so they can be edited separately, before MOSAIC only expected one occlusion pass for each beauty scene so the rigs where all the same :-s
  • Added the occlusion specific controls in the occlusion utility dialog to the "Scene Setup" tab so the occlusion setting can be edited form within the pass (since the occlusion utility can't be used for user named passes after there generated).
  • Added the ability to hide groups of controls in MOSAIC with toggles in the GUI so I could hide the automap controls to make the Scene Setup tab less cluttered
With these modifications its now possible to use any of the autopass utilities to generate custom user defined passes that can later be edited directly by hand, such as a env map pass thats used for multiple objects or a depth map pass used for multiple lights... the only drawback to doing it this way is the shader parameters have to be hand edited since MOSAIC uses the pass names to figure out how to hook pass display data to tokens in shaders :-s

To setup this project I created a plane and used the "discombobulator" script to quickly subdivide and extrude it into a city block. I then instance the block 3 times to create 4 side by side city blocks, each assigned to a different object group. I then created a cube and stretched it into a tower and instanced it twice to create 3 towers in the middle of the city and placed 3 instanced suzanne heads atop each tower, assigning the towers and heads to another group. Next I gave each city block a unique material and used a single unique material for the towers and suzannes shared (this is because each group will need separate occlusion file entries applied to the surface shader of each material). Then in I ran the "Enable Occlusion Mapping" dialog 5 times from the main scene, changing the "Pass Name" and assigning a different object group to the "Select Group" filter for each object group. I named the passes City1.om, City2.om, City3.om, City4.om, Suzannes.om using the object group for each. Once each pass was generated I them switched to each scene and adjusted the occlusion rig to properly surround the objects filter to each pass. Next I used the shader editors "C" button to copy the standard built-in ss_MOSAICsurface shader fragment into 5 new fragments called ss_City1, ss_City2, ss_City3, ss_City4, ss_Suzannes. Then I selected each fragment in the editor and changed the "OccMap" parameter of each from the standard <GetOccMap_S> token to the name of each occlusion file, the occlusion file names are created from the name of its pass with the frame number appended... so for the pass City1.om and its shader ss_City1 on frame one then the parameter should be "[ F1City1.om ]" or if you wanted to do animation you could use the frame token "[ F<#>City1.om ]". Finally I selected each of the 5 materials assigned to the objects and selected the appropriate suface shader for each, such as selecting the material for the first city block and selecting ss_City1 for its surface shader, ect. Then of course I added animation, motion blur, dof and intro-outro graphics to the video sequencer :-D

Anyway heres some screen shots of the basic setup:

the complete beuty scene...





















here the City1.om occlusion rig...





















here the City2.om occlusion rig...





















here the City3.om occlusion rig...





















here the City4.om occlusion rig...





















here the Suzannes.om occlusion rig...





















If anybodies wants to mess with this yourselves you can download the complete project here: http://www.dreamscapearts.com/Public/MultiOccDemo.zip

This zip contains the intro/outro graphics, blend file for Blender 2.48a and a developer copy of MOSAIC pre-loaded in the text editor (WARNING this developer copy of MOSAIC has broken texture support as it is not complete yet and you should NOT overwrite your own copy of MOSAIC with this one!!). To render the project execute the text copy of MOSAIC in the text editor, click "Render Animation" to render out all shadow, occlusion and animation passes (this took 4 days straight on my Core2 Duo 2.8 duel core 8gig ram). Once all frames are rendered into the /tmp/MultiOccPass folder then in Blender click ANIM to composite all tif frames, insert intro/outro and compile them into a mp4 in /tmp ;-)

Thats it... thanks for reading,
WHiTeRaBBiT

Thursday, February 28, 2008

Shader Integration and Pass Controls Complete!

Greetings everybody!



The model you all may recognize of the infamous Killeroo which you can find (along with it's licensing) here. If you goto to my photo album you can see other test renders for raytracing setup for Air and 3Delight all using the same Blender project, also the notes for each render show system configuration, render times, and comments for each render. Another interesting render is a identical setup to render this scene under Aqsis without raytracing, but instead using a distant shadow map and depth map based ambient occlusion:


If you're running Blender 2।45 and download the latest CVS of MOSAIC you may want to grab and play with the Blender project files ;

raytraced setup (3Delight, Air, Pixie): raytraced_killeroo.blend
mapped setup (Aqsis, RenderDotC): mapped_killeroo.blend

WARNING THESE ARE 16 MEG FILES EACH!!

The default shading system is fairly simple in concept, when MOSAIC is started, or before exporting it checks to make sure 10 Blender text files exist :

  • MOSAIClight.sl

  • MOSAICsurface.sl

  • MOSAICdisplace.sl

  • MOSAICfog.sl

  • MOSAICbackground.sl

  • ls_MOSAIClight

  • ss_MOSAICsurface

  • ds_MOSAICdisplace

  • vs_MOSAICfog

  • is_MOSAICbackground

These correspond to the 5 shaders and 5 shader fragments required for the default shading system. If any one of these are missing MOSAIC will automatically load and use them. These shaders tie into the light, material and world systems of Blender through the embedded shader fragments with the tokens already setup. This allows seamless use of most Blender settings but also allows the user to customize the shader source and parameters on a project by project basis, it also keeps all code in one script so MOSAIC will still be portable and easy to use. The list of everything these tie into would be too long, but in general I'll just say all light and mist settings work and most material and texture channels and mapping work. Any setting that couldn't be hooked directly to a Blender control has been placed at the top of each shaders parameters list, and are easily identified by the lack of a token parameter. I plan to continue to add to and expand these shaders as I find and learn new things to add (like adding built-in SSS support, etc).

I've also completed the render pass and mapping controls for building various render pass types. For right now these passes would still need to be built by hand but has laid the ground work for me to build utilities to automate this! These features include the ability to control perspective, clipping and DOF for non-camera objects set as active cameras (good for lamp views and cube maps from objects perspectives), mapping dialogs to setup depth to tx exports per pass, the ability to select "into" camera objects that are duplis (such as using a lamp as dupli on a mesh and setting up a pass for each one), the ability to render every RIBset in a scene as a separate pass (such as setting up a linked scene for a cube map and using a different RIBset for each of the 8 cube perspectives). The last one is a key feature because it allow the setup and logical control of hundreds of related passes in a single Blender scene. Although these allows you to build passes it is really intended for use by utilities that will automate all this and just allow the user direct control after the passes are constructed. Like I said above, I'm very close to finalizing all the basic controls and features so I can release a new beta download and update all the documentation and examples :)

Now that everything is in place for manually handling render passes the next step is building a series of automated dialogs to generate render passes. Hopefully if all goes well this should take 1 to 2 weeks :)

This is >WHiTeRaBBiT< signing off!!!

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.