I am looking for some life-cycle hooks of the mesh that I can use for my own framework. Here, I stumbled upon the observables on BeforeDrawObservable and onBeforeRenderObservable: Mesh | Babylon.js Documentation
Can anybody tell me what is the difference? Or: what is the difference between drawing and rendering?
Render could be considered the whole process chain from start to end. Lights, shaders, post, updating matrices etc…
While draw is the final step of that process placing it on the screen. Draw is a part of the render.
so BeforeRender would be the entry point before the entire render process starts, and BeforeDraw would the entry point for right before the render process does its final step of placing it on the screen.
@Pryme8: thanks for the explanation. That makes sense. So I guess, onBeforeRender would be the last chance to adjust the transform matrix or any other kind of setting, before it gets rendered
@kvasss: I have seen them as well. Do you think it would make more sense to use these events for my life cycle hooks?
I made this diagram to answer another question like that (sadly couldn’t find the question itself ) with some of the observables called during render and their order: