mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Added uniform frequency. (#3485)
* Added uniform frequency. * Cleanup. * Cleanup.
This commit is contained in:
committed by
GitHub
parent
8a9bc3ed65
commit
35911ac2d9
@@ -49,7 +49,7 @@ public:
|
||||
, 0
|
||||
);
|
||||
|
||||
u_time = bgfx::createUniform("u_time", bgfx::UniformType::Vec4);
|
||||
u_time = bgfx::createUniform("u_time", bgfx::UniformFreq::Frame, bgfx::UniformType::Vec4);
|
||||
|
||||
// Create program from shaders.
|
||||
m_program = loadProgram("vs_mesh", "fs_mesh");
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
bgfx::touch(0);
|
||||
|
||||
float time = (float)( (bx::getHPCounter()-m_timeOffset)/double(bx::getHPFrequency() ) );
|
||||
bgfx::setUniform(u_time, &time);
|
||||
bgfx::setFrameUniform(u_time, &time);
|
||||
|
||||
const bx::Vec3 at = { 0.0f, 1.0f, 0.0f };
|
||||
const bx::Vec3 eye = { 0.0f, 1.0f, -2.5f };
|
||||
|
||||
Reference in New Issue
Block a user