I’m using BindToRenderStep for some camera manipulation and I might use it for a few other things as well. I currently have it running on the client and its about 10 lines of math and logic. Is that too much to do every frame? I’m wondering how much further I can take it before it starts impacting performance. About how many lines of code is okay to put in a BindToRenderStep function?
It’s impossible to measure in terms of lines of code because loops, function calls, etc. can impact that. The thing is you don’t want it to eat up processing power - if the thing you’re trying to do is really tough on the processor, then it’ll slow rendering down and you don’t want that.
I don’t know any strict numbers, but so long as you’re limiting it to a few comparisons and such, you should be fine. I’d avoid anything beyond that.
3 Likes
My general principle: if you aren’t updating the camera, character or something that reasonably needs to be updated before a frame renders, then that extra code is too much and needs to go into Heartbeat (if you are reliant on physics simulation and need an update before physics are applied, Stepped).
3 Likes