PlanarReflections rendering bug with two-sided lighting
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.4k
- Forks
- 289
- Avg merge
- 3h 28m
- Merged PRs (30d)
- 1
Description
System Information
- Ogre Version: master branch, revision c1c24caaae (April 9)
- Operating System / Platform: macOS 13.3.1
- RenderSystem: Metal
- GPU: AMD Radeon Pro 960X
Detailed description
When the PlanarRelections library mirrors objects with a Pbs data blocks set to use two-sided lighting, the reflections look wrong. This is especially obvious when using unlit mirrors.
Steps to reproduce:
- Change the code body of
HlmsPbs::createDatablockImplin OgreHlmsPbs.cpp to say:
HlmsPbsDatablock* block = OGRE_NEW HlmsPbsDatablock( datablockName, this,
macroblock, blendblock, paramVec );
block->setTwoSidedLighting( true, false );
return block;
- Recompile the HlmsPbs library.
- Build and run
Sample_PlanarReflections.

Ogre.log
15:42:22: Creating resource group General
15:42:22: Creating resource group Internal
15:42:22: Creating resource group Autodetect
15:42:22: SceneManagerFactory for type 'DefaultSceneManager' registered.
15:42:22: Registering ResourceManager for type Material
15:42:22: Registering ResourceManager for type Mesh
15:42:22: Registering ResourceManager for type Mesh2
15:42:22: Registering ResourceManager for type OldSkeleton
15:42:22: MovableObjectFactory for type 'ParticleSystem' registered.
15:42:22: ArchiveFactory for archive type FileSystem registered.
15:42:22: ArchiveFactory for archive type Zip registered.
15:42:22: ArchiveFactory for archive type EmbeddedZip registered.
15:42:22: DDS codec registering
15:42:22: FreeImage version: 3.18.0
15:42:22: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
15:42:22: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,psb,cut,xbm,xpm,gif,hdr,g3,sgi,rgb,rgba,bw,exr,j2k,j2c,jp2,pfm,pct,pict,pic,3fr,arw,bay,bmq,cap,cine,cr2,crw,cs1,dc2,dcr,drf,dsc,dng,erf,fff,ia,iiq,k25,kc2,kdc,mdc,mef,mos,mrw,nef,nrw,orf,pef,ptx,pxn,qtk,raf,raw,rdc,rw2,rwl,rwz,sr2,srf,srw,sti,x3f,webp
15:42:22: OITD codec registering
15:42:22: Registering ResourceManager for type HighLevelGpuProgram
15:42:22: MovableObjectFactory for type 'Decal' registered.
15:42:22: MovableObjectFactory for type 'InternalCubemapProbe' registered.
15:42:22: MovableObjectFactory for type 'Entity' registered.
15:42:22: MovableObjectFactory for type 'Item' registered.
15:42:22: MovableObjectFactory for type 'Light' registered.
15:42:22: MovableObjectFactory for type 'Rectangle2Dv2' registered.
15:42:22: MovableObjectFactory for type 'BillboardSet' registered.
15:42:22: MovableObjectFactory for type 'ManualObject2' registered.
15:42:22: MovableObjectFactory for type 'BillboardChain' registered.
15:42:22: MovableObjectFactory for type 'RibbonTrail' registered.
15:42:22: MovableObjectFactory for type 'WireAabb' registered.
15:42:22: Loading library RenderSystem_Metal
15:42:22: Installing plugin: Metal RenderSystem
15:42:22: Metal: Devices Detection Starts
15:42:22: Metal: "AMD Radeon Pro 560X"
15:42:22: Metal: "Intel(R) UHD Graphics 630"
15:42:22: Metal: Devices Detection Ends
15:42:22: Plugin successfully installed
15:42:22: Loading library Plugin_ParticleFX
15:42:22: Installing plugin: ParticleFX
15:42:22: Particle Emitter Type 'Point' registered
15:42:22: Particle Emitter Type 'Box' registered
15:42:22: Particle Emitter Type 'Ellipsoid' registered
15:42:22: Particle Emitter Type 'Cylinder' registered
15:42:22: Particle Emitter Type 'Ring' registered
15:42:22: Particle Emitter Type 'HollowEllipsoid' registered
15:42:22: Particle Affector Type 'LinearForce' registered
15:42:22: Particle Affector Type 'ColourFader' registered
15:42:22: Particle Affector Type 'ColourFader2' registered
15:42:22: Particle Affector Type 'ColourImage' registered
15:42:22: Particle Affector Type 'ColourInterpolator' registered
15:42:22: Particle Affector Type 'ScaleInterpolator' registered
15:42:22: Particle Affector Type 'Scaler' registered
15:42:22: Particle Affector Type 'Rotator' registered
15:42:22: Particle Affector Type 'DirectionRandomiser' registered
15:42:22: Particle Affector Type 'DeflectorPlane' registered
15:42:22: Plugin successfully installed
15:42:22: *-*-* OGRE Initialising
15:42:22: *-*-* Version 3.0.0unstable (E)
15:42:25: CPU Identifier & Features
15:42:25: -------------------------
15:42:25: * CPU ID: GenuineIntel: Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
15:42:25: * Logical cores: 12
15:42:25: * SSE: yes
15:42:25: * SSE2: yes
15:42:25: * SSE3: yes
15:42:25: * MMX: yes
15:42:25: * MMXEXT: yes
15:42:25: * 3DNOW: no
15:42:25: * 3DNOWEXT: no
15:42:25: * CMOV: yes
15:42:25: * TSC: yes
15:42:25: * FPU: yes
15:42:25: * PRO: yes
15:42:25: * HT: no
15:42:25: -------------------------
15:42:25: Metal: Devices Detection Starts
15:42:25: Metal: "AMD Radeon Pro 560X"
15:42:25: Metal: "Intel(R) UHD Graphics 630"
15:42:25: Metal: Devices Detection Ends
15:42:25: Metal: Requested "AMD Radeon Pro 560X", selected "AMD Radeon Pro 560X"
15:42:25: Supports: OSX_GPUFamily1_v1
15:42:25: Registering ResourceManager for type GpuProgram
15:42:25: DefaultWorkQueue('Root') initialising on thread main.
15:42:25: Particle Renderer Type 'billboard' registered
15:42:25: OverlayElementFactory for type Panel registered.
15:42:25: OverlayElementFactory for type BorderPanel registered.
15:42:25: OverlayElementFactory for type TextArea registered.
15:42:25: Registering ResourceManager for type Font
15:42:25: Creating resource group Essential
15:42:25: Added resource location '/Volumes/Work/non-repo-libraries/Ogre-fork-build4/bin/Debug/Sample_PlanarReflections.app/Contents/Resources/DebugPack.zip' of type 'Zip' to resource group 'Essential'
15:42:25: Added resource location '/Volumes/Work/non-repo-libraries/Ogre-fork-build4/bin/Debug/Sample_PlanarReflections.app/Contents/Resources/CornellBox.zip' of type 'Zip' to resource group 'Essential'
15:42:25: Added resource location '/Volumes/Work/non-repo-libraries/Ogre-fork-build4/bin/Debug/Sample_PlanarReflections.app/Contents/Resources/2.0/scripts/materials/Common' of type 'FileSystem' to resource group 'General'
15:42:25: Added resource location '/Volumes/Work/non-repo-libraries/Ogre-fork-build4/bin/Debug/Sample_PlanarReflections.app/Contents/Resources/2.0/scripts/materials/Common/Any' of type 'FileSystem' to resource group 'General'
15:42:25: Added resource location '/Volumes/Work/non-repo-libraries/Ogre-fork-build4/bin/Debug/Sample_PlanarReflections.app/Contents/Resources/2.0/scripts/materials/Common/GLSL' of type 'FileSystem' to resource group 'General'
15:42:25: Added resource location '/Volumes/Work/non-repo-libraries/Ogre-fork-build4/bin/Debug/Sample_PlanarReflections.app/Contents/Resources/2.0/scripts/materials/Common/GLSLES' of type 'FileSystem' to resource group 'General'
15:42:25: Added resource location '/Volumes/Work/non-repo-libraries/Ogre-fork-build4/bin/Debug/Sample_PlanarReflections.app/Contents/Resources/2.0/scripts/materials/Common/HLSL' of type 'FileSystem' to resource group 'General'
15:42:25: Added resource location '/Volumes/Work/non-repo-libraries/Ogre-fork-build4/bin/Debug/Sample_PlanarReflections.app/Contents/Resources/2.0/scripts/materials/Common/Metal' of type 'FileSystem' to resource group 'General'
15:42:25: Added resource location '/Volumes/Work/non-repo-libraries/Ogre-fork-build4/bin/Debug/Sample_PlanarReflections.app/Contents/Resources/Hlms/Common/Any' of type 'FileSystem' to resource group 'General'
15:42:25: Added resource location '/Volumes/Work/non-repo-libraries/Ogre-fork-build4/bin/Debug/Sample_PlanarReflections.app/Contents/Resources/Hlms/Common/GLSL' of type 'FileSystem' to resource group 'General'
15:42:25: Added resource location '/Volumes/Work/non-repo-libraries/Ogre-fork-build4/bin/Debug/Sample_PlanarReflections.app/Contents/Resources/Hlms/Common/HLSL' of type 'FileSystem' to resource group 'General'
15:42:25: Added resource location '/Volumes/Work/non-repo-libraries/Ogre-fork-build4/bin/Debug/Sample_PlanarReflections.app/Contents/Resources/Hlms/Common/Metal' of type 'FileSystem' to resource group 'General'
15:42:25: Added resource location '/Volumes/Work/non-repo-libraries/Ogre-fork-build4/bin/Debug/Sample_PlanarReflections.app/Contents/Resources/Compute/Algorithms/IBL' of type 'FileSystem' to resource group 'General'
15:42:25: Added resource location '/Volumes/Work/non-repo-libraries/Ogre-fork-build4/bin/Debug/Sample_PlanarReflections.app/Contents/Resources/Compute/Tools/Any' of type 'FileSystem' to resource group 'General'
15:42:25: Creating resource group Popular
15:42:25: Added resource location '/Volumes/Work/non-repo-libraries/Ogre-fork-build4/bin/Debug/Sample_PlanarReflections.app/Contents/Resources/2.0/scripts/Compositors' of type 'FileSystem' to resource group 'Popular'
15:42:25: Added resource location '/Volumes/Work/non-repo-libraries/Ogre-fork-build4/bin/Debug/Sample_PlanarReflections.app/Contents/Resources/models' of type 'FileSystem' to resource group 'Popular'
15:42:25: Added resource location '/Volumes/Work/non-repo-libraries/Ogre-fork-build4/bin/Debug/Sample_PlanarReflections.app/Contents/Resources/textures' of type 'FileSystem' to resource group 'Popular'
15:42:25: Added resource location '/Volumes/Work/non-repo-libraries/Ogre-fork-build4/bin/Debug/Sample_PlanarReflections.app/Contents/Resources/textures/Cubemaps' of type 'FileSystem' to resource group 'Popular'
15:42:25: Added resource location '/Volumes/Work/non-repo-libraries/Ogre-fork-build4/bin/Debug/Sample_PlanarReflections.app/Contents/Resources/2.0/scripts/materials/PlanarReflections' of type 'FileSystem' to resource group 'General'
15:42:25: Loading HlmsDiskCache from hlmsDiskCache1.bin
15:42:25: Applying HlmsDiskCache 1
15:42:25: Shader 100000000VertexShader_vs compiled successfully.
15:42:25: Shader 100000001VertexShader_vs compiled successfully.
15:42:25: Shader 100000002VertexShader_vs compiled successfully.
15:42:25: Shader 100000002PixelShader_ps compiled successfully.
15:42:25: Shader 100000003VertexShader_vs compiled successfully.
15:42:25: Shader 100000003PixelShader_ps compiled successfully.
15:42:25: Shader 100000004VertexShader_vs compiled successfully.
15:42:25: Shader 100000004PixelShader_ps compiled successfully.
15:42:25: Shader 100000005VertexShader_vs compiled successfully.
15:42:25: Shader 100000005PixelShader_ps compiled successfully.
15:42:25: Shader 100000006VertexShader_vs compiled successfully.
15:42:25: Shader 100000006PixelShader_ps compiled successfully.
15:42:25: Shader 100000007VertexShader_vs compiled successfully.
15:42:25: Shader 100000007PixelShader_ps compiled successfully.
15:42:25: Shader 100000008VertexShader_vs compiled successfully.
15:42:25: Shader 100000008PixelShader_ps compiled successfully.
15:42:25: Shader 100000009VertexShader_vs compiled successfully.
15:42:25: Shader 100000009PixelShader_ps compiled successfully.
15:42:25: Shader 100000010VertexShader_vs compiled successfully.
15:42:25: Shader 100000010PixelShader_ps compiled successfully.
15:42:25: Shader 100000011VertexShader_vs compiled successfully.
15:42:25: Shader 100000011PixelShader_ps compiled successfully.
15:42:25: Loading HlmsDiskCache from hlmsDiskCache3.bin
15:42:25: Applying HlmsDiskCache 3
15:42:25: Shader 300000000VertexShader_vs compiled successfully.
15:42:25: Shader 300000001VertexShader_vs compiled successfully.
15:42:25: Shader 300000002VertexShader_vs compiled successfully.
15:42:25: Shader 300000002PixelShader_ps compiled successfully.
15:42:25: Shader 300000003VertexShader_vs compiled successfully.
15:42:25: Shader 300000003PixelShader_ps compiled successfully.
15:42:25: Parsing scripts for resource group Autodetect
15:42:25: Finished parsing scripts for resource group Autodetect
15:42:25: Creating resources for group Autodetect
15:42:25: All done
15:42:25: Parsing scripts for resource group Essential
15:42:25: Parsing script Materials.material
15:42:25: Parsing script CornellBox.material.json
15:42:25: Parsing script DebugFont.fontdef
15:42:25: Finished parsing scripts for resource group Essential
15:42:25: Creating resources for group Essential
15:42:25: All done
15:42:25: Parsing scripts for resource group General
15:42:25: Parsing script Quad.program
15:42:25: Shader Ogre/Compositor/Quad_vs_Metal compiled successfully.
15:42:25: Shader Ogre/Compositor/QuadCameraDir_vs_Metal compiled successfully.
15:42:25: Shader Ogre/Compositor/QuadCameraDirNoUV_vs_Metal compiled successfully.
15:42:25: Parsing script HiddenAreaMeshVr.material
15:42:25: Shader Ogre/VR/HiddenAreaMeshVr_vs_Metal compiled successfully.
15:42:25: Shader Ogre/VR/HiddenAreaMeshVr_ps_Metal compiled successfully.
15:42:25: Parsing script EsmGaussianBlurLogFilter.material
15:42:25: Shader ESM/GaussianLogFilterH_ps_Metal compiled successfully.
15:42:25: Shader ESM/GaussianLogFilterV_ps_Metal compiled successfully.
15:42:25: Parsing script RadialDensityMask.material
15:42:25: Shader Ogre/Compositor/RadialDensityMask_vs_Metal compiled successfully.
15:42:25: Shader Ogre/VR/RadialDensityMask_ps_Metal compiled successfully.
15:42:25: Parsing script DPSM.material
15:42:25: Shader Ogre/DPSM/CubeToDpsm_ps_Metal compiled successfully.
15:42:25: Shader Ogre/DPSM/CubeToDpsm_Colour_ps_Metal compiled successfully.
15:42:25: Parsing script Atmosphere.material
15:42:25: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource metal_stdlib in resource group General or any other group. in ResourceGroupManager::openResource at /Volumes/Work/git-repos/ogre-next-fork/OgreMain/src/OgreResourceGroupManager.cpp (line 737)
15:42:25: Shader Ogre/Atmo/NprSky_ps_Metal compiled successfully.
15:42:25: Parsing script DPM.material
15:42:25: Shader Ogre/DPM/CubeToDpm_4xFP16_ps_Metal compiled successfully.
15:42:25: Parsing script PccDepthCompressor.material
15:42:25: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource metal_stdlib in resource group General or any other group. in ResourceGroupManager::openResource at /Volumes/Work/git-repos/ogre-next-fork/OgreMain/src/OgreResourceGroupManager.cpp (line 737)
15:42:25: Shader PccDepthCompressor_ps_Metal compiled successfully.
15:42:25: Parsing script DepthUtils.material
15:42:25: Shader Ogre/Depth/DownscaleMax_ps_Metal compiled successfully.
15:42:25: Parsing script Sky.material
15:42:25: Shader Ogre/Sky/Cubemap_ps_Metal compiled successfully.
15:42:25: Shader Ogre/Sky/Equirectangular_ps_Metal compiled successfully.
15:42:25: Parsing script Copyback.material
15:42:25: Shader Ogre/Copy/4xFP32_ps_Metal compiled successfully.
15:42:25: Shader Ogre/Copy/4xFP32_2DArray_ps_Metal compiled successfully.
15:42:25: Shader Ogre/Copy/1xFP32_ps_Metal compiled successfully.
15:42:25: Shader Ogre/Resolve/1xFP32_Subsample0_ps_Metal compiled successfully.
15:42:25: Parsing script PlanarReflections.material
15:42:25: Parsing script EsmGaussianBlurLogFilter.material.json
15:42:25: Parsing script Mipmaps.material.json
15:42:25: Parsing script IBL.material.json
15:42:25: Finished parsing scripts for resource group General
15:42:25: Creating resources for group General
15:42:25: All done
15:42:25: Parsing scripts for resource group Internal
15:42:25: Finished parsing scripts for resource group Internal
15:42:25: Creating resources for group Internal
15:42:25: All done
15:42:25: Parsing scripts for resource group Popular
15:42:25: Parsing script LocalCubemaps.compositor
15:42:25: Parsing script StencilTest.compositor
15:42:25: Parsing script TutorialUav02_Setup.compositor
15:42:25: Parsing script StereoRendering.compositor
15:42:25: Parsing script ScreenSpaceReflections.compositor
15:42:25: Parsing script StaticShadowMaps.compositor
15:42:25: Parsing script UvBaking.compositor
15:42:25: Parsing script ShadowMapDebugging.compositor
15:42:25: Parsing script Refractions.compositor
15:42:25: Parsing script Tutorial_DynamicCubemap.compositor
15:42:25: Parsing script IrradianceFieldRaster.compositor
15:42:25: Parsing script PbsMaterials.compositor
15:42:25: Parsing script Tutorial_Terrain.compositor
15:42:25: Parsing script InstancedStereo.compositor
15:42:25: Parsing script Tutorial_OpenVRWorkspace.compositor
15:42:25: Parsing script TutorialUav01_Setup.compositor
15:42:25: Parsing script TutorialSky_Postprocess.compositor
15:42:25: Parsing script Tutorial_ReconstructPosFromDepth.compositor
15:42:25: Parsing script PlanarReflections.compositor
15:42:25: Finished parsing scripts for resource group Popular
15:42:25: Creating resources for group Popular
15:42:25: All done
15:42:25: Mesh: Loading Cube_d.mesh.
15:42:25: WARNING: Cube_d.mesh is an older format ([MeshSerializer_v2.1 R1]); you should upgrade it as soon as possible using the OgreMeshTool tool.
15:42:25: Shader 0GaussianBlurBase_cs compiled successfully.
15:42:25: Shader 1GaussianBlurBase_cs compiled successfully.
15:42:25: Font DebugFont using texture size 512x512
15:42:25: Info: Freetype returned null for character 127 in font DebugFont
15:42:25: Info: Freetype returned null for character 128 in font DebugFont
15:42:25: Info: Freetype returned null for character 129 in font DebugFont
15:42:25: Info: Freetype returned null for character 130 in font DebugFont
15:42:25: Info: Freetype returned null for character 131 in font DebugFont
15:42:25: Info: Freetype returned null for character 132 in font DebugFont
15:42:25: Info: Freetype returned null for character 133 in font DebugFont
15:42:25: Info: Freetype returned null for character 134 in font DebugFont
15:42:25: Info: Freetype returned null for character 135 in font DebugFont
15:42:25: Info: Freetype returned null for character 136 in font DebugFont
15:42:25: Info: Freetype returned null for character 137 in font DebugFont
15:42:25: Info: Freetype returned null for character 138 in font DebugFont
15:42:25: Info: Freetype returned null for character 139 in font DebugFont
15:42:25: Info: Freetype returned null for character 140 in font DebugFont
15:42:25: Info: Freetype returned null for character 141 in font DebugFont
15:42:25: Info: Freetype returned null for character 142 in font DebugFont
15:42:25: Info: Freetype returned null for character 143 in font DebugFont
15:42:25: Info: Freetype returned null for character 144 in font DebugFont
15:42:25: Info: Freetype returned null for character 145 in font DebugFont
15:42:25: Info: Freetype returned null for character 146 in font DebugFont
15:42:25: Info: Freetype returned null for character 147 in font DebugFont
15:42:25: Info: Freetype returned null for character 148 in font DebugFont
15:42:25: Info: Freetype returned null for character 149 in font DebugFont
15:42:25: Info: Freetype returned null for character 150 in font DebugFont
15:42:25: Info: Freetype returned null for character 151 in font DebugFont
15:42:25: Info: Freetype returned null for character 152 in font DebugFont
15:42:25: Info: Freetype returned null for character 153 in font DebugFont
15:42:25: Info: Freetype returned null for character 154 in font DebugFont
15:42:25: Info: Freetype returned null for character 155 in font DebugFont
15:42:25: Info: Freetype returned null for character 156 in font DebugFont
15:42:25: Info: Freetype returned null for character 157 in font DebugFont
15:42:25: Info: Freetype returned null for character 158 in font DebugFont
15:42:25: Info: Freetype returned null for character 159 in font DebugFont
15:42:25: Info: Freetype returned null for character 160 in font DebugFont
15:42:29: Saving HlmsDiskCache to hlmsDiskCache1.bin
15:42:29: Saving HlmsDiskCache to hlmsDiskCache3.bin
15:42:29: Unregistering ResourceManager for type Font
15:42:29: DefaultWorkQueue('Root') shutting down on thread main.
15:42:29: *-*-* OGRE Shutdown
15:42:29: Unregistering ResourceManager for type OldSkeleton
15:42:29: Unregistering ResourceManager for type Mesh2
15:42:29: Unregistering ResourceManager for type Mesh
15:42:29: Unregistering ResourceManager for type Material
15:42:29: Unregistering ResourceManager for type HighLevelGpuProgram
15:42:29: Uninstalling plugin: ParticleFX
15:42:29: Plugin successfully uninstalled
15:42:29: Unloading library Plugin_ParticleFX
15:42:29: Uninstalling plugin: Metal RenderSystem
15:42:29: Unregistering ResourceManager for type GpuProgram
15:42:29: Plugin successfully uninstalled
15:42:29: Unloading library RenderSystem_Metal
-->
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with HlmsPbs::createDatablockImpl in OgreHlmsPbs.cpp and reproduce the issue by enabling two-sided lighting, rebuilding HlmsPbs, and running Sample_PlanarReflections on Metal. Compare the reflected output, especially with unlit mirrors, and consider the issue done when two-sided PBS reflections render correctly without the reported visual artifacts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100