MedicalVisualization
Textureinstellungen
← Texture Data | ● | 2DTexturMipmaps →
Interpolation mode of the 2D texture:
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
| filter type | filter effect |
|---|---|
| GL_LINEAR | bilinear interpolation |
| GL_NEAREST | nearest neighbor (no interpolation) |
| GL_LINEAR_MIPMAP_LINEAR | bilinear interpolation with mipmapping |
| GL_NEAREST_MIPMAP_NEAREST | nearest neighbor with mipmapping |
Extrapolation mode of the 2D texture:
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_CLAMP);
| coordinate mapping | effect |
|---|---|
| GL_CLAMP | nearest border color is extended to outside |
| GL_REPEAT | inside color is repeated as tile pattern |
Der Textur Modus der 2D Textur wird spezifiziert via:
glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
Mode of combining vertex color attribute with texture color:
| texturing mode | vertex color is modified by texture color via |
|---|---|
| GL_REPLACE | replace vertex color with texture color |
| GL_DECAL | linear interpolation with texture alpha |
| GL_MODULATE | componentwise multiplication |
| GL_BLEND | componentwise linear interpolation |
Example with red vertex color, blue texture color, partially semi-transparent texture and texture coordinate repetition:
Initially, texture mapping ist disabled in OpenGL. It is enabled with:
glEnable(GL_TEXTURE_2D);
More details in chapter #9 of the The Red Book (PDF, Codebeispiele)
← Texture Data | ● | 2DTexturMipmaps →



