What PBS workflow is using ogre2? metallic or specular?

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


PiroKun
Gnoblar
Posts: 6
Joined: Wed Mar 11, 2015 6:31 pm
x 7

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

Post 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~
xrgo
OGRE Expert User
OGRE Expert User
Posts: 1148
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 168

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

Post 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!
al2950
OGRE Expert User
OGRE Expert User
Posts: 1227
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 157

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

Post 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
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

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

Post 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.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

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

Post by dark_sylinc »

The divergence between D3D11 & OpenGL is fixed.
https://bitbucket.org/sinbad/ogre/commi ... 4c49a92555
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

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

Post 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.
xrgo
OGRE Expert User
OGRE Expert User
Posts: 1148
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 168

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

Post 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 =/
User avatar
Daixiwen
Greenskin
Posts: 105
Joined: Fri Feb 08, 2013 11:30 am
Location: Oslo
x 16

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

Post 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?
Hardware, n.: part of the computer you can kick
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

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

Post 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.
Post Reply