[2.2] Self Shadowing errors
-
- Gnoll
- Posts: 659
- Joined: Mon Aug 06, 2007 12:53 pm
- Location: Saarland, Germany
- x 63
Re: [2.2] Self Shadowing errors
I tested some Ogre demos, and there is something wrong. Echout eg. the SSAO, SMAA demos.
Best Regards
Lax
http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62
-
- OGRE Contributor
- Posts: 203
- Joined: Sat Jul 16, 2011 8:29 pm
- Location: UK
- x 51
Re: [2.2] Self Shadowing errors
Tested on both the opengl and DX11 render system, both demos look like they always have for me apart from the smaa demo shadows look wrong in dx11 but fine in gl..
SSAO demo doesnt use shadows i thought?
-
- Gnoll
- Posts: 659
- Joined: Mon Aug 06, 2007 12:53 pm
- Location: Saarland, Germany
- x 63
Re: [2.2] Self Shadowing errors
http://www.lukas-kalinowski.com/Homepag ... rQueue.mp4
Best Regards
Lax
http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62
-
- OGRE Contributor
- Posts: 203
- Joined: Sat Jul 16, 2011 8:29 pm
- Location: UK
- x 51
Re: [2.2] Self Shadowing errors
Edit: Perhaps try a full clean / rebuild of your app or redownload the latest version and try that. I cant say i have much information to help you.
-
- Gnoll
- Posts: 659
- Joined: Mon Aug 06, 2007 12:53 pm
- Location: Saarland, Germany
- x 63
Re: [2.2] Self Shadowing errors
I did't change anything on the code nor on the compositors. I only updated to newest Ogre version.This didnt happen for you on the last version of the shadows? but appears after the new patch.
I also checked the compositors via winmerge and everything looks the same.
I also replaced hlms code with Ogre's code. Is it maybe because I'm still on the 'shadow_bias_improve' branch?
Best Regards
Lax
http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62
-
- OGRE Contributor
- Posts: 203
- Joined: Sat Jul 16, 2011 8:29 pm
- Location: UK
- x 51
Re: [2.2] Self Shadowing errors
-
- OGRE Team Member
- Posts: 5446
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1348
Re: [2.2] Self Shadowing errors
I tested the SSAO in GL and it was working (will try D3D11 later). HOWEVER, I left MSAA enabled, and I totally forgot SSAO demo does not work with MSAA (we should fix that) and does not warn about it either, so it looks very weird when MSAA is enabled (the whole screen is darkened). Perhaps this is what you experienced?
Btw there are no shadows in the SSAO sample (because that's how the sample was setup)
-
- Gnoll
- Posts: 659
- Joined: Mon Aug 06, 2007 12:53 pm
- Location: Saarland, Germany
- x 63
Re: [2.2] Self Shadowing errors
see the attached video, what is going wrong:
http://www.lukas-kalinowski.com/Homepag ... rQueue.mp4
I have also the same effect on the Ogre demos.
Best Regards
Lax
http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62
-
- OGRE Team Member
- Posts: 5446
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1348
Re: [2.2] Self Shadowing errors
I don't know why the demos are affected for you, but I have a very good guess on your app:Lax wrote: ↑Sun Jun 21, 2020 8:42 pm Hi dark_sylinc,
see the attached video, what is going wrong:
http://www.lukas-kalinowski.com/Homepag ... rQueue.mp4
I have also the same effect on the Ogre demos.
Best Regards
Lax
- One of the DLLs is out of date (e.g. OgreMain or RenderSystem)
- The headers are out of date
- You need a full rebuild of either Ogre and/or your app
Thus if one of the builds got out of sync, it would read mDepthCheck = false (thus disabling depth buffer) because it's reading from where now mDepthClamp is. Or inversely, it now reads garbage from mDepthWrite because it's reading from mDepthFunc.
Additionally, sizeof(HlmsMacroblock) changed.
One of your builds getting out of sync would explain what you're seeing.
-
- Gnoll
- Posts: 659
- Joined: Mon Aug 06, 2007 12:53 pm
- Location: Saarland, Germany
- x 63
Re: [2.2] Self Shadowing errors
thanks for the information. Indeed, something went wrong by surprise when building RenderSystem_Direct3D11 project. Its strange, as it worked a few days ago. The error is, that the file OgreD3D11RenderWindow.h cannot be found. I took a look and found the file in a deprecated folder.
Do you have any idea how to fix that?
[Edit]: Damn it, in cmake config I had quad_buffer_stereo enabled and because of that some deprecated stuff was used. Sorry for spamming you guys.
Best Regards
Lax
http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62
-
- OGRE Team Member
- Posts: 5446
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1348
Re: [2.2] Self Shadowing errors
Fixed. That was the reason D3D11 showed some shadow acne while OpenGL did not.
The geometric normal D3D11 was using was pure garbage.
Both APIs now visually match.
-
- OGRE Contributor
- Posts: 203
- Joined: Sat Jul 16, 2011 8:29 pm
- Location: UK
- x 51
Re: [2.2] Self Shadowing errors
-
- Gnoll
- Posts: 659
- Joined: Mon Aug 06, 2007 12:53 pm
- Location: Saarland, Germany
- x 63
Re: [2.2] Self Shadowing errors
Yes, I can confirm, that shadows do look very good now!@dark_sylinc, that last shadow patch makes both renderers the same for me now
http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62
-
- OGRE Team Member
- Posts: 5446
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1348
Re: [2.2] Self Shadowing errors
Sounds like this is going to get merged into master soon
-
- OGRE Expert User
- Posts: 1148
- Joined: Sat Jul 06, 2013 10:59 pm
- Location: Chile
- x 169
Re: [2.2] Self Shadowing errors
and I got most of the answers, so I am going to test those stuffs, sorry
Hello!
I am just trying this and I do get less acne and peter panning, mostly noticeable on thin stuffs, so that's great!
buuuuuut... I have a problem concerning setShadowMappingUseBackFaces that was removed:
1) I have some scenes with single faced walls/ceilings that now no longer cast shadows
2) Now I get acne on floors on far splits with very low resolution (I also use stable for every split, so they are very low res), I can increase bias and remove the acne but I get lots of peter panning on other objects
I know that I can just duplicate the faces to make them have thickness so they cast shadows, and I can make my floor just not to cast shadows.... I just prefer when thinks works automagically. So... bringing back setShadowMappingUseBackFaces is compatible with this new features?
Also in one particular (very simple) scene shadows disappear when the light is pointing perfectly down (0,-1,0) (aka 12pm in an ideal planet), as soon as I move the sun a little the shadow appear, and I cannot find a bias value to fix this
I haven't seen this last problem in a proper application yet so its not serious, still strange
Thank youuu!!!!
-
- OGRE Team Member
- Posts: 5446
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1348
Re: [2.2] Self Shadowing errors
It's not. Normal offset mapping way distorts too much with setShadowMappingUseBackFaces( true ), thus if that were to be enabled, everything would have to work the way it was before in order to look correct, which is too much work both for us and you (from our end we need 2 codepaths, and from your end settings need to be in sync i.e. different bias parameters, setting up caster blocks, etc)
Stable splits for very far splits lose too much quality2) Now I get acne on floors on far splits with very low resolution (I also use stable for every split, so they are very low res), I can increase bias and remove the acne but I get lots of peter panning on other objects
If it's the floor which is causing noticeable self shadowing, then I'd recommend to disable shadow casting on that particular troublesome object, or increase either of the 2 biases.
Hold on!I know that I can just duplicate the faces to make them have thickness so they cast shadows
You can also:
- Call setTwoSidedLighting( true, true, CULL_NONE );
- Not use the above, but still flip the culling mode (or set it to CULL_NONE) via setMacroblock( flippedMacroblock, casterBlock=true );
That looks like a bug, and I'm interested in looking into it.
I think I can pull the latest changes from your repo and try it out myself? (if you somehow manage to repro that on the samples it would be even awesome).
I can't look at this immediately though, but thanks for the feedback.
Update: I was able to repro your "disappearing box shadow" problem in ShadowMapDebugging by setting the sun to exactly 0 -1 0 and all splits set to stable
-
- OGRE Team Member
- Posts: 5446
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1348
Re: [2.2] Self Shadowing errors
Fixed. It was a precision error. Some padding fixed it.
-
- OGRE Expert User
- Posts: 1148
- Joined: Sat Jul 06, 2013 10:59 pm
- Location: Chile
- x 169
Re: [2.2] Self Shadowing errors
-
- Gnoll
- Posts: 659
- Joined: Mon Aug 06, 2007 12:53 pm
- Location: Saarland, Germany
- x 63
Re: [2.2] Self Shadowing errors
I now had the time, to debug and adapt my shadows etc. But as I analysed everything something weird came to my mind, which I think does not work for a long time. When I move the camera a bit away from an game object with shadows, the shadows will blur out immediately. In all Ogre Samples, this is not the case.
See the attached video:
http://www.lukas-kalinowski.com/Homepag ... stance.mp4
Does anybody have an idea what is going on?
I tested the following:
- I used the workspace from Sample_PbsMaterials for exclusion.
- My camera has a near clip distance of 0.1 and far clip distance of 500
- The setShadowDirectionalLightExtrusionDistance and light extrude distance is 500
- I' using the default shadows values:
- constantBiasScale = 1.0f
- normalOffsetBias = 168.0f
- autoConstantBiasScale = 100.0f
- autoNormalOffsetBiasScale = 4.0f
- pssmLambda = 0.95f
- splitPadding = 1.0f
- splitBlend = 0.125f
- splitFade = 0.313f
This is the json script for the brick:
Code: Select all
{
"samplers" :
{
"Sampler_Platformer" :
{
"min" : "anisotropic",
"mag" : "anisotropic",
"mip" : "anisotropic",
"u" : "wrap",
"v" : "wrap",
"w" : "wrap",
"miplodbias" : 0,
"max_anisotropic" : 1,
"compare_function" : "disabled",
"border" :[1, 1, 1, 1],
"min_lod" : -3.40282e+38,
"max_lod" : 3.40282e+38
}
},
"macroblocks" :
{
"Macroblock_Platformer" :
{
"scissor_test" : false,
"depth_check" : true,
"depth_write" : true,
"depth_function" : "less_equal",
"depth_bias_constant" : 0,
"depth_bias_slope_scale" : 0,
"cull_mode" : "clockwise",
"polygon_mode" : "solid"
}
},
"blendblocks" :
{
"Blendblock_Platformer" :
{
"alpha_to_coverage" : false,
"blendmask" : "rgba",
"separate_blend" : false,
"src_blend_factor" : "one",
"dst_blend_factor" : "one_minus_src_alpha",
"blend_operation" : "add"
}
},
"M_Brick" :
{
"macroblock" : "Macroblock_Platformer",
"blendblock" : "Blendblock_Platformer",
"shadow_const_bias" : 0.001,
"workflow" : "SpecularWorkflow",
"brdf" : "blinn_phong",
"diffuse" :
{
"value" : [1, 1, 1],
"background" : [1, 1, 1, 1],
"texture" : "M_BrickD.png",
"sampler" : "Sampler_Platformer"
},
"specular" :
{
"value" : [1, 1, 1]
},
"fresnel" :
{
"value" : 0.1,
"mode" : "coeff"
},
"normal" :
{
"value" : 1,
"texture" : "M_BrickN.png",
"sampler" : "Sampler_Platformer"
},
"roughness" :
{
"value" : 1.7
}
}
}
}
http://www.lukas-kalinowski.com/Homepag ... tance2.mp4
I hope someone can help.
Best Regards
Lax
http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62
-
- Gnoll
- Posts: 659
- Joined: Mon Aug 06, 2007 12:53 pm
- Location: Saarland, Germany
- x 63
Re: [2.2] Self Shadowing errors
http://www.lukas-kalinowski.com/Homepag ... caling.mp4
When I change the extrusion distances, the following happens:
http://www.lukas-kalinowski.com/Homepag ... caling.mp4
The pssm shadow textures are switched to early? I use default Pbs workspace with default pssm values (to avoid interferences).
@dark_sylinc: can something be done about it?
I'm using the newest Ogre version from git master.
[Edit]: The Pbs Samples the items are also small . So why are the samples working correctly...
Best Regards
Lax
http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62
-
- Gnoll
- Posts: 659
- Joined: Mon Aug 06, 2007 12:53 pm
- Location: Saarland, Germany
- x 63
Re: [2.2] Self Shadowing errors
I use a MainGameObject, which is just an Node carrying meta data information. The MainGameObject is placed by default at the coordinates: -1000 -1000 -1000. This causes all my shadows issues. I think proportions of the scene do explode, as all other game objects are laying nearby but the MainGameObject is far away...
Also when I increase the plane size from 50x50 to 500x500 I get similiar shadow issues.
http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62