|
|
|
|
@ -141,29 +141,14 @@ render_cb_pre(RenderState* rs)
|
|
|
|
|
cam_pos += cam_mov; |
|
|
|
|
rs->xforms->view_xform = glm::lookAt(cam_pos, look_pos, glm::vec3(0, 1, 0)); |
|
|
|
|
|
|
|
|
|
#if 1 |
|
|
|
|
// TODO: make helper function for getting UBO by name in shader.h
|
|
|
|
|
static GLBuffer* xform_ubo = nullptr; |
|
|
|
|
u64 h_search = utilFNV64a_str("matrices"); |
|
|
|
|
|
|
|
|
|
if (!xform_ubo) { |
|
|
|
|
for (u32 i = 0; i < rs->gl_ctx->num_ubos; i++) { |
|
|
|
|
GLBuffer* buf = &rs->gl_ctx->uniform_buffers[i]; |
|
|
|
|
|
|
|
|
|
if (buf->name != nullptr) { |
|
|
|
|
u64 hash = utilFNV64a_str(buf->name); |
|
|
|
|
if (hash == h_search) |
|
|
|
|
xform_ubo = buf; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!xform_ubo) |
|
|
|
|
LOGF(Error, "matrices ubo not found\n"); |
|
|
|
|
xform_ubo = getUBOByName(rs->gl_ctx, "matrices"); |
|
|
|
|
assert(xform_ubo != nullptr); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
updateCameraTransforms(rs->xforms, xform_ubo); |
|
|
|
|
////
|
|
|
|
|
#endif |
|
|
|
|
#if 0 |
|
|
|
|
for (u32 i = 0; i < rs->num_render_groups; i++) { |
|
|
|
|
RenderGroup& rg = rs->render_groups[i]; |
|
|
|
|
|