Page 2 of 2

Re: What PBS workflow is using ogre2? metallic or specular?

Posted: Thu Apr 09, 2015 2:48 am
by PiroKun
dark_sylinc wrote:Gotcha. I'll add a fresnel texture to my todo list. You can ignore specular if you want to; and it then remains to be a matter of naming conventions. I may end up changing "specular" in the scripts for coloured fresnel, and "kS" for the explicit specular colour.
Thanks Matias!! thats sound really great :)!
Ogre is getting better and better everyday~

Re: What PBS workflow is using ogre2? metallic or specular?

Posted: Thu Apr 09, 2015 2:57 am
by xrgo
dark_sylinc wrote:Gotcha. I'll add a fresnel texture to my todo list.
Thank youuuuuuuu!!!!
dark_sylinc wrote:I may end up changing "specular" in the scripts for coloured fresnel, and "kS" for the explicit specular colour.
Yes! please do that! and for c++ stuffs too.

with that changes we will have a perfect specular workflow!!

this is the current default implementation using white specular and specular color as colored fresnel:
Image

looks almost identical to marmoset =D!:
Image

the only thing that would be missing is what pirokun mentioned about the roughness decreasing the reflection. In Unity and sketchfab for instance when roughness is 1 the reflection at grazing angles is 0! but in marmoset it decreases a lot but there is still a little left:
roughness black:
Image
roughness white:
Image

Thanks again!

Re: What PBS workflow is using ogre2? metallic or specular?

Posted: Sun Apr 12, 2015 12:26 pm
by al2950
Just noticed that there is a fairly large difference between Dx11 & OpenGl, atleast on the PBSMaterial sample. OpenGl looks correct but the roughness values do not look right on Dx11. I have had a quick look at the output shaders but I can not see anything obviously wrong/different.

See below for screen shots

OpenGL 3+
Gl3+.jpg
Dx11
Dx11.jpg

Re: What PBS workflow is using ogre2? metallic or specular?

Posted: Mon Apr 13, 2015 3:30 am
by dark_sylinc
al2950 wrote:Just noticed that there is a fairly large difference between Dx11 & OpenGl, atleast on the PBSMaterial sample. OpenGl looks correct but the roughness values do not look right on Dx11. I have had a quick look at the output shaders but I can not see anything obviously wrong/different.
I took a quick look with RenderDoc. The problem is that DX11 render system stops at 4x4 mip level for DXT1/BC1 textures (because BC1 textures are in 4x4 blocks). I noticed this and decided to ignore it since I thought it wouldn't matter much. Obviously I was wrong.
This is causing noticeable differences at low roughness, but also changes all of them since now there are lower amounts of mips.

I swear I don't know which one is more troublesome, uploading a texture in OpenGL, or uploading a texture in Direct3D 11. OGL is only getting the benefit of maturity in our codebase.

Thanks for the report.

Re: What PBS workflow is using ogre2? metallic or specular?

Posted: Sat Apr 18, 2015 7:26 pm
by dark_sylinc
The divergence between D3D11 & OpenGL is fixed.
https://bitbucket.org/sinbad/ogre/commi ... 4c49a92555

Re: What PBS workflow is using ogre2? metallic or specular?

Posted: Tue Nov 03, 2015 1:07 am
by dark_sylinc
Metallic workflow was added in 170b0e496890146b174e0157b48871753f567aea

At the moment there is no script interface. You'll have to do it from C++:

Code: Select all

datablock->setMetallicWorkflow( true );
datablock->setMetallness( metallness );
The specular texture becomes the metalness texture after this call. Turning it off turns it back into a specular texture.
Calling setFresnel and setIndexOfRefraction will result in undefined behavior when metallic workflow is enabled (it asserts in debug mode so you know you shouldn't be doing that).

Have fun.
Cheers.

Re: What PBS workflow is using ogre2? metallic or specular?

Posted: Tue Nov 03, 2015 1:41 am
by xrgo
good news for everyone!
Thanks! although I am happy with my implementation so I don't think I am going to test it =/

Re: What PBS workflow is using ogre2? metallic or specular?

Posted: Wed Nov 04, 2015 8:45 am
by Daixiwen
That's awesome, you are really doing a great job with 2.1!
Is there any impact on performance if mixing different workflows on different datablocks, or will it be negligible? I assume the HLMS will just generate different shaders?

Re: What PBS workflow is using ogre2? metallic or specular?

Posted: Wed Nov 04, 2015 4:23 pm
by dark_sylinc
Yes they will generate slightly different shaders.

I expect performance impact of mixing the workflows to be negligible in theory. But all is relative. You can have up to three workflow settings (old Specular, specular fresnel, Metallic), which means up to three more variations.
The amount of actual shaders depends on the different permutation of settings you use, so if you use all three workflows, worst case scenario you can have "all_permutations * 3 = new_permutations" now.

Though, this mostly impacts CPU performance, and we're not CPU bottlenecked. Like I said, I'd expect the impact to be negligible.