My Project
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Tayx.Graphy.G_GraphShader Class Reference

This class communicates directly with the shader to draw the graphs. Performance here is very important to reduce as much overhead as possible, as we are updating hundreds of values every frame. More...

Public Member Functions

void InitializeShader ()
 This is done to avoid a design problem that arrays in shaders have, and should be called before initializing any shader graph. The first time that you use initialize an array, the size of the array in the shader is fixed. This is why sometimes you will get a warning saying that the array size will be capped. It shouldn't generate any issues, but in the worst case scenario just reset the Unity Editor (if for some reason the shaders reload). I also cache the Property IDs, that make access faster to modify shader parameters.
 
void UpdateArray ()
 Updates the material linked with this shader graph with the values in the float[] array.
 
void UpdateAverage ()
 Updates the average parameter in the material.
 
void UpdateThresholds ()
 Updates the thresholds in the material.
 
void UpdateColors ()
 Updates the colors in the material.
 
void UpdatePoints ()
 Updates the points in the graph with the set array of values.
 

Public Attributes

int ArrayMaxSize = 128
 
float[] ShaderArrayValues
 
Image Image = null
 
float Average = 0
 
float GoodThreshold = 0
 
float CautionThreshold = 0
 
Color GoodColor = Color.white
 
Color CautionColor = Color.white
 
Color CriticalColor = Color.white
 

Static Public Attributes

const int ArrayMaxSizeFull = 512
 
const int ArrayMaxSizeLight = 128
 

Detailed Description

This class communicates directly with the shader to draw the graphs. Performance here is very important to reduce as much overhead as possible, as we are updating hundreds of values every frame.


The documentation for this class was generated from the following file: