GRIM: Correct diffuse reflectance.

Determined by keping a single directional light source enabled, as they are
not subject to attenuation (having no position), and comparing with
original software renderer.
Default DirectX material reflects all diffuse light, so 1.0f coefficient is
likely correct.
This commit is contained in:
Vincent Pelletier 2015-03-16 22:53:52 +01:00
parent f36d2b62f8
commit 06e7aa68b0
2 changed files with 4 additions and 0 deletions

View file

@ -158,6 +158,8 @@ byte *GfxOpenGL::setupScreen(int screenW, int screenH, bool fullscreen) {
GLfloat ambientSource[] = { 0.0f, 0.0f, 0.0f, 1.0f };
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambientSource);
GLfloat diffuseReflectance[] = { 1.0f, 1.0f, 1.0f, 1.0f };
glMaterialfv(GL_FRONT, GL_DIFFUSE, diffuseReflectance);
if (g_grim->getGameType() == GType_GRIM) {
glPolygonOffset(-6.0, -6.0);

View file

@ -103,6 +103,8 @@ byte *GfxTinyGL::setupScreen(int screenW, int screenH, bool fullscreen) {
TGLfloat ambientSource[] = { 0.0f, 0.0f, 0.0f, 1.0f };
tglLightModelfv(TGL_LIGHT_MODEL_AMBIENT, ambientSource);
TGLfloat diffuseReflectance[] = { 1.0f, 1.0f, 1.0f, 1.0f };
tglMaterialfv(TGL_FRONT, TGL_DIFFUSE, diffuseReflectance);
// we now generate a buffer (id 1), which we will use as a backing buffer, where the actors' clean buffers
// will blit to. everu frame this will be blitted to screen, but the actors' buffers will be blitted to