@pmndrs/bvh
    Preparing search index...

    Function generateSdfTexture

    • Fills a three 3D texture with the signed distance to the scene's triangles (docs/tracing/sdf.mdx): SdfGenerator on the renderer's device, over the buffers of source (a SceneTrees after its update, or { buffers: uploadTraceScene(...) }). Resolves when the GPU is done.

      const sdf = await generateSdfTexture(renderer, trees, { box, resolution: 96 });
      material.colorNode = sdf.sample(positionWorld).lessThan(0).select(inside, outside);
      

      Parameters

      Returns Promise<BvhSdfTexture>