Examples/RIB Examples

From PixieWiki

Jump to: navigation, search

Please add your example RIB files here.

[edit] Global illumination

Here's a RIB sequence that generates a photon map, irradiance cache, and then a final beauty pass. Rendering directly from the irradiance cache is very quick. The examples are based on the Siggraph 2003 paper, "Global Illumination and All That", by Per Christenson. This can be downloaded at [[1]]

Media:pmap_render_pass0.rib

Media:pmap_render_pass1.rib

Media:pmap_render_pass2.rib

Shaders:

Media:indirectsurf1sided.sl

Media:indirectsurf.sl

Media:indirectsurf2.sl

Media:cosinelight_rts.sl

or

Media:cosinelight_tweakedshadow.sl


  • Photon bounce produces

Image:pmap_render_pass1.jpg

  • Second pass produces

Image:pmap_render_pass2.jpg


[edit] Ambient Occlusion

Here's a RIB and 2 shaders that produce an ambient occlusion render. These shaders correspond to the speed-optimized occsurf2 and occsurf3 shaders from 'Global Illumination and All That', mentioned above.

The sampling is set at coarse level of 1024; increasing the sampling improves the quality of the image at the cost of render time. The file ambient_occ does not work on 2.2.5 ('Attribute "visibility" "trace" has been removed.) To make it work, change line 14 to 'Attribute "visibility" "diffuse" 1. (I tried to upload a new version, but the wiki complains that the file is corrupt or of the wrong extension...)

Media:ambient_occ.rib

occsurf2.sl is a basic ambient occlusion shader. occsurf3.sl adds tuning parameters to enable artistic tweaking of the look of the solution; the primary parameters to tune are coneangle and maxdist. maxdist determines how far away an object can cause occlusion. coneangle specifies how large a fraction of the hemisphere above a point should be taken into account when computing ambient occlusion. The default value is PI/2, corresponding to the entire hemisphere.

Media:occsurf2.sl

Media:occsurf3.sl

Image:ambient-occlusion.jpg

Ambient occlusion can be saved in a cache file and reused in the same manner as indirect illumination. The following occlusion shader is identical to the ones used above, but includes coordinate system and maxdist parameters to handle moving objects and calculation distance.

Media:occsurfwrite.sl

The two RIB files compute a saved occlusion cache file, and then use the saved data to base the final calculation on. These files use a slightly different read/write form than the irradiance example above; the occlusion file is written with a coarse shading rate of 10, and then the file is read using the "r" tag, which makes Pixie use the saved data as reference, but then compute any further needed details at the edges of the intersection area.

Media:ambient_occ_write.rib

Media:ambient_occ_read.rib

[edit] Motion blur example

Shows multi-point motion blur

Image:multimotion.jpg

Media:multimotion.zip