Executing some code after rendering

There is some code I want to run after a frame has finished rendering. I have seen that some render functions in JME have a postFrame method, but I’m not sure how to go about making use of those for my own code. Can anyone tell me how this would work?

Every update call is post rendering (and pre for that matter), what do you want to do?

Hm that makes sense. I want to do some precise performance measuring with System.nanoTime() and I’m looking for the best options to get “pure” results of how long updating and rendering took seperately, and without stuff like waiting times due to frame limiting or similiar things skewing the results.

Do you have an application that you can do “precise performance measuring” on? Most non-realistic tests tend to exhibit bottlenecks in other places that do not apply for actual games. Or in other words: performance tweaking should be last in line and happen when you know what the actual results will be. For everything else the framerate should be good enough for now, just disable vsync and framerate capping. (Or enable capping and only worry when you drop below you designated target fps ;))

Well I’m not actually writing a game, I’m writing an academic test for some graphics algorithms. So it’s not about getting good enough performance, I need to find out how those algorithms perform with my test scenes. I’m already getting a few hundred FPS but I need to record how little time each frame actually took.

The time each frame took is given to you in the tpf value :slight_smile:

1 Like

Perhaps if you list what the separate things you are trying to measure are then people can give some more specific suggestions?

1 Like