Skip to main content
100%

Gist 845aa64e9d9aa6080eadd256e863d835

✓ Published0🌍 Public
Aandybak
Last edited Aug 23, 2019
Created on Aug 23, 2019

This example visualizes gradient vectors computed from a three-dimensional signed distance field, showing normal directions as RGB colors sampled from a Unity Texture3D. The code uses Unity’s `Texture3D.GetPixel` to read distance values and central differences to approximate the gradient along each axis, storing the result in a new `Texture3D` with `TextureFormat.RGBAFloat`. A `ContextMenu` attribute triggers the bake operation, and `AssetDatabase.CreateAsset` saves the output as a reusable gradient texture asset.

AI-generated description

Similar vizzes