Today I encountered the question:
How to create a slight shadow (not fully darked) on 2D GUI.Image, that gets revealed in clockwise direction? I need it to show progression of i.e. time left to build unit, like in RTS games. Instead of clockwise the image reveal could go from bottom to top. I would be interested in both ways.
but, I don’t think this is actually very useful. I think using it in a game will require a bit more work. Although this pg is kinda buggy because of render ordering, its a really great example imo. Look at the bottom on how they set up the MultiRenderTarget and also how they add specific meshes to the render target’s renderList.
Also, could investigate doing it as a shader material instead of postprocess maybe. Idk
This is really interesting as you are trying to use a texture (I would kind a use a ProceduralTexture in this case) as a GUI image but the gui is using a canvas 2d so it is a lot of extra copies from one context to the other. I wonder if we could have a way to use texture as part of the gui @RaananW ? (since @carolhmj is enjoying some well deserved vacations )
The GUI is using canvs2d to paint the UI (at least the 2D part of it). When an image is being used it is being “painted” onto the GUI canvas when needed. A WebGL (or Babylon) texture will probably be counterproductive.
A different approach would be to use the GUI3D elements - Babylon 3D GUI | Babylon.js Documentation. in this case there are meshes generated, and they are using textures.