# CPU Mask Calculation

DRM allows calculating shader equivalent mask using script, without shader. This may be helpful when scene objects need interaction with DRM shaders.

For example, in this scene trees are scaled up and down using a script, but the *<mark style="color:blue;">season changing</mark>* effect is rendered by a shader. The mask values calculated by a script and shader are the same:

<figure><img src="https://1494537888-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVDsGRBXgFisq0hO6tTXv%2Fuploads%2F8F9hgbGI0LSBjIVWYSym%2FGIF_19.gif?alt=media&#x26;token=88b19eda-a7ff-4cf3-b970-7b9403ddf18a" alt=""><figcaption></figcaption></figure>

Spheres objects position here are updated from a script to make them follow the vertex displacement effect created by a shader:

<figure><img src="https://1494537888-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVDsGRBXgFisq0hO6tTXv%2Fuploads%2FqsZEYMxXpEuYq3jZKmnY%2Fgif_20.gif?alt=media&#x26;token=63f353ca-0bc2-4f13-a50f-b320205ae3d4" alt=""><figcaption></figcaption></figure>

Script-side DRM calculation API is provided in the [GetMaskValue](https://amazing-assets.gitbook.io/dynamic-radial-masks/scripts-and-run-time-api/drmcontroller/getmaskvalue) chapter.
