Skip to content
Permalink
Browse files

Use NEAREST texture filtering for material map

The material map is 1D texture that contains information about every
material-texture combination. There is no point in linear filtering,
i.e. trying to interpolate between two materials such as gold and granite
or whichever two materials happen to be adjacent in the material map texture.

This might or might not be relevant to #1841, but should be more correct
behavior in any case.
  • Loading branch information...
aburgm committed Nov 27, 2016
1 parent 0340a28 commit 88361ab606a3905f497077cb13f173483030e165
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/landscape/C4LandscapeRender.cpp
@@ -1030,7 +1030,8 @@ void C4LandscapeRenderGL::Draw(const C4TargetFacet &cgo, const C4FoWRegion *Ligh
BuildMatMap(MatMap);
glBindTexture(GL_TEXTURE_1D, matMapTexture);
glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA8, 2*256, 0, GL_RGBA, GL_UNSIGNED_BYTE, MatMap);
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
}

// Calculate coordinates into landscape texture

0 comments on commit 88361ab

Please sign in to comment.
You can’t perform that action at this time.