mirror of
https://github.com/aap/librw.git
synced 2026-07-22 23:07:02 +01:00
anisotropy plugin
This commit is contained in:
@@ -527,7 +527,7 @@ static GLint addressConvMap[] = {
|
||||
};
|
||||
|
||||
static void
|
||||
setFilterMode(uint32 stage, int32 filter)
|
||||
setFilterMode(uint32 stage, int32 filter, int32 maxAniso = 1)
|
||||
{
|
||||
if(rwStateCache.texstage[stage].filter != (Texture::FilterMode)filter){
|
||||
rwStateCache.texstage[stage].filter = (Texture::FilterMode)filter;
|
||||
@@ -545,6 +545,11 @@ setFilterMode(uint32 stage, int32 filter)
|
||||
}
|
||||
natras->filterMode = filter;
|
||||
}
|
||||
if(natras->maxAnisotropy != maxAniso){
|
||||
setActiveTexture(stage);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, (float)maxAniso);
|
||||
natras->maxAnisotropy = maxAniso;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -675,7 +680,7 @@ setTexture(int32 stage, Texture *tex)
|
||||
return;
|
||||
}
|
||||
setRasterStageOnly(stage, tex->raster);
|
||||
setFilterMode(stage, tex->getFilter());
|
||||
setFilterMode(stage, tex->getFilter(), tex->getMaxAnisotropy());
|
||||
setAddressU(stage, tex->getAddressU());
|
||||
setAddressV(stage, tex->getAddressV());
|
||||
}
|
||||
@@ -1787,6 +1792,8 @@ initOpenGL(void)
|
||||
// printf("%d %s\n", i, ext);
|
||||
}
|
||||
|
||||
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &gl3Caps.maxAnisotropy);
|
||||
|
||||
if(gl3Caps.gles){
|
||||
if(gl3Caps.glversion >= 30)
|
||||
shaderDecl = shaderDecl310es;
|
||||
|
||||
Reference in New Issue
Block a user