Shader Properties

I thought I read somewhere all the shader variables declared in the properties section
that the data is sent each frame … is this True ?

Just wondering because I have 100’s things in my shader properties section

I don’t see all the variables in frame debugger so I’m hoping it is not

Shader “echoLogin/test”
{
Properties
{
_ControlScriptFlag (“”, Float) = 0
_SrcBlend (“”, Float) = 1
_DstBlend (“”, Float) = 0
this stuff here

anyone know ?

Kinda. Any data that the shader uses within the shader code itself is passed every frame, though that may not mean it gets fully calculated each frame, or reuploaded to the GPU. But also you shouldn’t worry about it. For the standard shader potentially several hundred floats worth of data is being set on each shader every frame for dynamic objects, and that’s fine, that’s just kind of how real time graphics APIs work. Having 100 properties on your shader isn’t likely to be a problem.

I guess my question is … is there more overhead by putting a uniform variable in the properties section vs not

I have around 250 variables in properties now I could with some work
get rid of 90% of them … just wondering if its worth the effort

I mean, maybe? The difference between a uniform being in the properties or not really just comes down if those properties are saved in the asset. The values have to be set every frame regardless.

Think about it this way. The way real-time rendering works is the CPU says “render this mesh with this shader with these uniforms”. Every single pass is basically setting all of the needed uniforms over and over.