This commit is contained in:
Branimir Karadžić 2018-01-19 17:07:03 -08:00
parent 0dc5c8392f
commit b4338ce0d2

View File

@ -455,12 +455,13 @@ public:
}
}
float at[3] = { 0.0f, 0.0f, 0.0f };
float at[3] = { 0.0f, 0.0f, 0.0f };
float eye[3] = { 0.0f, 0.0f, -5.0f };
float view[16];
float proj[16];
bx::mtxLookAt(view, eye, at);
float proj[16];
bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f, bgfx::getCaps()->homogeneousDepth);
// Set view and projection matrix for view 0.
@ -469,7 +470,7 @@ public:
// Update texturecube using compute shader
if (bgfx::isValid(m_programCompute) )
{
bgfx::setImage(0, s_texCube, m_textureCube[2], 0, bgfx::Access::Write);
bgfx::setImage(0, m_textureCube[2], 0, bgfx::Access::Write);
bgfx::dispatch(0, m_programCompute, textureside/16, textureside/16);
}
@ -478,23 +479,23 @@ public:
if (bgfx::isValid(m_textureCube[ii]))
{
float mtx[16];
bx::mtxSRT( mtx, 0.7f, 0.7f, 0.7f, time, time*0.37f, 0.0f, -2.0f +ii*2.0f, 0.0f, 0.0f );
bx::mtxSRT(mtx, 0.7f, 0.7f, 0.7f, time, time*0.37f, 0.0f, -2.0f +ii*2.0f, 0.0f, 0.0f);
// Set model matrix for rendering.
bgfx::setTransform( mtx );
bgfx::setTransform(mtx);
// Set vertex and index buffer.
bgfx::setVertexBuffer(0, m_vbh );
bgfx::setIndexBuffer( m_ibh );
bgfx::setIndexBuffer(m_ibh);
// Bind texture.
bgfx::setTexture( 0, s_texCube, m_textureCube[ii] );
bgfx::setTexture(0, s_texCube, m_textureCube[ii]);
// Set render states.
bgfx::setState( BGFX_STATE_DEFAULT );
bgfx::setState(BGFX_STATE_DEFAULT);
// Submit primitive for rendering to view 0.
bgfx::submit( 0, m_program );
bgfx::submit(0, m_program);
}
}