BGE: Adding two new functions to bge.render to allow users to change the anisotropic filtering level used by textures:
* setAnisotropicFiltering(level) * getAnisotropicFiltering()
This commit is contained in:
@@ -99,12 +99,16 @@ RAS_OpenGLRasterizer::RAS_OpenGLRasterizer(RAS_ICanvas* canvas)
|
||||
hinterlace_mask[i] = (i&1)*0xFFFFFFFF;
|
||||
}
|
||||
hinterlace_mask[32] = 0;
|
||||
|
||||
m_prevafvalue = GPU_get_anisotropic();
|
||||
}
|
||||
|
||||
|
||||
|
||||
RAS_OpenGLRasterizer::~RAS_OpenGLRasterizer()
|
||||
{
|
||||
// Restore the previous AF value
|
||||
GPU_set_anisotropic(m_prevafvalue);
|
||||
}
|
||||
|
||||
bool RAS_OpenGLRasterizer::Init()
|
||||
@@ -1204,3 +1208,12 @@ void RAS_OpenGLRasterizer::SetFrontFace(bool ccw)
|
||||
m_last_frontface = ccw;
|
||||
}
|
||||
|
||||
void RAS_OpenGLRasterizer::SetAnisotropicFiltering(short level)
|
||||
{
|
||||
GPU_set_anisotropic((float)level);
|
||||
}
|
||||
|
||||
short RAS_OpenGLRasterizer::GetAnisotropicFiltering()
|
||||
{
|
||||
return (short)GPU_get_anisotropic();
|
||||
}
|
||||
|
@@ -94,6 +94,8 @@ class RAS_OpenGLRasterizer : public RAS_IRasterizer
|
||||
bool m_setfocallength;
|
||||
int m_noOfScanlines;
|
||||
|
||||
short m_prevafvalue;
|
||||
|
||||
//motion blur
|
||||
int m_motionblur;
|
||||
float m_motionblurvalue;
|
||||
@@ -294,6 +296,9 @@ public:
|
||||
virtual void SetBlendingMode(int blendmode);
|
||||
virtual void SetFrontFace(bool ccw);
|
||||
|
||||
virtual void SetAnisotropicFiltering(short level);
|
||||
virtual short GetAnisotropicFiltering();
|
||||
|
||||
|
||||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
public:
|
||||
|
Reference in New Issue
Block a user