Skip to content

Commit

Permalink
Merge branch 'OGRECave:master' into removeFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
mosfet80 authored Oct 4, 2023
2 parents 4bcd2e0 + f01c889 commit e1302f7
Show file tree
Hide file tree
Showing 86 changed files with 686 additions and 909 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linux.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Run Linux C++11
working-directory: ./
run: ./Scripts/BuildScripts/build_ci_linux.sh
- name: ABI Checker Report Generation
if: ${{ (github.ref != 'refs/heads/master' && github.event_name == 'push') || (github.event_name == 'pull_request' && github.event.pull_request.base.ref != 'master') }}
run: ./Scripts/BuildScripts/abi_checker.sh 2 $GITHUB_BASE_REF
- name: ABI Checker Upload
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: ${{ (github.ref != 'refs/heads/master' && github.event_name == 'push') || (github.event_name == 'pull_request' && github.event.pull_request.base.ref != 'master') }}
with:
name: abi-checker-reports
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Generate Doxyfile
# Replace CMake's ${ENV_VAR} to Doxygen's $(ENV_VAR) syntax
Expand Down
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ if (MSVC)
# set variable to state that we are using jom makefiles
set(JOM TRUE)
endif ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:fast")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:fast /Zc:cplusplus")
if (NOT OGRE_PLATFORM_X64)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE2")
endif()
Expand Down Expand Up @@ -349,7 +349,6 @@ elseif (ANDROID)
set(OGRE_BUILD_COMPONENT_PAGING FALSE CACHE BOOL "Disable paging component on Android ES1" FORCE)
endif()

set(OGRE_BUILD_TESTS FALSE CACHE BOOL "Disable tests on Android" FORCE)
set(OGRE_BUILD_TOOLS FALSE CACHE BOOL "Disable tools on Android" FORCE)
set(OGRE_STATIC TRUE CACHE BOOL "Forcing static build for Android" FORCE)
set(OGRE_SIMD FALSE CACHE BOOL "Disable SIMD on Android" FORCE)
Expand Down
2 changes: 1 addition & 1 deletion Components/Hlms/Pbs/src/OgreHlmsPbs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2617,7 +2617,7 @@ namespace Ogre

// vec4 areaApproxLights[numLights].tangent;
Quaternion qRot = light->getParentNode()->_getDerivedOrientation();
Vector3 xAxis = viewMatrix3 * qRot.xAxis();
Vector3 xAxis = viewMatrix3 * -qRot.xAxis();
*light1BufferPtr++ = xAxis.x;
*light1BufferPtr++ = xAxis.y;
*light1BufferPtr++ = xAxis.z;
Expand Down
1 change: 1 addition & 0 deletions Components/Hlms/Pbs/src/OgreHlmsPbsDatablock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,7 @@ namespace Ogre
mUserValue[userValueIdx][1] = value.y;
mUserValue[userValueIdx][2] = value.z;
mUserValue[userValueIdx][3] = value.w;
scheduleConstBufferUpdate();
}
//-----------------------------------------------------------------------------------
Vector4 HlmsPbsDatablock::getUserValue( uint8 userValueIdx ) const
Expand Down
3 changes: 3 additions & 0 deletions Components/Hlms/Unlit/src/OgreHlmsUnlit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,9 @@ namespace Ogre
int32 numClipDist = std::max( getProperty( HlmsBaseProp::PsoClipDistances ), 1 );
setProperty( HlmsBaseProp::PsoClipDistances, numClipDist );
setProperty( HlmsBaseProp::GlobalClipPlanes, 1 );
// some Android devices(e.g. Mali-G77, Google Pixel 7 Pro) do not support user clip planes
if( !mRenderSystem->getCapabilities()->hasCapability( RSC_USER_CLIP_PLANES ) )
setProperty( HlmsBaseProp::EmulateClipDistances, 1 );
}

mListener->preparePassHash( shadowNode, casterPass, dualParaboloid, sceneManager, this );
Expand Down
2 changes: 2 additions & 0 deletions Components/PlanarReflections/include/OgrePlanarReflections.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ namespace Ogre

uint8 getMaxNumMipmaps() const { return mMaxNumMipmaps; }

uint8 countActiveActors() const;

enum CustomParameterBits
{
// clang-format off
Expand Down
64 changes: 39 additions & 25 deletions Components/PlanarReflections/src/OgrePlanarReflections.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,29 +521,32 @@ namespace Ogre
ArrayMaskR vertexMask = ARRAY_MASK_ZERO;
ArrayReal dotResult;

ArrayVector3 tangentDir, vertexPoint;
ArrayVector3 tangentDir, vertexPoint, xMidpoint, yMidpoint;

tangentDir = actorsPlanes->planeNormals.yAxis() * actorsPlanes->xyHalfSize[1];
xMidpoint = actorsPlanes->planeNormals.xAxis() * actorsPlanes->xyHalfSize[0];
yMidpoint = actorsPlanes->planeNormals.yAxis() * actorsPlanes->xyHalfSize[1];

tangentDir = xMidpoint + yMidpoint;
vertexPoint = actorsPlanes->center + tangentDir;
dotResult = frustums[k].normal.dotProduct( vertexPoint ) - frustums[k].negD;
dotResult = frustums[k].normal.dotProduct( vertexPoint );
vertexMask =
Mathlib::Or( vertexMask, Mathlib::CompareGreater( dotResult, ARRAY_REAL_ZERO ) );
Mathlib::Or( vertexMask, Mathlib::CompareGreater( dotResult, frustums[k].negD ) );

vertexPoint = actorsPlanes->center - tangentDir;
dotResult = frustums[k].normal.dotProduct( vertexPoint ) - frustums[k].negD;
dotResult = frustums[k].normal.dotProduct( vertexPoint );
vertexMask =
Mathlib::Or( vertexMask, Mathlib::CompareGreater( dotResult, ARRAY_REAL_ZERO ) );
Mathlib::Or( vertexMask, Mathlib::CompareGreater( dotResult, frustums[k].negD ) );

tangentDir = actorsPlanes->planeNormals.xAxis() * actorsPlanes->xyHalfSize[0];
tangentDir = xMidpoint - yMidpoint;
vertexPoint = actorsPlanes->center + tangentDir;
dotResult = frustums[k].normal.dotProduct( vertexPoint ) - frustums[k].negD;
dotResult = frustums[k].normal.dotProduct( vertexPoint );
vertexMask =
Mathlib::Or( vertexMask, Mathlib::CompareGreater( dotResult, ARRAY_REAL_ZERO ) );
Mathlib::Or( vertexMask, Mathlib::CompareGreater( dotResult, frustums[k].negD ) );

vertexPoint = actorsPlanes->center - tangentDir;
dotResult = frustums[k].normal.dotProduct( vertexPoint ) - frustums[k].negD;
dotResult = frustums[k].normal.dotProduct( vertexPoint );
vertexMask =
Mathlib::Or( vertexMask, Mathlib::CompareGreater( dotResult, ARRAY_REAL_ZERO ) );
Mathlib::Or( vertexMask, Mathlib::CompareGreater( dotResult, frustums[k].negD ) );

mask = Mathlib::And( mask, vertexMask );
}
Expand All @@ -566,9 +569,9 @@ namespace Ogre
// for( int l=0; l<8; ++l )
for( int l = 0; l < 4; ++l )
{
dotResult = actorPlaneNormal.dotProduct( worldSpaceCorners[l] ) - actorPlaneNegD;
dotResult = actorPlaneNormal.dotProduct( worldSpaceCorners[l] );
vertexMask =
Mathlib::Or( vertexMask, Mathlib::CompareGreater( dotResult, ARRAY_REAL_ZERO ) );
Mathlib::Or( vertexMask, Mathlib::CompareGreater( dotResult, actorPlaneNegD ) );
}
mask = Mathlib::And( mask, vertexMask );

Expand All @@ -578,21 +581,21 @@ namespace Ogre
vertexMask = ARRAY_MASK_ZERO;
for( int l = 0; l < 8; ++l )
{
dotResult = actorPlaneNormal.dotProduct( worldSpaceCorners[l] ) - actorPlaneNegD;
dotResult = actorPlaneNormal.dotProduct( worldSpaceCorners[l] );
vertexMask =
Mathlib::Or( vertexMask, Mathlib::CompareGreater( dotResult, ARRAY_REAL_ZERO ) );
Mathlib::Or( vertexMask, Mathlib::CompareGreater( dotResult, actorPlaneNegD ) );
}
mask = Mathlib::And( mask, vertexMask );

// North plane
actorPlaneNormal = actorsPlanes->planeNormals.yAxis();
actorPlaneNormal = -actorsPlanes->planeNormals.yAxis();
actorPlaneNegD = actorsPlanes->planeNegD[1];
vertexMask = ARRAY_MASK_ZERO;
for( int l = 0; l < 8; ++l )
{
dotResult = actorPlaneNormal.dotProduct( worldSpaceCorners[l] ) - actorPlaneNegD;
dotResult = actorPlaneNormal.dotProduct( worldSpaceCorners[l] );
vertexMask =
Mathlib::Or( vertexMask, Mathlib::CompareGreater( dotResult, ARRAY_REAL_ZERO ) );
Mathlib::Or( vertexMask, Mathlib::CompareGreater( dotResult, actorPlaneNegD ) );
}
mask = Mathlib::And( mask, vertexMask );

Expand All @@ -602,21 +605,21 @@ namespace Ogre
vertexMask = ARRAY_MASK_ZERO;
for( int l = 0; l < 8; ++l )
{
dotResult = actorPlaneNormal.dotProduct( worldSpaceCorners[l] ) - actorPlaneNegD;
dotResult = actorPlaneNormal.dotProduct( worldSpaceCorners[l] );
vertexMask =
Mathlib::Or( vertexMask, Mathlib::CompareGreater( dotResult, ARRAY_REAL_ZERO ) );
Mathlib::Or( vertexMask, Mathlib::CompareGreater( dotResult, actorPlaneNegD ) );
}
mask = Mathlib::And( mask, vertexMask );

// East plane
actorPlaneNormal = actorsPlanes->planeNormals.xAxis();
actorPlaneNormal = -actorsPlanes->planeNormals.xAxis();
actorPlaneNegD = actorsPlanes->planeNegD[3];
vertexMask = ARRAY_MASK_ZERO;
for( int l = 0; l < 8; ++l )
{
dotResult = actorPlaneNormal.dotProduct( worldSpaceCorners[l] ) - actorPlaneNegD;
dotResult = actorPlaneNormal.dotProduct( worldSpaceCorners[l] );
vertexMask =
Mathlib::Or( vertexMask, Mathlib::CompareGreater( dotResult, ARRAY_REAL_ZERO ) );
Mathlib::Or( vertexMask, Mathlib::CompareGreater( dotResult, actorPlaneNegD ) );
}
mask = Mathlib::And( mask, vertexMask );

Expand All @@ -626,9 +629,9 @@ namespace Ogre
vertexMask = ARRAY_MASK_ZERO;
for( int l = 0; l < 8; ++l )
{
dotResult = actorPlaneNormal.dotProduct( worldSpaceCorners[l] ) - actorPlaneNegD;
dotResult = actorPlaneNormal.dotProduct( worldSpaceCorners[l] );
vertexMask =
Mathlib::Or( vertexMask, Mathlib::CompareGreater( dotResult, ARRAY_REAL_ZERO ) );
Mathlib::Or( vertexMask, Mathlib::CompareGreater( dotResult, actorPlaneNegD ) );
}
mask = Mathlib::And( mask, vertexMask );
}
Expand Down Expand Up @@ -925,4 +928,15 @@ namespace Ogre
{
return ( renderable->mCustomParameter & UseActiveActor ) != 0;
}
//-----------------------------------------------------------------------------------
uint8 PlanarReflections::countActiveActors() const
{
uint8 numActors = 0u;
for( const PlanarReflectionActor *actor : mActiveActors )
{
if( actor != &mDummyActor )
++numActors;
}
return numActors;
}
} // namespace Ogre
22 changes: 5 additions & 17 deletions Components/SceneFormat/src/OgreSceneFormatExporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,10 @@ THE SOFTWARE.
#include "OgreSceneManager.h"
#include "OgreTextureGpuManager.h"

#include "math.h"

#include <cmath>
#include <fstream>
#include <queue>

#if OGRE_COMPILER == OGRE_COMPILER_MSVC && OGRE_COMP_VER < 1800
inline float isfinite( float x )
{
return _finite( x ) == 0;
}
inline float isinf( float x )
{
return x == std::numeric_limits<float>::infinity() || x == -std::numeric_limits<float>::infinity();
}
#endif

#define SceneFormatExporterNumFloatBins \
( sizeof( mFloatBinTmpString ) / sizeof( mFloatBinTmpString[0] ) )
#define SceneFormatExporterFloatBinStrLength sizeof( mFloatBinTmpString[0] )
Expand Down Expand Up @@ -144,11 +132,11 @@ namespace Ogre
strValue.a( encodeFloatBin( value ) );
else
{
if( isfinite( value ) )
if( std::isfinite( value ) )
strValue.a( LwString::Float( value, 9 ) );
else
{
if( isinf( value ) )
if( std::isinf( value ) )
strValue.a( value > 0 ? "\"inf\"" : "\"-inf\"" );
else
strValue.a( "\"nan\"" );
Expand All @@ -168,11 +156,11 @@ namespace Ogre
strValue.a( encodeDoubleBin( value ) );
else
{
if( isfinite( value ) )
if( std::isfinite( value ) )
strValue.a( LwString::Float( (float)value, 18 ) );
else
{
if( isinf( value ) )
if( std::isinf( value ) )
strValue.a( value > 0 ? "\"inf\"" : "\"-inf\"" );
else
strValue.a( "\"nan\"" );
Expand Down
2 changes: 1 addition & 1 deletion Docs/src/SettingUpOgre/SettingUpOgreAndroid.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- Git
- Android Studio 4.0 or higher.
- Android SDK & NDK
- Python 3.x (to build the samples)
- Python 3.x is needed to build shaderc dependency for Vulkan.
- Vulkan-capable Android phone.
- Android 8.0 or newer strongly recommended. Android 7.0 and 7.1 are supported,
but most phones are bundled with very old and buggy drivers.
Expand Down
1 change: 1 addition & 0 deletions Docs/src/SettingUpOgre/SettingUpOgreWindows.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* Windows 7 or higher is highly recommended. For Windows Vista & 7, you need to have the
[KB2670838 update](https://support.microsoft.com/en-us/kb/2670838) installed.
**YOUR END USERS NEED THIS UPDATE AS WELL**.
* Python 3.x is needed to build shaderc dependency for Vulkan.
* For HW & SW requirements, please visit http://www.ogre3d.org/developers/requirements

@copydoc DownloadingOgreScriptsCommon
Expand Down
2 changes: 1 addition & 1 deletion Docs/src/manual/BehaviorOfStagingTexturesD3D11.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Behavor of StagingTexture in D3D11 {#BehavorStagingTextureD3D11}
# Behavior of StagingTexture in D3D11 {#BehaviorStagingTextureD3D11}

__Note:__ this article is intended for developers who want to understand or modify
Ogre.
Expand Down
2 changes: 1 addition & 1 deletion Docs/src/manual/Ogre3.0.Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ Make sure to upgrade to latest CMake scripts if you're using them; to be ready f

Default material BRDF settings have changed in 3.0; thus materials will look different.

See [PBR / PBS Changes in 3.0](@ref PBSChangesIn30) to how make them look like they did in 2.4 and what these changes mean.
See [PBR / PBS Changes in 3.0](@ref PBSChangesIn30) to how make them look like they did in 2.3 and what these changes mean.
Loading

0 comments on commit e1302f7

Please sign in to comment.