review vr stuff, fix controller-ui ray casting
This commit is contained in:
@@ -224,8 +224,10 @@ void NodePanelGrid::draw_heightmap(const glm::mat4& proj, const glm::mat4& camer
|
||||
|
||||
auto nav = m_hm_image.m_data ? -(m_hm_preview_nav->m_value - 0.5f) : glm::vec2(0);
|
||||
auto mvp = proj * camera
|
||||
* glm::scale(glm::vec3(100))
|
||||
* glm::translate(glm::vec3(0, get_offset(), 0))
|
||||
* glm::translate(glm::vec3(nav.x, get_offset(), nav.y));
|
||||
* glm::translate(glm::vec3(nav.x, get_offset(), nav.y))
|
||||
;
|
||||
|
||||
auto light_yaw = m_hm_lyaw->get_value() * glm::pi<float>() * 2.f;
|
||||
auto light_pitch = m_hm_lpitch->get_value() * 5;
|
||||
@@ -303,9 +305,11 @@ void NodePanelGrid::draw_heightmap(const glm::mat4& proj, const glm::mat4& camer
|
||||
glGetIntegerv(GL_VIEWPORT, vp);
|
||||
auto aspect_ratio = (float)vp[3] / (float)vp[2];
|
||||
glEnable(GL_BLEND);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
ShaderManager::use(kShader::Texture);
|
||||
ShaderManager::u_int(kShaderUniform::Tex, 0);
|
||||
ShaderManager::u_mat4(kShaderUniform::MVP, glm::ortho(-1.f, 1.f, -1.f, 1.f) *
|
||||
glm::scale(glm::vec3(100)) *
|
||||
glm::translate(glm::vec3(p2d, 0)) * glm::scale(glm::vec3(.1f * aspect_ratio, .1f, 1.f)));
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
m_sampler_linear.bind(0);
|
||||
|
||||
Reference in New Issue
Block a user