Synchronize shader time to CPU function

Problems building or running the engine, queries about how to use features etc.
Post Reply
slapin
Bronze Sponsor
Bronze Sponsor
Posts: 404
Joined: Fri May 23, 2025 5:04 pm
x 33

Synchronize shader time to CPU function

Post by slapin »

Hi, all!

I provide time to a shader via param_named_auto time time, is there some way to get the same time in common code?
I have a sine-based formula in shader for wavy water surface and I want to calculate rough aproximation on CPU to calculate current water level for a boat,
so for that I need the same time as in shader.

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 404
Joined: Fri May 23, 2025 5:04 pm
x 33

Re: Synchronize shader time to CPU function

Post by slapin »

Thanks!
Ogre::ControllerManager::getSingleton().getElapsedTime() seems to work.

Post Reply