diff --git a/Engine/source/gui/controls/guiColorPicker.cpp b/Engine/source/gui/controls/guiColorPicker.cpp index e6ea1ad12..bc65ee8f9 100644 --- a/Engine/source/gui/controls/guiColorPicker.cpp +++ b/Engine/source/gui/controls/guiColorPicker.cpp @@ -353,9 +353,7 @@ void GuiColorPickerCtrl::onRender(Point2I offset, const RectI& updateRect) Point2I resolution = getRoot()->getExtent(); U32 buf_x = offset.x + mSelectorPos.x + 1; - U32 buf_y = ( extent.y - ( offset.y + mSelectorPos.y + 1 ) ); - if(GFX->getAdapterType() != OpenGL) - buf_y = resolution.y - buf_y; + U32 buf_y = resolution.y - ( extent.y - ( offset.y + mSelectorPos.y + 1 ) ); GFXTexHandle bb( resolution.x, resolution.y, diff --git a/Engine/source/lighting/lightManager.cpp b/Engine/source/lighting/lightManager.cpp index c26ec3db4..2e2c4ff2e 100644 --- a/Engine/source/lighting/lightManager.cpp +++ b/Engine/source/lighting/lightManager.cpp @@ -312,14 +312,8 @@ void LightManager::_update4LightConsts( const SceneData &sgData, { PROFILE_SCOPE( LightManager_Update4LightConsts_setLights ); - // NOTE: We haven't ported the lighting shaders on OSX - // to the optimized HLSL versions. - #if defined( TORQUE_OS_MAC ) || defined( TORQUE_OS_LINUX ) - static AlignedArray lightPositions( 4, sizeof( Point4F ) ); - #else static AlignedArray lightPositions( 3, sizeof( Point4F ) ); static AlignedArray lightSpotDirs( 3, sizeof( Point4F ) ); - #endif static AlignedArray lightColors( 4, sizeof( Point4F ) ); static Point4F lightInvRadiusSq; static Point4F lightSpotAngle; @@ -329,6 +323,7 @@ void LightManager::_update4LightConsts( const SceneData &sgData, // Need to clear the buffers so that we don't leak // lights from previous passes or have NaNs. dMemset( lightPositions.getBuffer(), 0, lightPositions.getBufferSize() ); + dMemset( lightSpotDirs.getBuffer(), 0, lightSpotDirs.getBufferSize() ); dMemset( lightColors.getBuffer(), 0, lightColors.getBufferSize() ); lightInvRadiusSq = Point4F::Zero; lightSpotAngle.set( -1.0f, -1.0f, -1.0f, -1.0f ); @@ -342,12 +337,6 @@ void LightManager::_update4LightConsts( const SceneData &sgData, if ( !light ) break; - #if defined( TORQUE_OS_MAC ) || defined( TORQUE_OS_LINUX ) - - lightPositions[i] = light->getPosition(); - - #else - // The light positions and spot directions are // in SoA order to make optimal use of the GPU. const Point3F &lightPos = light->getPosition(); @@ -366,8 +355,6 @@ void LightManager::_update4LightConsts( const SceneData &sgData, lightSpotFalloff[i] = 1.0f / getMax( F32_MIN, mCos( mDegToRad( light->getInnerConeAngle() / 2.0f ) ) - lightSpotAngle[i] ); } - #endif - // Prescale the light color by the brightness to // avoid doing this in the shader. lightColors[i] = Point4F(light->getColor()) * light->getBrightness(); @@ -381,13 +368,11 @@ void LightManager::_update4LightConsts( const SceneData &sgData, shaderConsts->setSafe( lightDiffuseSC, lightColors ); shaderConsts->setSafe( lightInvRadiusSqSC, lightInvRadiusSq ); - #if !defined( TORQUE_OS_MAC ) && !defined( TORQUE_OS_LINUX ) - shaderConsts->setSafe( lightSpotDirSC, lightSpotDirs ); shaderConsts->setSafe( lightSpotAngleSC, lightSpotAngle ); shaderConsts->setSafe( lightSpotFalloffSC, lightSpotFalloff ); - #endif + } // Setup the ambient lighting from the first diff --git a/Engine/source/materials/processedMaterial.cpp b/Engine/source/materials/processedMaterial.cpp index 9e82c65b1..80a5c9040 100644 --- a/Engine/source/materials/processedMaterial.cpp +++ b/Engine/source/materials/processedMaterial.cpp @@ -289,9 +289,7 @@ void ProcessedMaterial::_initPassStateBlock( RenderPassData *rpd, GFXStateBlockD // The prepass will take care of writing to the // zbuffer, so we don't have to by default. - // The prepass can't write to the backbuffer's zbuffer in OpenGL. if ( MATMGR->getPrePassEnabled() && - !GFX->getAdapterType() == OpenGL && !mFeatures.hasFeature(MFT_ForwardShading)) result.setZReadWrite( result.zEnable, false ); diff --git a/Engine/source/terrain/terrCellMaterial.cpp b/Engine/source/terrain/terrCellMaterial.cpp index 63f03a188..aa56e409f 100644 --- a/Engine/source/terrain/terrCellMaterial.cpp +++ b/Engine/source/terrain/terrCellMaterial.cpp @@ -528,10 +528,7 @@ bool TerrainCellMaterial::_createPass( Vector *materials, // We write to the zbuffer if this is a prepass // material or if the prepass is disabled. - // We also write the zbuffer if we're using OpenGL, because in OpenGL the prepass - // cannot share the same zbuffer as the backbuffer. desc.setZReadWrite( true, !MATMGR->getPrePassEnabled() || - GFX->getAdapterType() == OpenGL || prePassMat || reflectMat ); diff --git a/Engine/source/terrain/terrRender.cpp b/Engine/source/terrain/terrRender.cpp index 4355591a7..0beb46820 100644 --- a/Engine/source/terrain/terrRender.cpp +++ b/Engine/source/terrain/terrRender.cpp @@ -207,17 +207,15 @@ void TerrainBlock::_updateBaseTexture(bool writeToCache) F32 copyOffsetX = 2.0f * GFX->getFillConventionOffset() / (F32)destSize.x; F32 copyOffsetY = 2.0f * GFX->getFillConventionOffset() / (F32)destSize.y; - const bool needsYFlip = GFX->getAdapterType() == OpenGL; - GFXVertexPT points[4]; points[0].point = Point3F( -1.0 - copyOffsetX, -1.0 + copyOffsetY, 0.0 ); - points[0].texCoord = Point2F( 0.0, needsYFlip ? 0.0f : 1.0f ); + points[0].texCoord = Point2F( 0.0, 1.0f ); points[1].point = Point3F( -1.0 - copyOffsetX, 1.0 + copyOffsetY, 0.0 ); - points[1].texCoord = Point2F( 0.0, needsYFlip ? 1.0f : 0.0f ); + points[1].texCoord = Point2F( 0.0, 0.0f ); points[2].point = Point3F( 1.0 - copyOffsetX, 1.0 + copyOffsetY, 0.0 ); - points[2].texCoord = Point2F( 1.0, needsYFlip ? 1.0f : 0.0f ); + points[2].texCoord = Point2F( 1.0, 0.0f ); points[3].point = Point3F( 1.0 - copyOffsetX, -1.0 + copyOffsetY, 0.0 ); - points[3].texCoord = Point2F( 1.0, needsYFlip ? 0.0f : 1.0f ); + points[3].texCoord = Point2F( 1.0, 1.0f ); vb.set( GFX, 4, GFXBufferTypeVolatile ); GFXVertexPT *ptr = vb.lock();