ro0mquy / rtificial

Flashing Visuals and Dope Sound | Das Git™
http://rtificial.org/
1 stars 0 forks source link

Bakefile support #63

Closed vincent23 closed 9 years ago

vincent23 commented 9 years ago

Strahlenwerk should allow you to "bake" uniforms, i.e. they get turned into a constant variable. This is useful for parameters which are only changed once or maybe seldomly. A baked uniform's value gets written into a "bakefile", which is included at the top of the shader. When automatic uniforms are implemented, baked uniforms should be recognized and ignored. To "unbake" a uniform, you can simply delete the corresponding line in the Bakefile (or there could be an "unbake" button, maybe in combination with a "show/hide baked uniforms" switch).

Todo: What about uniforms which are used in multiple shaders?

ro0mquy commented 9 years ago

In my opinion uniforms that span multiple Shader shouldn't get any special treatment. That just adds complexity.

ro0mquy commented 9 years ago

There must be also some treatment for uniforms that are manually declared. Linke replacing the uniform with a const.

vincent23 commented 9 years ago

I thought of one Bakefile per shader, but I guess one Bakefile per project would be simpler. This approach would solve the issue with uniforms spanning multiple shaders.

Why do you need manually declared uniforms when there are automatic ones? We could make them un-bakeable to stay backwards compatible or just drop them with #62.

ro0mquy commented 9 years ago

or just do a search and replace on every uniform declaration, even on the ones created with #62

ro0mquy commented 9 years ago

a90ebd410797331ac9fcea11e23e6c3bcead454a be921f1bbc4fe882b3bf21a6c706f681c6465e95