Forum Discussion
rcapote
10 years agoHonored Guest
What is wrong with my projection?
I'm working on implementing OVR into my program, but have run into a weird issue where my triangles are being skewed incorrectly. Here is an image to demonstrate: http://i.imgur.com/FtpGXQ6.png ...
jherico
10 years agoAdventurer
"rcapote" wrote:
glm::mat4 viewMat = VR::getViewMatrix(eye);
_context.projViewMatrix = VR::_vrContext.eyeProj[eye] * viewMat;
Granted, you can compose the view and projection like this, but most people don't. Particularly when it comes to lighting, it's very important to be able to access the modelview matrix independently of the projection matrix.
"rcapote" wrote:
void setUniformMat4(const char* name, glm::mat4 matrix)
{
GLuint location = glGetUniformLocation(RenderContext::_context.boundShader.program, name);
glUniformMatrix4fv(location, 1, GL_FALSE, glm::value_ptr(matrix));
}
You might want to try adding some logging or a breakpoint in order to verify that the location being returned isn't -1 (although this seem unlikely as the cause of your error since if it was, you wouldn't see any change in the image as you moved the Rift, since you're putting the view transform in the same matrix).
What about your vertex shader, what does that look like?
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 5 months agoAnonymous
- 3 months ago