I have hit a bit of a roadblock w.r.t RenderTargetTexture. It seems like however I try to do this,
the ShaderMaterial ment for the RTT pass ends up also being applied directly to the mesh with a entirely different material?
You can clearly see the firstPassMaterial is applied to “Box” and rendered to screen (since it shows backfaces), which afaik should not happen, since it uses secondPassMaterial.
About render targets, your first pg is all good looking with spector. Box which is backside renders on the main canvas while box2 front side renders in the render target:
Now let s check materials and the issue is you are not creating the material 1 for the scene, you left the parameter null also unfortunately as you are relying on source manually instead of the shader store the effect got mixed up
Mm ok. The null parameter was a last minute change (which I noticed no difference with).
As for the defines. Is this a bug? Or is it simply UB to have many materials built from source shaders without ids? I haven’t looked into the ShaderStore, but I assume it is preferred over raw source glsl, then?
And thank you for rapid response! Been having a lot of fun visualizing medical images using babylonjs