Table of Contents

Method ExtractNormalMapOS

Namespace
Pinwheel.Vista
Assembly
Pinwheel.Vista.Runtime.dll

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

targetRT RenderTexture

The destination render texture that receives the generated normal map. It must have the same resolution as heightMap.

heightMap Texture

The source height map texture to sample.

sizeOS Vector3

The 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.