What is that registerAfterRender and onBeforeRenderObservable

where we can use both…

scene.onBeforeRenderObservable.add(() => {
//code to execute

scene.registerAfterRender(function () {

Please any one help me…


It totally depends on your need. If you need to run something before the frame is rendered or before it is sent to the driver (AfterRender).

99.9% of the time you will see no difference. The AfterRender is used internally to measure the duration of the frame render for instance


Thankyou so much @Deltakosh :smiling_face_with_three_hearts: