Occlusion Vop Sop
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:
- Use measure sop to calculate area per primitive promote that to point
- Vop network that runs this loop per point:
- Get the nearest n points within a certain distance
- Loop over each found point and get its position, area, normal
- accumulate the distance * area * dot product of this points normal vs the found points normal
- 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.