aconstlink / motor

Software Framework for Audio/Visual/Interactive Real-Time Applications
MIT License
1 stars 0 forks source link

msl variable initialization in code #62

Open aconstlink opened 3 months ago

aconstlink commented 3 months ago

It would be nice to be able to initialize declared variables in code so the user does not need to handle that variable from the application side.

Example:

vec3_t my_value = vec3_t( 1.0f, 2.0f, 3.0f ) ;

Variables are inserted into variables set anyway during the shader compilation process in the rendering backends, so the default value could simply be read out and assigned to the variable created in the variable set.

Possible obstacles: If a variable is getting assigned a default value after the user already has assigned a value via a variable set it can not be determined if that variable in the variable set is created by the run-time or the user. So which variable is the correct one?