Fixed: #946 Add a check for GL_ARB_texture_rectangle
This commit is contained in:
parent
40a25d55c2
commit
30bb2c72d1
4 changed files with 18 additions and 131 deletions
|
@ -315,8 +315,6 @@ CDriverGL::CDriverGL()
|
|||
for(i=0;i<MaxLight;i++)
|
||||
_LightDirty[i]= false;
|
||||
|
||||
|
||||
|
||||
_CurrentGlNormalize= false;
|
||||
_ForceNormalize= false;
|
||||
|
||||
|
@ -747,7 +745,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
/* After determining a compatible pixel format, the next step is to create a pbuffer of the
|
||||
chosen format. Fortunately this step is fairly easy, as you merely select one of the formats
|
||||
returned in the list in step #2 and call the function: */
|
||||
|
@ -1273,7 +1270,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
|
|||
_UserLightEnable[i]= false;
|
||||
|
||||
// init _DriverGLStates
|
||||
_DriverGLStates.init(_Extensions.ARBTextureCubeMap, (_Extensions.NVTextureRectangle || _Extensions.EXTTextureRectangle), _MaxDriverLight);
|
||||
_DriverGLStates.init(_Extensions.ARBTextureCubeMap, (_Extensions.NVTextureRectangle || _Extensions.EXTTextureRectangle || _Extensions.ARBTextureRectangle), _MaxDriverLight);
|
||||
|
||||
|
||||
// Init OpenGL/Driver defaults.
|
||||
|
@ -1294,7 +1291,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
|
|||
glDisable(GL_NORMALIZE);
|
||||
glDisable(GL_COLOR_SUM_EXT);
|
||||
|
||||
|
||||
_CurrViewport.init(0.f, 0.f, 1.f, 1.f);
|
||||
_CurrScissor.initFullScreen();
|
||||
_CurrentGlNormalize= false;
|
||||
|
@ -1434,8 +1430,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
|
|||
params[0]=0; params[1]=0; params[2]=0; params[3]=1;
|
||||
glTexGenfv(GL_Q, GL_OBJECT_PLANE, params);
|
||||
glTexGenfv(GL_Q, GL_EYE_PLANE, params);
|
||||
|
||||
|
||||
}
|
||||
resetTextureShaders();
|
||||
|
||||
|
@ -1449,7 +1443,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
|
|||
// use enableLighting(0....), to get normal behaviour
|
||||
_DriverGLStates.enableLight(0, true);
|
||||
|
||||
|
||||
_Initialized = true;
|
||||
|
||||
_ForceDXTCCompression= false;
|
||||
|
@ -1473,7 +1466,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
|
|||
_EVSNormalHandle = nglBindParameterEXT(GL_CURRENT_NORMAL);
|
||||
_EVSColorHandle = nglBindParameterEXT(GL_CURRENT_COLOR);
|
||||
|
||||
|
||||
if (!_EVSPositionHandle || !_EVSNormalHandle || !_EVSColorHandle)
|
||||
{
|
||||
nlwarning("Unable to bind input parameters for use with EXT_vertex_shader, vertex program support is disabled");
|
||||
|
@ -1485,8 +1477,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
|
|||
for(uint k = 0; k < 8; ++k)
|
||||
{
|
||||
_EVSTexHandle[k] = nglBindTextureUnitParameterEXT(GL_TEXTURE0_ARB + k, GL_CURRENT_TEXTURE_COORDS);
|
||||
|
||||
|
||||
}
|
||||
// Other attributes are managed using variant pointers :
|
||||
// Secondary color
|
||||
|
@ -1498,8 +1488,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
|
|||
// Allocate invariants. One assitionnal variant is needed for fog coordinate if fog bug is not fixed in driver version
|
||||
_EVSConstantHandle = nglGenSymbolsEXT(GL_VECTOR_EXT, GL_INVARIANT_EXT, GL_FULL_RANGE_EXT, _EVSNumConstant + (_ATIFogRangeFixed ? 0 : 1));
|
||||
|
||||
|
||||
|
||||
if (_EVSConstantHandle == 0)
|
||||
{
|
||||
nlwarning("Unable to allocate constants for EXT_vertex_shader, vertex program support is disabled");
|
||||
|
@ -1827,8 +1815,6 @@ bool CDriverGL::activate()
|
|||
if (nctx != NULL && nctx!=ctx)
|
||||
{
|
||||
glXMakeCurrent(dpy, win,ctx);
|
||||
|
||||
|
||||
}
|
||||
#endif // NL_OS_WINDOWS
|
||||
return true;
|
||||
|
@ -1860,11 +1846,8 @@ bool CDriverGL::clear2D(CRGBA rgba)
|
|||
H_AUTO_OGL(CDriverGL_clear2D)
|
||||
glClearColor((float)rgba.R/255.0f,(float)rgba.G/255.0f,(float)rgba.B/255.0f,(float)rgba.A/255.0f);
|
||||
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1875,12 +1858,9 @@ bool CDriverGL::clearZBuffer(float zval)
|
|||
H_AUTO_OGL(CDriverGL_clearZBuffer)
|
||||
glClearDepth(zval);
|
||||
|
||||
|
||||
_DriverGLStates.enableZWrite(true);
|
||||
glClear(GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1891,10 +1871,8 @@ bool CDriverGL::clearStencilBuffer(float stencilval)
|
|||
H_AUTO_OGL(CDriverGL_clearStencilBuffer)
|
||||
glClearStencil((int)stencilval);
|
||||
|
||||
|
||||
glClear(GL_STENCIL_BUFFER_BIT);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1904,8 +1882,6 @@ void CDriverGL::setColorMask (bool bRed, bool bGreen, bool bBlue, bool bAlpha)
|
|||
{
|
||||
H_AUTO_OGL(CDriverGL_setColorMask )
|
||||
glColorMask (bRed, bGreen, bBlue, bAlpha);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
|
@ -1995,17 +1971,12 @@ bool CDriverGL::swapBuffers()
|
|||
if (_VRAMVertexArrayRange) _VRAMVertexArrayRange->updateLostBuffers();
|
||||
}
|
||||
|
||||
|
||||
#ifdef NL_OS_WINDOWS
|
||||
SwapBuffers(_hDC);
|
||||
#else // NL_OS_WINDOWS
|
||||
glXSwapBuffers(dpy, win);
|
||||
|
||||
|
||||
#endif // NL_OS_WINDOWS
|
||||
|
||||
|
||||
|
||||
// Activate the default texture environnments for all stages.
|
||||
//===========================================================
|
||||
// This is not a requirement, but it ensure a more stable state each frame.
|
||||
|
@ -2024,7 +1995,6 @@ bool CDriverGL::swapBuffers()
|
|||
forceActivateTexEnvColor(stage, env);
|
||||
}
|
||||
|
||||
|
||||
// Activate the default material.
|
||||
//===========================================================
|
||||
// Same reasoning as textures :)
|
||||
|
@ -2032,8 +2002,6 @@ bool CDriverGL::swapBuffers()
|
|||
if (_NVTextureShaderEnabled)
|
||||
{
|
||||
glDisable(GL_TEXTURE_SHADER_NV);
|
||||
|
||||
|
||||
_NVTextureShaderEnabled = false;
|
||||
}
|
||||
_CurrentMaterial= NULL;
|
||||
|
@ -2086,8 +2054,6 @@ bool CDriverGL::release()
|
|||
// Reset VertexArrayRange.
|
||||
resetVertexArrayRange();
|
||||
|
||||
|
||||
|
||||
// delete containers
|
||||
delete _AGPVertexArrayRange;
|
||||
delete _VRAMVertexArrayRange;
|
||||
|
@ -2674,8 +2640,6 @@ bool CDriverGL::fillBuffer (CBitmap &bitmap)
|
|||
glPixelStorei(GL_UNPACK_ALIGNMENT,1);
|
||||
glDrawPixels (rect.Width, rect.Height, GL_RGBA, GL_UNSIGNED_BYTE, &(bitmap.getPixels()[0]) );
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2747,8 +2711,6 @@ void CDriverGL::setPolygonMode (TPolygonMode mode)
|
|||
glPolygonMode (GL_FRONT_AND_BACK, GL_POINT);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -2798,8 +2760,6 @@ void CDriverGL::setupFog(float start, float end, CRGBA color)
|
|||
}
|
||||
_FogStart = start;
|
||||
_FogEnd = end;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -2950,8 +2910,6 @@ void CDriverGL::setMatrix2DForTextureOffsetAddrMode(const uint stage, const floa
|
|||
nlassert(stage < inlGetNumTextStages() );
|
||||
_DriverGLStates.activeTextureARB(stage);
|
||||
glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, mat);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -2972,8 +2930,6 @@ void CDriverGL::enableNVTextureShader(bool enabled)
|
|||
glDisable(GL_TEXTURE_SHADER_NV);
|
||||
}
|
||||
_NVTextureShaderEnabled = enabled;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3127,6 +3083,7 @@ bool CDriverGL::supportBlendConstantColor() const
|
|||
H_AUTO_OGL(CDriverGL_supportBlendConstantColor)
|
||||
return _Extensions.EXTBlendColor;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
void CDriverGL::setBlendConstantColor(NLMISC::CRGBA col)
|
||||
{
|
||||
|
@ -3140,9 +3097,8 @@ void CDriverGL::setBlendConstantColor(NLMISC::CRGBA col)
|
|||
return;
|
||||
static const float OO255= 1.0f/255;
|
||||
nglBlendColorEXT(col.R*OO255, col.G*OO255, col.B*OO255, col.A*OO255);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
NLMISC::CRGBA CDriverGL::getBlendConstantColor() const
|
||||
{
|
||||
|
@ -3169,11 +3125,8 @@ void CDriverGL::refreshProjMatrixFromGL()
|
|||
glGetFloatv(GL_PROJECTION_MATRIX, mat);
|
||||
_GLProjMat.set(mat);
|
||||
_ProjMatDirty = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
bool CDriverGL::setMonitorColorProperties (const CMonitorColorProperties &properties)
|
||||
{
|
||||
|
@ -3273,7 +3226,6 @@ void CDriverGL::initEMBM()
|
|||
{
|
||||
H_AUTO_OGL(CDriverGL_initEMBM)
|
||||
|
||||
|
||||
if (supportEMBM())
|
||||
{
|
||||
std::fill(_StageSupportEMBM, _StageSupportEMBM + IDRV_MAT_MAXTEXTURES, false);
|
||||
|
@ -3741,7 +3693,6 @@ void CDriverGL::enablePolygonSmoothing(bool smooth)
|
|||
else
|
||||
glDisable(GL_POLYGON_SMOOTH);
|
||||
|
||||
|
||||
_PolygonSmooth= smooth;
|
||||
}
|
||||
|
||||
|
@ -3756,7 +3707,6 @@ bool CDriverGL::isPolygonSmoothingEnabled() const
|
|||
// ***************************************************************************
|
||||
void CDriverGL::startProfileVBHardLock()
|
||||
{
|
||||
|
||||
if(_VBHardProfiling)
|
||||
return;
|
||||
|
||||
|
@ -3771,7 +3721,6 @@ void CDriverGL::startProfileVBHardLock()
|
|||
// ***************************************************************************
|
||||
void CDriverGL::endProfileVBHardLock(vector<std::string> &result)
|
||||
{
|
||||
|
||||
if(!_VBHardProfiling)
|
||||
return;
|
||||
|
||||
|
@ -3810,7 +3759,6 @@ void CDriverGL::endProfileVBHardLock(vector<std::string> &result)
|
|||
// ***************************************************************************
|
||||
void CDriverGL::appendVBHardLockProfile(NLMISC::TTicks time, CVertexBuffer *vb)
|
||||
{
|
||||
|
||||
// must allocate a new place?
|
||||
if(_CurVBHardLockCount>=_VBHardProfiles.size())
|
||||
{
|
||||
|
@ -3854,7 +3802,6 @@ void CDriverGL::profileIBAllocation(std::vector<std::string> &/* result */)
|
|||
// ***************************************************************************
|
||||
void CDriverGL::profileVBHardAllocation(std::vector<std::string> &result)
|
||||
{
|
||||
|
||||
result.clear();
|
||||
result.reserve(1000);
|
||||
result.push_back(toString("Memory Allocated: %4d Ko in AGP / %4d Ko in VRAM",
|
||||
|
@ -4074,7 +4021,6 @@ bool CDriverGL::activeShader(CShader * /* shd */)
|
|||
|
||||
void CDriverGL::startBench (bool wantStandardDeviation, bool quick, bool reset)
|
||||
{
|
||||
|
||||
CHTimer::startBench (wantStandardDeviation, quick, reset);
|
||||
}
|
||||
|
||||
|
@ -4082,7 +4028,6 @@ void CDriverGL::startBench (bool wantStandardDeviation, bool quick, bool reset)
|
|||
|
||||
void CDriverGL::endBench ()
|
||||
{
|
||||
|
||||
CHTimer::endBench ();
|
||||
}
|
||||
|
||||
|
@ -4090,7 +4035,6 @@ void CDriverGL::endBench ()
|
|||
|
||||
void CDriverGL::displayBench (class NLMISC::CLog *log)
|
||||
{
|
||||
|
||||
// diplay
|
||||
CHTimer::displayHierarchicalByExecutionPathSorted(log, CHTimer::TotalTime, true, 48, 2);
|
||||
CHTimer::displayHierarchical(log, true, 48, 2);
|
||||
|
@ -4113,7 +4057,7 @@ void CDriverGL::checkTextureOn() const
|
|||
// tmp for debug
|
||||
CDriverGLStates &dgs = const_cast<CDriverGLStates &>(_DriverGLStates);
|
||||
uint currTexStage = dgs.getActiveTextureARB();
|
||||
for(uint k = 0; k < getNbTextureStages(); ++k)
|
||||
for(uint k = 0; k < this->getNbTextureStages(); ++k)
|
||||
{
|
||||
dgs.activeTextureARB(k);
|
||||
GLboolean flag2D;
|
||||
|
@ -4158,8 +4102,7 @@ bool CDriverGL::supportOcclusionQuery() const
|
|||
bool CDriverGL::supportTextureRectangle() const
|
||||
{
|
||||
H_AUTO_OGL(CDriverGL_supportTextureRectangle)
|
||||
return (_Extensions.NVTextureRectangle ||
|
||||
_Extensions.EXTTextureRectangle);
|
||||
return (_Extensions.NVTextureRectangle || _Extensions.EXTTextureRectangle || _Extensions.ARBTextureRectangle);
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
|
|
@ -1151,6 +1151,14 @@ static bool setupEXTTextureRectangle(const char *glext)
|
|||
return true;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
static bool setupARBTextureRectangle(const char *glext)
|
||||
{
|
||||
H_AUTO_OGL(setupARBTextureRectangle);
|
||||
CHECK_EXT("GL_ARB_texture_rectangle");
|
||||
return true;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
static bool setupFrameBufferObject(const char *glext)
|
||||
{
|
||||
|
@ -1322,6 +1330,9 @@ void registerGlExtensions(CGlExtensions &ext)
|
|||
// Check GL_EXT_texture_rectangle
|
||||
ext.EXTTextureRectangle = setupEXTTextureRectangle(glext);
|
||||
|
||||
// Check GL_ARB_texture_rectangle
|
||||
ext.ARBTextureRectangle = setupARBTextureRectangle(glext);
|
||||
|
||||
// Check GL_EXT_framebuffer_object
|
||||
ext.FrameBufferObject = setupFrameBufferObject(glext);
|
||||
|
||||
|
|
|
@ -71,6 +71,7 @@ struct CGlExtensions
|
|||
bool NVOcclusionQuery;
|
||||
bool NVTextureRectangle;
|
||||
bool EXTTextureRectangle;
|
||||
bool ARBTextureRectangle;
|
||||
bool FrameBufferObject;
|
||||
bool PackedDepthStencil;
|
||||
// true if NVVertexProgram and if we know that VP is emulated
|
||||
|
@ -183,6 +184,7 @@ public:
|
|||
result += ATIEnvMapBumpMap ? "ATIEnvMapBumpMap " : "";
|
||||
result += NVTextureRectangle ? "NVTextureRectangle " : "";
|
||||
result += EXTTextureRectangle ? "EXTTextureRectangle " : "";
|
||||
result += ARBTextureRectangle ? "ARBTextureRectangle " : "";
|
||||
result += ARBTextureNonPowerOfTwo ? "ARBTextureNonPowerOfTwo " : "";
|
||||
result += "texture stages(*) = ";
|
||||
result += NLMISC::toString(NbTextureStages);
|
||||
|
|
|
@ -97,7 +97,6 @@ static inline void convTexAddr(ITexture *tex, CMaterial::TTexAddressingMode mode
|
|||
GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV, GL_DOT_PRODUCT_DEPTH_REPLACE_NV
|
||||
};
|
||||
|
||||
|
||||
if (!tex || !tex->isTextureCube())
|
||||
{
|
||||
glenum = glTex2dAddrModesNV[(uint) mode];
|
||||
|
@ -165,7 +164,6 @@ void CDriverGL::setupUserTextureMatrix(uint numStages, CMaterial& mat)
|
|||
{
|
||||
glMatrixMode(GL_TEXTURE);
|
||||
|
||||
|
||||
// for each stage, setup the texture matrix if needed
|
||||
uint newMask = (mat.getFlags() & IDRV_MAT_USER_TEX_MAT_ALL) >> IDRV_MAT_USER_TEX_FIRST_BIT;
|
||||
uint shiftMask = 1;
|
||||
|
@ -176,7 +174,6 @@ void CDriverGL::setupUserTextureMatrix(uint numStages, CMaterial& mat)
|
|||
_DriverGLStates.activeTextureARB(k);
|
||||
glLoadMatrixf(mat.getUserTexMat(k).get());
|
||||
|
||||
|
||||
_UserTexMatEnabled |= shiftMask;
|
||||
}
|
||||
else
|
||||
|
@ -189,15 +186,12 @@ void CDriverGL::setupUserTextureMatrix(uint numStages, CMaterial& mat)
|
|||
_DriverGLStates.activeTextureARB(k);
|
||||
glLoadIdentity();
|
||||
|
||||
|
||||
_UserTexMatEnabled &= ~shiftMask;
|
||||
}
|
||||
}
|
||||
shiftMask <<= 1;
|
||||
}
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -208,7 +202,6 @@ void CDriverGL::disableUserTextureMatrix()
|
|||
{
|
||||
glMatrixMode(GL_TEXTURE);
|
||||
|
||||
|
||||
uint k = 0;
|
||||
do
|
||||
{
|
||||
|
@ -217,16 +210,12 @@ void CDriverGL::disableUserTextureMatrix()
|
|||
_DriverGLStates.activeTextureARB(k);
|
||||
glLoadIdentity();
|
||||
|
||||
|
||||
_UserTexMatEnabled &= ~ (1 << k);
|
||||
|
||||
}
|
||||
++k;
|
||||
}
|
||||
while (_UserTexMatEnabled != 0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -259,7 +248,6 @@ void CDriverGL::setTextureShaders(const uint8 *addressingModes, const CSmartPtr<
|
|||
convTexAddr(textures[stage], (CMaterial::TTexAddressingMode) addressingModes[stage], glAddrMode);
|
||||
|
||||
if (glAddrMode != _CurrentTexAddrMode[stage]) // addressing mode different from the one in the device?
|
||||
|
||||
{
|
||||
_DriverGLStates.activeTextureARB(stage);
|
||||
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, glAddrMode);
|
||||
|
@ -404,7 +392,6 @@ bool CDriverGL::setupMaterial(CMaterial& mat)
|
|||
if (mat.getTexture(stage))
|
||||
}*/
|
||||
|
||||
|
||||
// Activate the textures.
|
||||
// Do not do it for Lightmap and per pixel lighting , because done in multipass in a very special fashion.
|
||||
// This avoid the useless multiple change of texture states per lightmapped object.
|
||||
|
@ -490,16 +477,13 @@ bool CDriverGL::setupMaterial(CMaterial& mat)
|
|||
}
|
||||
else
|
||||
{
|
||||
|
||||
// Color unlit part.
|
||||
CRGBA col= mat.getColor();
|
||||
glColor4ub(col.R, col.G, col.B, col.A);
|
||||
|
||||
|
||||
_DriverGLStates.setVertexColorLighted(false);
|
||||
}
|
||||
|
||||
|
||||
// Fog Part.
|
||||
//=================
|
||||
|
||||
|
@ -745,7 +729,6 @@ void CDriverGL::setupLightMapPass(uint pass)
|
|||
static uint32 packedColorGrey= CRGBA(128,128,128,128).getPacked();
|
||||
static GLfloat glcolGrey[4]= {0.5f,0.5f,0.5f,1.f};
|
||||
|
||||
|
||||
// No lightmap or all blacks??, just setup "black texture" for stage 0.
|
||||
if(_NLightMaps==0)
|
||||
{
|
||||
|
@ -760,7 +743,6 @@ void CDriverGL::setupLightMapPass(uint pass)
|
|||
// setup color to 0 => blackness. in emissive cause texture can still be lighted by dynamic light
|
||||
_DriverGLStates.setEmissive(packedColorBlack, glcolBlack);
|
||||
|
||||
|
||||
// Setup gen tex off
|
||||
_DriverGLStates.activeTextureARB(0);
|
||||
_DriverGLStates.setTexGenMode(0, 0);
|
||||
|
@ -900,8 +882,6 @@ void CDriverGL::setupLightMapPass(uint pass)
|
|||
// Arg3.
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_NV, GL_ZERO);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_NV, GL_ONE_MINUS_SRC_COLOR);
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -920,8 +900,6 @@ void CDriverGL::setupLightMapPass(uint pass)
|
|||
// Arg2.
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_PREVIOUS_EXT );
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -965,8 +943,6 @@ void CDriverGL::setupLightMapPass(uint pass)
|
|||
{
|
||||
// Multiply x 2
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, 2);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -988,8 +964,6 @@ void CDriverGL::setupLightMapPass(uint pass)
|
|||
{
|
||||
static GLfloat blackFog[4]= {0,0,0,0};
|
||||
glFogfv(GL_FOG_COLOR, blackFog);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Blend is different if the material is blended or not
|
||||
|
@ -1051,8 +1025,6 @@ void CDriverGL::setupLightMapPass(uint pass)
|
|||
// no need to reset for pass after 1, since same than prec pass (black)!
|
||||
else if(pass==1)
|
||||
_DriverGLStates.setDiffuse(packedColorBlack, glcolBlack);
|
||||
|
||||
|
||||
}
|
||||
// ***************************************************************************
|
||||
void CDriverGL::endLightMapMultiPass()
|
||||
|
@ -1081,8 +1053,6 @@ void CDriverGL::endLightMapMultiPass()
|
|||
{
|
||||
_DriverGLStates.activeTextureARB(i);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, 1);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1180,8 +1150,6 @@ void CDriverGL::setupSpecularEnd()
|
|||
glMatrixMode(GL_TEXTURE);
|
||||
glLoadIdentity();
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
@ -1286,8 +1254,6 @@ void CDriverGL::setupSpecularPass(uint pass)
|
|||
// Arg3.
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_ALPHA_NV, GL_ZERO );
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_ALPHA_NV, GL_SRC_ALPHA);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else if (_Extensions.ATITextureEnvCombine3)
|
||||
|
@ -1340,8 +1306,6 @@ void CDriverGL::setupSpecularPass(uint pass)
|
|||
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_EXT, GL_ZERO );
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, GL_SRC_ALPHA);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{ // We have to do it in 2 passes
|
||||
|
@ -1390,8 +1354,6 @@ void CDriverGL::setupSpecularPass(uint pass)
|
|||
activateTexEnvMode(1, env);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// ***************************************************************************
|
||||
void CDriverGL::endSpecularMultiPass()
|
||||
|
@ -1470,14 +1432,12 @@ CTextureCube *CDriverGL::getSpecularCubeMap(uint exp)
|
|||
_SpecularTextureCubes.resize(MaxExponent);
|
||||
}
|
||||
|
||||
|
||||
NLMISC::clamp(exp, 1u, (MaxExponent - 1));
|
||||
|
||||
|
||||
uint cubeMapIndex = expToCubeMap[exp];
|
||||
nlassert(cubeMapIndex < numCubeMap);
|
||||
|
||||
|
||||
if (_SpecularTextureCubes[cubeMapIndex] != NULL) // has the cube map already been cted ?
|
||||
{
|
||||
return _SpecularTextureCubes[cubeMapIndex];
|
||||
|
@ -1607,8 +1567,6 @@ void CDriverGL::setupPPLPass(uint pass)
|
|||
// Arg3 = White (= ~ Black)
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_NV, GL_ZERO);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_NV, GL_ONE_MINUS_SRC_COLOR);
|
||||
|
||||
|
||||
}
|
||||
else // use ATI extension
|
||||
{
|
||||
|
@ -1624,8 +1582,6 @@ void CDriverGL::setupPPLPass(uint pass)
|
|||
// Arg2 = Primary color (other light diffuse and
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_PRIMARY_COLOR_EXT);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
activateTexEnvColor(0, _PPLightDiffuseColor);
|
||||
|
@ -1678,8 +1634,6 @@ void CDriverGL::setupPPLPass(uint pass)
|
|||
// Arg3 = 0
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_ALPHA_NV, GL_ZERO);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_ALPHA_NV, GL_SRC_COLOR);
|
||||
|
||||
|
||||
}
|
||||
else // ATI EnvCombine3
|
||||
{
|
||||
|
@ -1707,8 +1661,6 @@ void CDriverGL::setupPPLPass(uint pass)
|
|||
// Arg1 = 0
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA_EXT, GL_ZERO);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_EXT, GL_SRC_COLOR);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
activateTexEnvColor(2, _PPLightSpecularColor);
|
||||
|
@ -1785,8 +1737,6 @@ void CDriverGL::setupPPLNoSpecPass(uint pass)
|
|||
// Arg3 = White (= ~ Black)
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE3_RGB_NV, GL_ZERO);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND3_RGB_NV, GL_ONE_MINUS_SRC_COLOR);
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1802,8 +1752,6 @@ void CDriverGL::setupPPLNoSpecPass(uint pass)
|
|||
// Arg1 = Primary color (other light diffuse and
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_PRIMARY_COLOR_EXT);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
activateTexEnvColor(0, _PPLightDiffuseColor);
|
||||
|
@ -1860,7 +1808,6 @@ inline void CDriverGL::setupCausticsSecondTex(uint stage)
|
|||
// ***************************************************************************
|
||||
void CDriverGL::setupCausticsPass(const CMaterial &mat, uint pass)
|
||||
{
|
||||
|
||||
nlassert(mat.getShader() == CMaterial::Caustics);
|
||||
|
||||
if (inlGetNumTextStages() == 1 || !_Extensions.ARBTextureCubeMap)
|
||||
|
@ -1873,8 +1820,6 @@ void CDriverGL::setupCausticsPass(const CMaterial &mat, uint pass)
|
|||
nlassert(pass == 0);
|
||||
|
||||
setupCausticsFirstTex(mat);
|
||||
|
||||
|
||||
}
|
||||
else if (inlGetNumTextStages() == 2) /// do in in 2 pass
|
||||
{
|
||||
|
@ -1888,8 +1833,6 @@ void CDriverGL::setupCausticsPass(const CMaterial &mat, uint pass)
|
|||
/// setup additif blending
|
||||
_DriverGLStates.enableBlend();
|
||||
_DriverGLStates.blendFunc(pShader->SrcBlend, pShader->DstBlend);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2002,8 +1945,6 @@ void CDriverGL::setupCloudPass (uint /* pass */)
|
|||
glEnable(GL_FRAGMENT_SHADER_ATI);
|
||||
float cst[4] = { 0.f, 0.f, 0.f, mat.getColor().A / 255.f };
|
||||
nglSetFragmentShaderConstantATI(GL_CON_0_ATI, cst);
|
||||
|
||||
|
||||
/*
|
||||
_DriverGLStates.activeTextureARB(0);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
|
||||
|
@ -2188,7 +2129,6 @@ void CDriverGL::setupWaterPassARB(const CMaterial &mat)
|
|||
nglBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, ARBWaterShader[(_FogEnabled ? 1 : 0) | (mat.getTexture(3) != NULL ? 2 : 0)]);
|
||||
glEnable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
|
||||
|
||||
// setup the constant
|
||||
if (mat.getTexture(0) && mat.getTexture(0)->isBumpMap())
|
||||
{
|
||||
|
@ -2233,7 +2173,6 @@ void CDriverGL::setupWaterPassARB(const CMaterial &mat)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -2291,14 +2230,10 @@ void CDriverGL::setupWaterPassNV20(const CMaterial &mat)
|
|||
float factor = tb->getNormalizationFactor();
|
||||
float tsMatrix[4] = { 0.25f * factor, 0.f, 0.f, 0.25f * factor };
|
||||
glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, tsMatrix);
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, IdentityTexMat);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
tex = mat.getTexture(1);
|
||||
|
@ -2314,14 +2249,10 @@ void CDriverGL::setupWaterPassNV20(const CMaterial &mat)
|
|||
float factor = tb->getNormalizationFactor();
|
||||
float tsMatrix[4] = { factor, 0.f, 0.f, factor };
|
||||
glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, tsMatrix);
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, IdentityTexMat);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
tex = mat.getTexture(2);
|
||||
|
|
Loading…
Reference in a new issue