Method ExtractNormalMapOS
ExtractNormalMapOS(RenderTexture, Texture, Vector3)
Generates an object-space normal map from a height map texture.
public static void ExtractNormalMapOS(RenderTexture targetRT, Texture heightMap, Vector3 sizeOS)
Parameters
targetRTRenderTextureThe destination render texture that receives the generated normal map. It must have the same resolution as
heightMap.heightMapTextureThe source height map texture to sample.
sizeOSVector3The object-space size represented by the height map. This is used to scale height differentials when computing the normal vectors.
Remarks
The method loads the compute shader from Resources each time it runs and dispatches it with 8x8-style thread groups derived from the target resolution. A debug assertion checks that source and destination resolutions match.