CVR Texture Property Parser
Reads a pixel’s color-channel value from a texture and lerps it between a minimum and maximum value before writing it to a target property.
Texture Type
Section titled “Texture Type”Selects how the texture reference is resolved.
- Local Texture Reference an object in your scene directly.
- Global Texture Reference a texture exposed by, for example, the CVR Global Shader Updater.
Texture
Section titled “Texture”Direct reference to a render texture (only shown when Type is Local Texture).
Texture Name
Section titled “Texture Name”Reference name of a global render texture (only shown when Type is Global Texture). Globals are typically exposed by the CVR Global Shader Updater.
A task describes how a value is parsed and where it is written. You can configure multiple tasks. Each task has the following properties.
X/Y Position
Section titled “X/Y Position”X/Y coordinates in pixels. x 0, y 0 is the first pixel.
Color Channel
Section titled “Color Channel”Which color channel to read.
Min/Max Value
Section titled “Min/Max Value”Minimum and maximum values used when lerping the color-channel value.
Target
Section titled “Target”Target GameObject that receives the value.
Component
Section titled “Component”Component on the target GameObject. All components on the GameObject are listed.
Property
Section titled “Property”Public property on the selected component.
Supported Property Types
Section titled “Supported Property Types”When the target property is one of these types, the parser can write to it. The read color channel is lerped between Min Value and Max Value, then written into the property. For multi-channel targets, Target Index picks which channel of the property receives the value.
| Type | Target Index | Write behaviour |
|---|---|---|
float | — | Direct write of the lerped value. |
int | — | Cast to int. |
bool | — | true when the value is ≥ 0.5. |
Vector2 | 0–1 | Writes X or Y. |
Vector3 | 0–2 | Writes X, Y, or Z. |
Vector4 | 0–3 | Writes X, Y, Z, or W. |
Color | 0–3 | Writes R, G, B, or A. |
The target property is resolved via reflection: public fields first, then public writable properties. Both assemblies’ public API is allowed.
Texture sampling is asynchronous: the component enqueues a pixel read, Unity converts the render texture to a native Color32 array on a worker, and only then is the callback invoked and the target property updated. Queued writes per texture are batched into a single conversion.
Prefab-bound targets and components are ignored — the parser skips any target or component whose GameObject is part of an uninstantiated prefab.
Source
Section titled “Source”CVR-GameFiles/ABI.CCK.Components/CVRTexturePropertyParser.csCVR-GameFiles/ABI.CCK.Components/CVRTexturePropertyParserTask.cs