Skip to content

Commit

Permalink
Local updates for Ogre2.2 against main branch (#317)
Browse files Browse the repository at this point in the history
* Local updates for Ogre2.2 against main branch

Signed-off-by: Ian Chen <[email protected]>
Co-authored-by: Ian Chen <[email protected]>
  • Loading branch information
mjcarroll and iche033 authored May 5, 2021
1 parent 032ce0f commit adfdb05
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
#============================================================================
# Initialize the project
#============================================================================
project(ignition-rendering5 VERSION 5.0.0)
project(ignition-rendering6 VERSION 6.0.0)

#============================================================================
# Find ignition-cmake
Expand Down
2 changes: 1 addition & 1 deletion examples/ogre2_demo/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(ignition-rendering-ogre2-demo)

find_package(ignition-rendering5)
find_package(ignition-rendering6)

include_directories(SYSTEM
${PROJECT_BINARY_DIR}
Expand Down
2 changes: 1 addition & 1 deletion ogre2/include/ignition/rendering/ogre2/Ogre2Conversions.hh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#include <OgreColourValue.h>
#include <OgreVector3.h>
#include <OgrePixelFormat.h>
#include <OgrePixelFormatGpu.h>

#ifdef _MSC_VER
#pragma warning(pop)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
#ifdef _MSC_VER
#pragma warning(push, 0)
#endif
#include <OgreCamera.h>
#include <OgreMaterial.h>
#include <OgreRenderTargetListener.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ namespace Ogre
{
class LogManager;
class Root;
class Window;
namespace v1
{
class OverlaySystem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#ifdef _MSC_VER
#pragma warning(push, 0)
#endif
#include <OgreRenderTargetListener.h>
#include <OgreCamera.h>
#include <OgreMaterialManager.h>
#ifdef _MSC_VER
#pragma warning(pop)
Expand Down
11 changes: 6 additions & 5 deletions ogre2/src/Ogre2DepthCamera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -944,13 +944,14 @@ void Ogre2DepthCamera::CreateWorkspaceInstance()
auto ogreRoot = engine->OgreRoot();
Ogre::CompositorManager2 *ogreCompMgr = ogreRoot->getCompositorManager2();

Ogre::RenderTarget *rt =
this->dataPtr->ogreDepthTexture->getBuffer()->getRenderTarget();

// create compositor worksspace
this->dataPtr->ogreCompositorWorkspace =
ogreCompMgr->addWorkspace(this->scene->OgreSceneManager(),
rt, this->ogreCamera, this->dataPtr->ogreCompositorWorkspaceDef, false);
ogreCompMgr->addWorkspace(
this->scene->OgreSceneManager(),
this->dataPtr->ogreDepthTexture,
this->ogreCamera,
this->dataPtr->ogreCompositorWorkspaceDef,
false);

// add the listener
Ogre::CompositorNode *node =
Expand Down
1 change: 1 addition & 0 deletions ogre2/src/Ogre2DynamicRenderable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <OgreMeshManager2.h>
#include <OgreSceneManager.h>
#include <OgreSubMesh2.h>
#include <Vao/OgreVaoManager.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
Expand Down
3 changes: 0 additions & 3 deletions ogre2/src/Ogre2GpuRays.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,10 @@
#include <Compositor/Pass/PassQuad/OgreCompositorPassQuadDef.h>
#include <Compositor/Pass/PassScene/OgreCompositorPassSceneDef.h>
#include <OgreDepthBuffer.h>
#include <OgreHardwarePixelBuffer.h>
#include <OgreItem.h>
#include <OgreRenderTexture.h>
#include <OgreRoot.h>
#include <OgreSceneManager.h>
#include <OgreTechnique.h>
#include <OgreTextureManager.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
Expand Down
2 changes: 2 additions & 0 deletions ogre2/src/Ogre2Material.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include <Hlms/Unlit/OgreHlmsUnlitDatablock.h>
#include <OgreHlmsManager.h>
#include <OgreMaterialManager.h>
#include <OgrePixelFormatGpuUtils.h>
#include <OgreTextureGpuManager.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
Expand Down
2 changes: 1 addition & 1 deletion ogre2/src/Ogre2RenderTargetMaterial.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#ifdef _MSC_VER
#pragma warning(push, 0)
#endif
#include <OgreRenderTarget.h>
#include <OgreSceneManager.h>
#include <OgreViewport.h>
#ifdef _MSC_VER
#pragma warning(pop)
Expand Down
24 changes: 12 additions & 12 deletions ogre2/src/Ogre2Scene.cc
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,9 @@ void Ogre2Scene::CreateShadowNodeWithSettings(

texDef->width = std::max(atlasRes.x, 1u);
texDef->height = std::max(atlasRes.y, 1u);
texDef->formatList.push_back(Ogre::PF_D32_FLOAT);
texDef->format = Ogre::PFG_D32_FLOAT;
texDef->depthBufferId = Ogre::DepthBuffer::POOL_NON_SHAREABLE;
texDef->depthBufferFormat = Ogre::PF_D32_FLOAT;
texDef->depthBufferFormat = Ogre::PFG_D32_FLOAT;
texDef->preferDepthTexture = false;
texDef->fsaa = false;
}
Expand All @@ -445,11 +445,11 @@ void Ogre2Scene::CreateShadowNodeWithSettings(

texDef->width = pointLightCubemapResolution;
texDef->height = pointLightCubemapResolution;
texDef->depth = 6u;
texDef->textureType = Ogre::TEX_TYPE_CUBE_MAP;
texDef->formatList.push_back(Ogre::PF_FLOAT32_R);
texDef->depthOrSlices = 6u;
texDef->textureType = Ogre::TextureTypes::TypeCube;
texDef->format = Ogre::PFG_R16_UNORM;
texDef->depthBufferId = 1u;
texDef->depthBufferFormat = Ogre::PF_D32_FLOAT;
texDef->depthBufferFormat = Ogre::PFG_D32_FLOAT;
texDef->preferDepthTexture = false;
texDef->fsaa = false;
}
Expand Down Expand Up @@ -489,7 +489,7 @@ void Ogre2Scene::CreateShadowNodeWithSettings(

Ogre::ShadowTextureDefinition *shadowTexDef =
shadowNodeDef->addShadowTextureDefinition(lightIdx, j, texName,
0, uvOffset, uvLength, 0);
uvOffset, uvLength, 0);
shadowTexDef->shadowMapTechnique = shadowParam.technique;
shadowTexDef->pssmLambda = pssmLambda;
shadowTexDef->splitPadding = splitPadding;
Expand All @@ -516,8 +516,8 @@ void Ogre2Scene::CreateShadowNodeWithSettings(
Ogre::CompositorPassDef *passDef = targetDef->addPass(Ogre::PASS_CLEAR);
Ogre::CompositorPassClearDef *passClear =
static_cast<Ogre::CompositorPassClearDef *>(passDef);
passClear->mColourValue = Ogre::ColourValue::White;
passClear->mDepthValue = 1.0f;
passClear->setAllClearColours(Ogre::ColourValue::White);
passClear->mClearDepth = 1.0f;
}

// Pass scene for directional and spot lights first
Expand Down Expand Up @@ -576,8 +576,8 @@ void Ogre2Scene::CreateShadowNodeWithSettings(
targetDef->addPass(Ogre::PASS_CLEAR);
Ogre::CompositorPassClearDef *passClear =
static_cast<Ogre::CompositorPassClearDef *>(passDef);
passClear->mColourValue = Ogre::ColourValue::White;
passClear->mDepthValue = 1.0f;
passClear->setAllClearColours(Ogre::ColourValue::White);
passClear->mClearDepth = 1.0f;
passClear->mShadowMapIdx = shadowMapIdx;
}

Expand Down Expand Up @@ -605,7 +605,7 @@ void Ogre2Scene::CreateShadowNodeWithSettings(
static_cast<Ogre::CompositorPassQuadDef *>(passDef);
passQuad->mMaterialIsHlms = false;
passQuad->mMaterialName = "Ogre/DPSM/CubeToDpsm";
passQuad->addQuadTextureSource(0, "tmpCubemap", 0);
passQuad->addQuadTextureSource(0, "tmpCubemap");
passQuad->mShadowMapIdx = shadowMapIdx;
}
const size_t numSplits = shadowParam.technique ==
Expand Down
4 changes: 1 addition & 3 deletions ogre2/src/Ogre2SelectionBuffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,10 @@
#include <Compositor/OgreCompositorWorkspace.h>
#include <Compositor/Pass/PassScene/OgreCompositorPassSceneDef.h>
#include <OgreCamera.h>
#include <OgreHardwarePixelBuffer.h>
#include <OgreItem.h>
#include <OgreRenderTexture.h>
#include <OgreRoot.h>
#include <OgreSceneManager.h>
#include <OgreTextureManager.h>
#include <OgreTextureGpuManager.h>
#include <OgreViewport.h>
#ifdef _MSC_VER
#pragma warning(pop)
Expand Down

0 comments on commit adfdb05

Please sign in to comment.