[2.1] Decals And area light feedback

Design / architecture / roadmap discussions related to future of Ogre3D (version 2.0 and above)
Post Reply
al2950
OGRE Expert User
OGRE Expert User
Posts: 1146
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 59

[2.1] Decals And area light feedback

Post by al2950 » Mon Sep 24, 2018 5:21 pm

Just checked out latest branch on 2.1 (5055875cbad4a522d8e5334b126cf4bc8e6bd288), where the area light and decal work has been merged and thought I would have a quick look. Its all pretty cool stuff :D but here are some notes:

Area Lights
- The 'Sample_AreaApproxLights' should probably be renamed to 'Sample_AreaLights'!
- The fake area lights work great, but the texture/Mask API is a little obscure. Would it not be better having some form of helper function on light called Light::setAreaLightMask? Also needs to be made clearer that its just a mask and does not support eg diffuse textures
- The LTC lights do not look correct, I edited the sample to look like the reference in the LTC paper, and something is not right.
- I have tested with DirectX and OpenGL using standard rendering as well as 'advanced' rendering using the pre-pass stuff.

Decals
- The implementation seems great, but the documentation needs to be updated to describe how to set the size, and more importantly the depth.
- When using pre-pass advanced rendering, in Direct 3D ONLY, the reflection texture projection goes completely wrong. Hard to describe, but reflection sample seem to be based on camera direction instead of reflection vector.
- Apart from that decals are awesome :D

As I was testing some of the more advanced pipelines the pre-pass rendering pipeline shadows are a little broken. Again hard to explain, and is not noticeable in the ScreenSpaceReflections sample. But very obvious if you change PBSMaterials to use pre-pass based pipeline (I am happy to create a separate sample to show this if needed)
1 x

rujialiu
Greenskin
Posts: 140
Joined: Mon May 09, 2016 8:21 am
x 11

Re: [2.1] Decals And area light feedback

Post by rujialiu » Mon Sep 24, 2018 5:33 pm

al2950 wrote:
Mon Sep 24, 2018 5:21 pm
- The LTC lights do not look correct, I edited the sample to look like the reference in the LTC paper, and something is not right.
ah! Could you post your edits? I'm interested too.
I've also evaluated LTC area lights. Sometimes the specular reflection looks "distorted", but that's in my software. I have not found enough time to edit the sample though.

When three.js implemented LTC based area lights, they had a detailed discussion:
https://github.com/mrdoob/three.js/issues/8718

One thing caught my eye: it looks like the author had a different coordinate system than three.js's right-handed Y-up one (which is the same as Ogre!). I don't know what changes they made though.
0 x

al2950
OGRE Expert User
OGRE Expert User
Posts: 1146
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 59

Re: [2.1] Decals And area light feedback

Post by al2950 » Mon Sep 24, 2018 5:55 pm

Ive uploaded a commit which tests the pre pass pipelines for all samples that use the PBS material compositor, which is most samples, so easy to test!

My area light changes are very hacky, but here is a patch. Basically makes one the area lights perpendicular to the floor plane, and sets a custom materials that can be tuned (eg rouhgness)

Code: Select all

diff -r 194ffb072eed Samples/2.0/ApiUsage/AreaApproxLights/AreaApproxLightsGameState.cpp
--- a/Samples/2.0/ApiUsage/AreaApproxLights/AreaApproxLightsGameState.cpp	Mon Sep 24 17:49:04 2018 +0100
+++ b/Samples/2.0/ApiUsage/AreaApproxLights/AreaApproxLightsGameState.cpp	Mon Sep 24 17:54:42 2018 +0100
@@ -235,8 +235,28 @@
         planeMesh->importV1( planeMeshV1.get(), true, true, true );
 
         {
+			Ogre::HlmsManager *hlmsManager = mGraphicsSystem->getRoot()->getHlmsManager();
+			Ogre::HlmsTextureManager *hlmsTextureManager = hlmsManager->getTextureManager();
+
+			assert(dynamic_cast<Ogre::HlmsPbs*>(hlmsManager->getHlms(Ogre::HLMS_PBS)));
+
+			Ogre::HlmsPbs *hlmsPbs = static_cast<Ogre::HlmsPbs*>(hlmsManager->getHlms(Ogre::HLMS_PBS));
+
+			Ogre::String datablockName = "TestPlane" ;
+			Ogre::HlmsPbsDatablock *datablock = static_cast<Ogre::HlmsPbsDatablock*>(
+				hlmsPbs->createDatablock(datablockName,
+				datablockName,
+				Ogre::HlmsMacroblock(),
+				Ogre::HlmsBlendblock(),
+				Ogre::HlmsParamVec()));
+
+			datablock->setWorkflow(Ogre::HlmsPbsDatablock::MetallicWorkflow);
+			datablock->setRoughness(0.05);
+			datablock->setMetalness((0.0));
+			datablock->setDiffuse(Ogre::Vector3(0.2, 0.2, 0.2));
+
             Ogre::Item *item = sceneManager->createItem( planeMesh, Ogre::SCENE_DYNAMIC );
-            item->setDatablock( "Marble" );
+			item->setDatablock(datablock);
             Ogre::SceneNode *sceneNode = sceneManager->getRootSceneNode( Ogre::SCENE_DYNAMIC )->
                                                     createChildSceneNode( Ogre::SCENE_DYNAMIC );
             sceneNode->setPosition( 0, -1, 0 );
@@ -244,22 +264,22 @@
 
             //Change the addressing mode of the roughness map to wrap via code.
             //Detail maps default to wrap, but the rest to clamp.
-            assert( dynamic_cast<Ogre::HlmsPbsDatablock*>( item->getSubItem(0)->getDatablock() ) );
-            Ogre::HlmsPbsDatablock *datablock = static_cast<Ogre::HlmsPbsDatablock*>(
-                                                            item->getSubItem(0)->getDatablock() );
-            //Make a hard copy of the sampler block
-            Ogre::HlmsSamplerblock samplerblock( *datablock->getSamplerblock( Ogre::PBSM_ROUGHNESS ) );
-            samplerblock.mU = Ogre::TAM_WRAP;
-            samplerblock.mV = Ogre::TAM_WRAP;
-            samplerblock.mW = Ogre::TAM_WRAP;
-            //Set the new samplerblock. The Hlms system will
-            //automatically create the API block if necessary
-            datablock->setSamplerblock( Ogre::PBSM_ROUGHNESS, samplerblock );
+            //assert( dynamic_cast<Ogre::HlmsPbsDatablock*>( item->getSubItem(0)->getDatablock() ) );
+            //Ogre::HlmsPbsDatablock *datablock = static_cast<Ogre::HlmsPbsDatablock*>(
+            //                                                item->getSubItem(0)->getDatablock() );
+            ////Make a hard copy of the sampler block
+            //Ogre::HlmsSamplerblock samplerblock( *datablock->getSamplerblock( Ogre::PBSM_ROUGHNESS ) );
+            //samplerblock.mU = Ogre::TAM_WRAP;
+            //samplerblock.mV = Ogre::TAM_WRAP;
+            //samplerblock.mW = Ogre::TAM_WRAP;
+            ////Set the new samplerblock. The Hlms system will
+            ////automatically create the API block if necessary
+            //datablock->setSamplerblock( Ogre::PBSM_ROUGHNESS, samplerblock );
         }
 
-        for( int i=0; i<4; ++i )
+        for( int i=0; i<1; ++i )
         {
-            for( int j=0; j<4; ++j )
+            for( int j=0; j<1; ++j )
             {
                 Ogre::String meshName;
 
@@ -304,16 +324,16 @@
 
             Ogre::HlmsPbs *hlmsPbs = static_cast<Ogre::HlmsPbs*>( hlmsManager->getHlms(Ogre::HLMS_PBS) );
 
-            const int numX = 8;
-            const int numZ = 8;
+            const int numX = 1;
+            const int numZ = 1;
 
             const float armsLength = 1.0f;
             const float startX = (numX-1) / 2.0f;
             const float startZ = (numZ-1) / 2.0f;
 
-            for( int x=0; x<numX; ++x )
+			for (int x = 0; x<numX; ++x)
             {
-                for( int z=0; z<numZ; ++z )
+				for (int z = 0; z<numZ; ++z)
                 {
                     Ogre::String datablockName = "Test" + Ogre::StringConverter::toString( numSpheres++ );
                     Ogre::HlmsPbsDatablock *datablock = static_cast<Ogre::HlmsPbsDatablock*>(
@@ -397,8 +417,8 @@
         light->setPowerScale( Ogre::Math::PI );
         light->setType( Ogre::Light::LT_AREA_APPROX );
         light->setRectSize( Ogre::Vector2( 5.0f, 5.0f ) );
-        lightNode->setPosition( 5.0f, 4.0f, -5.0f );
-        light->setDirection( Ogre::Vector3( -1, -1, 1 ).normalisedCopy() );
+        lightNode->setPosition( 5.0f, 2.0f, -5.0f );
+        light->setDirection( Ogre::Vector3( -1, 0, 0 ).normalisedCopy() );
         light->setAttenuationBasedOnRadius( 10.0f, 0.01f );
         //When the array index is 0xFFFF, the light won't use a texture.
         light->mTextureLightMaskIdx = std::numeric_limits<Ogre::uint16>::max();
@@ -422,8 +442,8 @@
     {
         if( mAnimateObjects )
         {
-            for( int i=0; i<16; ++i )
-                mSceneNode[i]->yaw( Ogre::Radian(timeSinceLast * i * 0.125f) );
+            //for( int i=0; i<16; ++i )
+            //    mSceneNode[i]->yaw( Ogre::Radian(timeSinceLast * i * 0.125f) );
 
             mLightNodes[1]->roll( Ogre::Radian( timeSinceLast ) );
             mLightNodes[1]->yaw( Ogre::Radian( timeSinceLast ) );

0 x

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 3840
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 150
Contact:

Re: [2.1] Decals And area light feedback

Post by dark_sylinc » Tue Sep 25, 2018 5:55 am

Hi!

I'm about to go to bed so I'll make quick comments and I may miss things:
al2950 wrote:
Mon Sep 24, 2018 5:21 pm
- The 'Sample_AreaApproxLights' should probably be renamed to 'Sample_AreaLights'!
Yeah, I've been trying to avoid that due to Source Control shenanigans
al2950 wrote:
Mon Sep 24, 2018 5:21 pm
- The fake area lights work great, but the texture/Mask API is a little obscure. Would it not be better having some form of helper function on light called Light::setAreaLightMask?
Agreed. The problem comes from that only one array can be active per pass.
The new poolId for HlmsTextureManager should make this much easier. I (or someone) needs to change the sample to use these pool IDs instead.
This is much easier to handle in 2.2; because it's all texture stuff, and 2.2 has much clearer methods for handling it.
al2950 wrote:
Mon Sep 24, 2018 5:21 pm
Also needs to be made clearer that its just a mask and does not support eg diffuse textures
I don't understand what you mean by this.
al2950 wrote:
Mon Sep 24, 2018 5:21 pm
- The LTC lights do not look correct, I edited the sample to look like the reference in the LTC paper, and something is not right.
The code is based from LTC Quad sandbox (original repo) and it looks the same to me ¯\_(ツ)_/¯

A couple notes:
  1. You're using Metallic workflow but the original sample used fresnel workflow (still testing other workflows is cool, for instance your sample crashed due to my OpenGL driver complaining about invalid glsl syntax)
  2. Your datablock's diffuse is set to 0.2, which is a very dim white (does not match the reference)
  3. The other lights are getting in the way. I disable them quickly by multiplying their setPowerScale by 0
Decals
- The implementation seems great, but the documentation needs to be updated to describe how to set the size, and more importantly the depth.
Noted. And I can see why after being pointed out. I may need to be reminded of this again. Too much in my head going on right now.
- When using pre-pass advanced rendering, in Direct 3D ONLY, the reflection texture projection goes completely wrong. Hard to describe, but reflection sample seem to be based on camera direction instead of reflection vector.
Yeah, Decals' compatibility with pre-pass needs a lot of testing. Normals are evaluated in the prepass IIRC, while diffuse & emissive should be evaluated during the reuse pass.
As I was testing some of the more advanced pipelines the pre-pass rendering pipeline shadows are a little broken. Again hard to explain, and is not noticeable in the ScreenSpaceReflections sample. But very obvious if you change PBSMaterials to use pre-pass based pipeline (I am happy to create a separate sample to show this if needed)
Please! TBH I forgot how prepass worked...
0 x

al2950
OGRE Expert User
OGRE Expert User
Posts: 1146
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 59

Re: [2.1] Decals And area light feedback

Post by al2950 » Tue Sep 25, 2018 5:18 pm

dark_sylinc wrote:
Tue Sep 25, 2018 5:55 am
al2950 wrote: ↑Mon Sep 24, 2018 4:21 pm
Also needs to be made clearer that its just a mask and does not support eg diffuse textures
I don't understand what you mean by this.
Holy crap it supports fully textured area lights :D :D . I was misled by the fact the sample is just a mask and all the variable names are *mask! Suggest changing that! Also it did not work out of the box as the areaLightMasks in the shader is defined as

Code: Select all

Texture2DArray<float> areaLightMasks
But needs a switch when its a colour texture

Code: Select all

Texture2DArray<float3> areaLightMasks
Not really sure why the effort to support a mask texture separate to a coloured texture?
dark_sylinc wrote:
Tue Sep 25, 2018 5:55 am
As I was testing some of the more advanced pipelines the pre-pass rendering pipeline shadows are a little broken. Again hard to explain, and is not noticeable in the ScreenSpaceReflections sample. But very obvious if you change PBSMaterials to use pre-pass based pipeline (I am happy to create a separate sample to show this if needed)
Please! TBH I forgot how prepass worked...
Done! . The lighting issues can be seen when using forwardPlus as well as standard forward, although in different ways. Its seems to be a light culling issue, and the light is bing incorrectly culled in both shadow and lighting passes but in different ways :(
dark_sylinc wrote:
Tue Sep 25, 2018 5:55 am
al2950 wrote: ↑Mon Sep 24, 2018 4:21 pm
- The LTC lights do not look correct, I edited the sample to look like the reference in the LTC paper, and something is not right.
The code is based from LTC Quad sandbox (original repo) and it looks the same to me ¯\_(ツ)_/¯
ill get back to you on this!! And yes I know the sample hack patch that a posted above was horrible
2 x

rujialiu
Greenskin
Posts: 140
Joined: Mon May 09, 2016 8:21 am
x 11

Re: [2.1] Decals And area light feedback

Post by rujialiu » Wed Sep 26, 2018 2:34 pm

al2950 wrote:
Tue Sep 25, 2018 5:18 pm
Done! . The lighting issues can be seen when using forwardPlus as well as standard forward, although in different ways. Its seems to be a light culling issue, and the light is bing incorrectly culled in both shadow and lighting passes but in different ways :(
Great!!! We're not using SSR, so we don't use hybrid rendering. By reading your PR I realized that maybe we can still try hybrid rendering even without using SSR. Besides SSR, what else can be implemented/optimized with a z-prepass + thin G-Buffer? Volumetric lighting? SSAO/more advanced AO?
0 x

al2950
OGRE Expert User
OGRE Expert User
Posts: 1146
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 59

Re: [2.1] Decals And area light feedback

Post by al2950 » Wed Sep 26, 2018 3:29 pm

al2950 wrote:
Tue Sep 25, 2018 5:18 pm
dark_sylinc wrote:
al2950 wrote: - The LTC lights do not look correct, I edited the sample to look like the reference in the LTC paper, and something is not right.
The code is based from LTC Quad sandbox (original repo) and it looks the same to me ¯\_(ツ)_/¯
ill get back to you on this!! And yes I know the sample hack patch that a posted above was horrible
So area lights here is the comparison... I appreciate I am using different values here and there, but its roughly the same. You can see the approx version (image on the right seems reasonable), but the Ogre LTC version in the middle is completely wrong.

Image


In other news.... textured area lights :D :D


Image
1 x

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 3840
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 150
Contact:

Re: [2.1] Decals And area light feedback

Post by dark_sylinc » Wed Sep 26, 2018 3:31 pm

Can you post the scene setup? Thanks
0 x

al2950
OGRE Expert User
OGRE Expert User
Posts: 1146
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 59

Re: [2.1] Decals And area light feedback

Post by al2950 » Wed Sep 26, 2018 3:53 pm

dark_sylinc wrote:
Wed Sep 26, 2018 3:31 pm
Can you post the scene setup? Thanks
Really sorry, but whilst creating patch for you I re-ran the suite of tests, and it runs fine in OpenGL, not sure where or when I got this mixed up. However it is definitely broken in DirectX :oops: !

Code: Select all

diff -r bb8d0c77f1c1 Samples/2.0/ApiUsage/AreaApproxLights/AreaApproxLightsGameState.cpp
--- a/Samples/2.0/ApiUsage/AreaApproxLights/AreaApproxLightsGameState.cpp	Tue Sep 25 16:24:10 2018 +0100
+++ b/Samples/2.0/ApiUsage/AreaApproxLights/AreaApproxLightsGameState.cpp	Wed Sep 26 15:45:54 2018 +0100
@@ -235,8 +235,25 @@
         planeMesh->importV1( planeMeshV1.get(), true, true, true );
 
         {
+			Ogre::HlmsManager *hlmsManager = mGraphicsSystem->getRoot()->getHlmsManager();
+			Ogre::HlmsTextureManager *hlmsTextureManager = hlmsManager->getTextureManager();
+
+			assert(dynamic_cast<Ogre::HlmsPbs*>(hlmsManager->getHlms(Ogre::HLMS_PBS)));
+
+			Ogre::HlmsPbs *hlmsPbs = static_cast<Ogre::HlmsPbs*>(hlmsManager->getHlms(Ogre::HLMS_PBS));
+
             Ogre::Item *item = sceneManager->createItem( planeMesh, Ogre::SCENE_DYNAMIC );
-            item->setDatablock( "Marble" );
+			Ogre::String datablockName = "Test_plane";
+			Ogre::HlmsPbsDatablock *datablock = static_cast<Ogre::HlmsPbsDatablock*>(
+				hlmsPbs->createDatablock(datablockName,
+				datablockName,
+				Ogre::HlmsMacroblock(),
+				Ogre::HlmsBlendblock(),
+				Ogre::HlmsParamVec()));
+
+			datablock->setRoughness(0.2);
+			datablock->setDiffuse(Ogre::Vector3(1,1,1));
+			item->setDatablock(datablock);
             Ogre::SceneNode *sceneNode = sceneManager->getRootSceneNode( Ogre::SCENE_DYNAMIC )->
                                                     createChildSceneNode( Ogre::SCENE_DYNAMIC );
             sceneNode->setPosition( 0, -1, 0 );
@@ -244,22 +261,22 @@
 
             //Change the addressing mode of the roughness map to wrap via code.
             //Detail maps default to wrap, but the rest to clamp.
-            assert( dynamic_cast<Ogre::HlmsPbsDatablock*>( item->getSubItem(0)->getDatablock() ) );
-            Ogre::HlmsPbsDatablock *datablock = static_cast<Ogre::HlmsPbsDatablock*>(
-                                                            item->getSubItem(0)->getDatablock() );
-            //Make a hard copy of the sampler block
-            Ogre::HlmsSamplerblock samplerblock( *datablock->getSamplerblock( Ogre::PBSM_ROUGHNESS ) );
-            samplerblock.mU = Ogre::TAM_WRAP;
-            samplerblock.mV = Ogre::TAM_WRAP;
-            samplerblock.mW = Ogre::TAM_WRAP;
-            //Set the new samplerblock. The Hlms system will
-            //automatically create the API block if necessary
-            datablock->setSamplerblock( Ogre::PBSM_ROUGHNESS, samplerblock );
+            //assert( dynamic_cast<Ogre::HlmsPbsDatablock*>( item->getSubItem(0)->getDatablock() ) );
+            //Ogre::HlmsPbsDatablock *datablock = static_cast<Ogre::HlmsPbsDatablock*>(
+            //                                                item->getSubItem(0)->getDatablock() );
+            ////Make a hard copy of the sampler block
+            //Ogre::HlmsSamplerblock samplerblock( *datablock->getSamplerblock( Ogre::PBSM_ROUGHNESS ) );
+            //samplerblock.mU = Ogre::TAM_WRAP;
+            //samplerblock.mV = Ogre::TAM_WRAP;
+            //samplerblock.mW = Ogre::TAM_WRAP;
+            ////Set the new samplerblock. The Hlms system will
+            ////automatically create the API block if necessary
+            //datablock->setSamplerblock( Ogre::PBSM_ROUGHNESS, samplerblock );
         }
 
-        for( int i=0; i<4; ++i )
+        for( int i=0; i<0; ++i )
         {
-            for( int j=0; j<4; ++j )
+            for( int j=0; j<0; ++j )
             {
                 Ogre::String meshName;
 
@@ -304,8 +321,8 @@
 
             Ogre::HlmsPbs *hlmsPbs = static_cast<Ogre::HlmsPbs*>( hlmsManager->getHlms(Ogre::HLMS_PBS) );
 
-            const int numX = 8;
-            const int numZ = 8;
+            const int numX = 0;
+            const int numZ = 0;
 
             const float armsLength = 1.0f;
             const float startX = (numX-1) / 2.0f;
@@ -358,7 +375,7 @@
         Ogre::Light *light = sceneManager->createLight();
         Ogre::SceneNode *lightNode = rootNode->createChildSceneNode();
         lightNode->attachObject( light );
-        light->setPowerScale( 1.0f );
+        light->setPowerScale( 0 );
         light->setType( Ogre::Light::LT_DIRECTIONAL );
         light->setDirection( Ogre::Vector3( -1, -1, -1 ).normalisedCopy() );
 
@@ -371,7 +388,7 @@
         light->setSpecularColour( 0.8f, 0.4f, 0.2f );
         //Increase the strength 10x to showcase this light. Area approx lights are not
         //physically based so the value is more arbitrary than the other light types
-        light->setPowerScale( Ogre::Math::PI );
+        light->setPowerScale( 0 );
         light->setType( Ogre::Light::LT_AREA_APPROX );
         light->setRectSize( Ogre::Vector2( 15.0f, 15.0f ) );
         lightNode->setPosition( -10.0f, 6.0f, 10.0f );
@@ -388,17 +405,18 @@
 
         mAreaLights[0] = light;
         mLightNodes[1] = lightNode;
+		lightNode->setVisible(false);
 
         light = sceneManager->createLight();
         lightNode = rootNode->createChildSceneNode();
         lightNode->attachObject( light );
-        light->setDiffuseColour( 0.2f, 0.4f, 0.8f ); //Cold
-        light->setSpecularColour( 0.2f, 0.4f, 0.8f );
-        light->setPowerScale( Ogre::Math::PI );
+        light->setDiffuseColour( 1.0f, 1.0f, 1.0f ); //Cold
+		light->setSpecularColour(1.0f, 1.0f, 1.0f);
+        light->setPowerScale(4.0f );
         light->setType( Ogre::Light::LT_AREA_APPROX );
-        light->setRectSize( Ogre::Vector2( 5.0f, 5.0f ) );
-        lightNode->setPosition( 5.0f, 4.0f, -5.0f );
-        light->setDirection( Ogre::Vector3( -1, -1, 1 ).normalisedCopy() );
+        light->setRectSize( Ogre::Vector2( 4.0f, 4.0f ) );
+        lightNode->setPosition( 5.0f, 3.0f, -5.0f );
+        light->setDirection( Ogre::Vector3( -1, 0, 0 ).normalisedCopy() );
         light->setAttenuationBasedOnRadius( 10.0f, 0.01f );
         //When the array index is 0xFFFF, the light won't use a texture.
         light->mTextureLightMaskIdx = std::numeric_limits<Ogre::uint16>::max();
@@ -422,8 +440,8 @@
     {
         if( mAnimateObjects )
         {
-            for( int i=0; i<16; ++i )
-                mSceneNode[i]->yaw( Ogre::Radian(timeSinceLast * i * 0.125f) );
+            //for( int i=0; i<16; ++i )
+            //    mSceneNode[i]->yaw( Ogre::Radian(timeSinceLast * i * 0.125f) );
 
             mLightNodes[1]->roll( Ogre::Radian( timeSinceLast ) );
             mLightNodes[1]->yaw( Ogre::Radian( timeSinceLast ) );
rujialiu wrote:
Wed Sep 26, 2018 2:34 pm
al2950 wrote:
Tue Sep 25, 2018 5:18 pm
Done! . The lighting issues can be seen when using forwardPlus as well as standard forward, although in different ways. Its seems to be a light culling issue, and the light is bing incorrectly culled in both shadow and lighting passes but in different ways :(
Great!!! We're not using SSR, so we don't use hybrid rendering. By reading your PR I realized that maybe we can still try hybrid rendering even without using SSR. Besides SSR, what else can be implemented/optimized with a z-prepass + thin G-Buffer? Volumetric lighting? SSAO/more advanced AO?
Ignoring the performance improvements (compute shader based clustered shading requires pre-z aswell) There are a whole bunch of effects that require or have a version that requires a depth buffer, although it does not have to be a z-prepass. Volumetric lighting, SSAO, I certainly some popular ones. Also GPU particles, as they can use the scene depth buffer to perform some simple particle collision simulation. Most engines will also render a velocity buffer during the prepass for motion blur, etc. Hybrid rendering is the way forward!!
1 x

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 3840
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 150
Contact:

Re: [2.1] Decals And area light feedback

Post by dark_sylinc » Wed Sep 26, 2018 6:26 pm

al2950 wrote:
Wed Sep 26, 2018 3:53 pm
Really sorry, but whilst creating patch for you I re-ran the suite of tests, and it runs fine in OpenGL, not sure where or when I got this mixed up. However it is definitely broken in DirectX :oops: !
OH MY! That explains EVERYTHING!
Fixed.
Metal still needs to be tested though, it's possible this issue is still present there (or not). It's column major vs row major matrix issue.

Gotta love the watchful community :)
Thanks for the help in diagnosing this bug.
1 x

rujialiu
Greenskin
Posts: 140
Joined: Mon May 09, 2016 8:21 am
x 11

Re: [2.1] Decals And area light feedback

Post by rujialiu » Thu Sep 27, 2018 4:11 am

dark_sylinc wrote:
Wed Sep 26, 2018 6:26 pm
OH MY! That explains EVERYTHING!
Fixed.
Metal still needs to be tested though, it's possible this issue is still present there (or not). It's column major vs row major matrix issue.

Gotta love the watchful community :)
Thanks for the help in diagnosing this bug.
Great news! That should solve my "specular distortion" issue too. I was only using DX11 so I didn't realize DX11 is different from OpenGL.
Will test DX11 as well as Metal on iOS these two days.
1 x

Post Reply