Skip to content

Commit

Permalink
Allow Metal specific default perspective camera in ShaderRenderer
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolassavva-autodesk committed Aug 21, 2023
1 parent e27b27a commit d385cc7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion source/MaterialXRender/ShaderRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ ShaderRenderer::ShaderRenderer(unsigned int width, unsigned int height, Image::B
float fW = fH * 1.0f;
_camera = Camera::create();
_camera->setViewMatrix(Camera::createViewMatrix(DEFAULT_EYE_POSITION, DEFAULT_TARGET_POSITION, DEFAULT_UP_VECTOR));
_camera->setProjectionMatrix(Camera::createPerspectiveMatrix(-fW, fW, -fH, fH, DEFAULT_NEAR_PLANE, DEFAULT_FAR_PLANE));

#if defined (__APPLE__)
_camera->setProjectionMatrix(Camera::createPerspectiveMatrixZP(-fW, fW, -fH, fH, DEFAULT_NEAR_PLANE, DEFAULT_FAR_PLANE));
#else
_camera->setProjectionMatrix(Camera::createPerspectiveMatrix(-fW, fW, -fH, fH, DEFAULT_NEAR_PLANE, DEFAULT_FAR_PLANE));
#endif
}

void ShaderRenderer::createProgram(ShaderPtr)
Expand Down

0 comments on commit d385cc7

Please sign in to comment.