K.Wagrez Posted October 29, 2025 Posted October 29, 2025 Hello everyone, I was looking recently at adding some components to help diagnose some performance hits we have right now on the CPU, most notably this kind: I was wondering what was happening during this "preRender" ? Because frankly for what we are doing with our expressions, 4 ms in average is insanely high. I have been trying dynamically to change update distance / frame duration and even disable the world expression nodes, but it doesn't seem to even affect this cost. I'm pretty sur my component code is working but I might have missed a few world expressions in my world (I have over 100 of those), so I wanted to be sure about two things: 1) What's that time spent in "pre-render" of World Expressions ? 2) Can we modify the parameters of a world expression dynamcially ? Thanks in advance !
silent Posted October 29, 2025 Posted October 29, 2025 Hi Kevin, In the pre-render stage engine is executing the WorldExpressions code. That's the safe place after update and before the render will begin. You can profile individual WorldExpressions to identify what's causing the behavior you’re seeing. Using engine.profiler.begin() / engine.profiler.end() inside the expression code will at least give you a rough estimate of which parts of each expression are most expensive. Thanks! 1 How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
K.Wagrez Posted October 29, 2025 Author Posted October 29, 2025 Okay, I wanted to be 100% sure before I started butchering the code :). Since you haven't made any mention of my questions about dynamically modifying a World expression setting in runtime, I suspect it means it should be possible. Which means I might have missed some world expressions somewhere.
silent Posted October 29, 2025 Posted October 29, 2025 Hi Kevin, I'm not entirely sure I fully understand your question. When you say 'modifying world expression parameters,' could you please clarify what exactly you mean? If possible, could you provide an example? Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
K.Wagrez Posted October 29, 2025 Author Posted October 29, 2025 Let's say I attached a component on all my World Expression nodes. I registered a console command which allows me to request for all components to modify update limit distance/ifps and the enabled/disabled status of my WorldExpression nodes. Enable/disable seems to work, now that I have indeed found all my world expressions. I was afraid that, since world Expressions are a little weird for me, it might behave differently than what I was anticipating.
silent Posted October 29, 2025 Posted October 29, 2025 The WorldExpression node works in the Editor just like any other node, so you can modify its parameters in the same way. Is that what you’re referring to? 1 How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Recommended Posts