The pg is working now but using the internal function _processShaderCode
, I’m wondering is there any better way to do that?
cc @sebavan
Effect wrapper is meant to keep only one variant. I would suggest to recreate a new one with the different defines. Otherwise you would also leak the current shader.
1 Like
So it seems using uniforms rather than defines works better if I have multi params for setting, right?
(And I find it strange that the pg only works when I enable spector.js debug, if not the texture will remain red.
Tested again, the pg not works in chrome and edge, but works in firefox. When with spectorjs debug open, it works in chrome.
Using uniforms would be preferable if the value can change.
The second points is all related to parallel shader compilation.
1 Like