瀏覽代碼

Proper depth buffer handling with minimal alpha support.

legacy
Sam Hocevar sam 14 年之前
父節點
當前提交
dae907ae98
共有 1 個檔案被更改,包括 6 行新增3 行删除
  1. +6
    -3
      src/video.cpp

+ 6
- 3
src/video.cpp 查看文件

@@ -33,13 +33,16 @@ void Video::Setup(int width, int height)
glShadeModel(GL_SMOOTH);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth(1.0);
glDisable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);

glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GEQUAL, 0.01f);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);

/* Projection matrix: once and for all */
glMatrixMode(GL_PROJECTION);
glLoadIdentity();


Loading…
取消
儲存