AMBIENT OCCLUSION POINT CLOUD BAKING
1. Attach ptc_write shader to geometry, put in output name in eg “scene.ptc”
2. set attribute on geometry in 3delight- cull hidden surfaces, cull backfacing surfaces, raster orientated dicing to off
3. set up camera view to encompass the geometry
4. Render settings: Quality – Pixel Samples 1,1 Pixel Filter – Box Filter
, top camera. the quality can be cack cause your outputting the point cloud.
5. Render out .ptc file
6 Open ptc view and have a look at the .ptc file. spin it around like a crazy fool.
5 create bkm ( brickmap) file from ptc on command line put in ptc2brick “C:\scene.ptc” “C:\scene.bkm”
There other commands you can put in to vary quality etc, but that will get you going.
6, Attach bake_occlusion_Pref shader to geometry. Put in scene.bkm into the shader.
7 set bias in shader low to avoid white creases
, set the other setting how you see fit.
8. set attribute on geometry – cull hidden surfaces, cull backfacing surfaces, raster orientated dicing to on
set 3delight geometry attribute Visibilty to diffuse Rays(occlusion) Shader Color & opacity
10 Reset the rendering quality setting to the default or whatever you want.
POINT CLOUD BAKING FOR GEOMETRY THAT IS GOING TO DEFORM
1) Select Geometry – Maya Menu – Rendering – Texturing – Create Texture ref object.
2) Add attribute Reference Geometry in 3delight, output Pref, output Nref
3) Follow steps 2-10 above
shader (modified following instructions by mkesson, check out the 2 previous entry)
string bake_file = “”;
float maxtDist = 1;
float samples = 64;
float bias = 0.05;
varying point Pref=(0,0,0);
extern point Pref;
extern normal N;
normal Nn = normalize(N);
color ao = occlusion ( Pref, Nn, samples, “maxdist”, maxtDist, “bias”, bias );
ao = 1 – ao;
bake ( bake_file, s, t, ao );
Ci = ao;
Oi = 1;