Hi,
Now that I am done with the material plugin, which works great, I am back with the procedural texture system.
It works, no issue, but I want to add a procedural normal map.
I would like to do my calculation once, and reuse the common results in both the procedural texture and the bumpTexture.
I will store my shaders in a ShaderStore.
Right now, it seems separated. This is the logic I follow:
var albedotexture = new BABYLON.CustomProceduralTexture("atexture", "shaderstore_name", 1024, scene);
var bumptexture = new BABYLON.CustomProceduralTexture("btexture", "shaderstore_name2", 1024, scene);
Ideally something like
var precalctextures = new BABYLON.CustomProceduralTexture("precalctextures", "shaderstore_name3", 1024, scene);
It is not just about importing the code, but importing the cached result for the current fragment to avoid recalculation when the parts at the beginning are the same.
I don’t know… it would enable to benchmark the impact of “shared code then parallelism” vs “full parallized” pipeline…
Since the GPU is so good at parallel calculations, I am not that confident it is a good path to follow…
I am really wondering now.
Anyway, maybe you already have something to tackle this situation.
Thanks,