HoudiniExperiments

From cgwiki
Revision as of 05:39, 19 July 2015 by MattEstela (talk | contribs) (Created page with "=== Occlusion Vop Sop === File:not_occ.jpgnull Download scene: File:occlusion_vop_wip_v02.hipnc Surprised to see a few odforce posts on occlusion in sops, and vari...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Occlusion Vop Sop

File:Not occ.jpgnull

Download scene: File:occlusion_vop_wip_v02.hipnc

Surprised to see a few odforce posts on occlusion in sops, and various answers about writing out point clouds, c++, hand waving. My super low-brow understanding of how point-based occlusion works in prman made me think there should be a simple(ish) vop network to do this.

The result isn't correct, but it's interesting. Density map? Curvature map? Not sure.

Anyway, here's the idea:

  1. Use measure sop to calculate area per primitive promote that to point
  2. Vop network that runs this loop per point:
  3. Get the nearest n points within a certain distance
  4. Loop over each found point and get its position, area, normal
  5. accumulate the distance * area * dot product of this points normal vs the found points normal
  6. the final result and scale/gamma to taste

By accumulating the distance, near points should occlude more, far points occlude less. Except already I can see I have my logic wrong, my code should be reversed, damnit. Anyway, scale that by the area, again, bigger primitives occlude more, smaller less. Finally compare normal; the idea that prims that face each other get maximum occlusion, but perpendicular ones get none (eg,a point that has a polygon above it, edge-on, shouldn't occlude.... right?)

Like I said, the result isn't correct, but feels like it has potential. Hmm.