Skip to content

v0.2.1: Update HiddenGeometryRemoval.py

Choose a tag to compare

@Unity-SeungwooLee Unity-SeungwooLee released this 02 Sep 13:01

v0.2.1

Adds transparency-aware occlusion and a much faster ray casting backend.

Added

  • Ignore Transparent (on by default): meshes with a transparent material are
    left untouched and no longer block visibility, so geometry seen through glass
    survives the pass. A material counts as transparent when any of the following
    holds:

    • the node tree contains a Glass, Transparent or Refraction BSDF
    • a Principled BSDF has Alpha below 1.0, or Alpha driven by a link
    • a Principled BSDF has Transmission above 0.0, or Transmission driven by a
      link (both the Transmission and Transmission Weight socket names are
      handled)
    • the material's render method is Blended (surface_render_method on 4.2+,
      falling back to blend_method on older builds)
    • the viewport display color has an alpha below 1.0

    A linked alpha or transmission input is treated as transparent, since the
    texture cannot be evaluated ahead of the pass and under-deleting is easier to
    recover from than over-deleting. If any material slot on an object qualifies,
    the whole object is treated as transparent.

    Excluding these objects from the merge is not enough on its own — they still
    sit in the depsgraph and keep blocking rays. During the visibility pass the
    add-on now also toggles hide_viewport on them, which drops them out of
    depsgraph evaluation entirely, and restores the original state afterwards even
    if the pass raises.

  • Fast Ray Casting (on by default): builds a single BVHTree from the
    visible meshes and reuses it, instead of querying the whole scene for every
    ray. The BVH is built from every visible mesh rather than just the target, so
    occlusion behaves the same whether or not Merge Meshes is enabled.

  • Threads: the visibility pass is now split across worker threads when Fast
    Ray Casting is enabled. 0 uses every available core.

    Worker threads never touch Blender data. Sample points are extracted from the
    BMesh on the main thread into plain Vector lists, and camera transforms are
    flattened to position, direction and half-FOV beforehand. Workers only call
    BVHTree.ray_cast and hand back face indices; selection flags are written
    back on the main thread.

    Experimental mode still runs single threaded — its flood fill depends on
    selection state as it progresses, so parallelizing it would change results.

Notes

  • Precomputing sample points raises peak memory use. In High precision a quad
    contributes nine points, so very dense meshes will hold a large point list for
    the duration of the pass. Low precision uses one point per face.
  • Uncheck Fast Ray Casting to fall back to the previous scene.ray_cast path.