You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Though I recently made some improvements to ShaderCache (see #10726), along the way I noticed a variety of things in ShaderProgram and other classes that could be improved, albeit some are more easy to change than others
ShaderSource has a function to remove comments with a regex substitution. Aside from preventing czm_.* in a comment from accidentally importing things, is this necessary? can it be moved to the build step that turns GLSL into JS files? I know the minification step already does something similar
using the czm_ to auto-import built-in functions is convenient, but the regex searching can be expensive for large strings. Could we change to an explicit include system? putting all the imports at the top of the GLSL file would probably be easier to parse than having to regex search the whole string
...Or perhaps the ShaderSource could store a list of builtins separately from the shader text to avoid the post-processing step
For the new Model, I created ShaderBuilder, which was a convenient abstraction for building complex shaders, as it tracks separate lists for defines/attributes/varyings/uniforms/structs/functions/etc. Would it ever make sense to consolidate this with ShaderSource? It might help avoid some regex post-processing steps. Or is it only helpful for more complex cases?
The text was updated successfully, but these errors were encountered:
Though I recently made some improvements to
ShaderCache
(see #10726), along the way I noticed a variety of things inShaderProgram
and other classes that could be improved, albeit some are more easy to change than othersShaderSource
has a function to remove comments with a regex substitution. Aside from preventingczm_.*
in a comment from accidentally importing things, is this necessary? can it be moved to the build step that turns GLSL into JS files? I know the minification step already does something similarczm_
to auto-import built-in functions is convenient, but the regex searching can be expensive for large strings. Could we change to an explicit include system? putting all the imports at the top of the GLSL file would probably be easier to parse than having to regex search the whole stringShaderSource
could store a list of builtins separately from the shader text to avoid the post-processing stepModel
, I createdShaderBuilder
, which was a convenient abstraction for building complex shaders, as it tracks separate lists for defines/attributes/varyings/uniforms/structs/functions/etc. Would it ever make sense to consolidate this withShaderSource
? It might help avoid some regex post-processing steps. Or is it only helpful for more complex cases?The text was updated successfully, but these errors were encountered: