mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2025-01-13 18:00:09 +00:00
Adjust near clipping plane in glViewer automatically when SSAO is turned off
- when SSAO is turned off, we can bring the near clipping plane much closer to help close-up inspection...
This commit is contained in:
parent
f145f70fd2
commit
7d07e341e0
@ -108,6 +108,10 @@ public:
|
||||
virtual void BuildUI(GLhud * hud, int x, int y);
|
||||
|
||||
void SetActive(bool value);
|
||||
|
||||
bool IsActive() const {
|
||||
return _active;
|
||||
}
|
||||
|
||||
void SetRadius(float value);
|
||||
|
||||
|
@ -1115,7 +1115,8 @@ bindProgram(Effect effect, OpenSubdiv::Osd::DrawContext::PatchArray const & patc
|
||||
static void
|
||||
display() {
|
||||
|
||||
g_hud.GetFrameBuffer()->Bind();
|
||||
SSAOGLFrameBuffer * fb = (SSAOGLFrameBuffer *)g_hud.GetFrameBuffer();
|
||||
fb->Bind();
|
||||
|
||||
Stopwatch s;
|
||||
s.Start();
|
||||
@ -1134,7 +1135,7 @@ display() {
|
||||
translate(g_transformData.ModelViewMatrix,
|
||||
-g_center[0], -g_center[1], -g_center[2]);
|
||||
perspective(g_transformData.ProjectionMatrix,
|
||||
45.0f, (float)aspect, 1.0f, 500.0f);
|
||||
45.0f, (float)aspect, fb->IsActive() ? 1.0f : 0.0001f, 500.0f);
|
||||
multMatrix(g_transformData.ModelViewProjectionMatrix,
|
||||
g_transformData.ModelViewMatrix,
|
||||
g_transformData.ProjectionMatrix);
|
||||
@ -1255,7 +1256,7 @@ display() {
|
||||
if (g_drawCageVertices)
|
||||
drawCageVertices();
|
||||
|
||||
g_hud.GetFrameBuffer()->ApplyImageShader();
|
||||
fb->ApplyImageShader();
|
||||
|
||||
GLuint numPrimsGenerated = 0;
|
||||
GLuint timeElapsed = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user