Specular problem
-
- Greenskin
- Posts: 145
- Joined: Fri Jun 12, 2015 6:53 pm
- Location: Florianopolis, Brazil
- x 17
Re: Specular problem
How can we adjust the fresnel like you did but using the metallic workflow?
Should we simply do the same thing (for instance when first computing FresnelS)?
Any thoughts?
Should we simply do the same thing (for instance when first computing FresnelS)?
Any thoughts?
- miki3d
- Halfling
- Posts: 56
- Joined: Wed Jul 18, 2012 1:30 pm
- Location: Italy
- x 4
Re: Specular problem
Hi!aymar wrote:How can we adjust the fresnel like you did but using the metallic workflow?
Should we simply do the same thing (for instance when first computing FresnelS)?
Any thoughts?
Actually we're using specular flow but I think the fresnel lerp is the same for the metallic flow, anyway we moved it up:
Code: Select all
@piece( BRDF_EnvMap )
float NdotL = saturate( dot( nNormal, reflDir ) );
float VdotH = saturate( dot( viewDir, normalize( reflDir + viewDir ) ) );
@insertpiece( FresnelType ) fresnelS = @insertpiece( getSpecularFresnel );
fresnelS = lerp( fresnelS, 0.03f, ROUGHNESS ); //Reduce fresnel with roughness
@property( fresnel_separate_diffuse )
@insertpiece( FresnelType ) fresnelD = @insertpiece( getDiffuseFresnel );
@end @property( !fresnel_separate_diffuse )
float fresnelD = 1.0f - @insertpiece( getMaxFresnelS );@end
finalColour += envColourD * @insertpiece( kD ).xyz * fresnelD +
envColourS * @insertpiece( kS ).xyz * fresnelS;
@end
-
- Greenskin
- Posts: 145
- Joined: Fri Jun 12, 2015 6:53 pm
- Location: Florianopolis, Brazil
- x 17
Re: Specular problem
Thanks, I'll try adding this.
Have you thought about putting the lerp calculation in the getSpecularFresnel piece? This way, whatever brdf being used will get it adjusted already... Please, let me know what you think...
Best.
Have you thought about putting the lerp calculation in the getSpecularFresnel piece? This way, whatever brdf being used will get it adjusted already... Please, let me know what you think...
Best.
- dark_sylinc
- OGRE Team Member
- Posts: 5299
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1279
- Contact:
Re: Specular problem
Hi everybody!
After long fighting this issue and researching, we found it's an understood problem.
I pushed a fix which is different from the proposed lerp solution. We use Sebastién's solution.
It should result in very similar looking results when the frensel colour is dark, but looks better for scenes with high fresnel values (since the lerp solution diminished all fresnel regardless of the F0 value, only using the roughness as reference).
We only do this with cubemaps.
Let me know if this works well for you.
After long fighting this issue and researching, we found it's an understood problem.
I pushed a fix which is different from the proposed lerp solution. We use Sebastién's solution.
It should result in very similar looking results when the frensel colour is dark, but looks better for scenes with high fresnel values (since the lerp solution diminished all fresnel regardless of the F0 value, only using the roughness as reference).
We only do this with cubemaps.
Let me know if this works well for you.
- miki3d
- Halfling
- Posts: 56
- Joined: Wed Jul 18, 2012 1:30 pm
- Location: Italy
- x 4
Re: Specular problem
Hi Matias!
After your fix I still see a wrong reflection on the bottom part (my cubemap is completely black on the floor)
Tnx
After your fix I still see a wrong reflection on the bottom part (my cubemap is completely black on the floor)
Tnx
- dark_sylinc
- OGRE Team Member
- Posts: 5299
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1279
- Contact:
Re: Specular problem
Can I get the cubemap? Send it via PM or Skype.
- GlowingPotato
- Goblin
- Posts: 211
- Joined: Wed May 08, 2013 2:58 pm
- x 10
Re: Specular problem
Strange, the shader is working flawless here. And I was having this issue before http://www.ogre3d.org/forums/viewtopic.php?f=25&t=84885
As you can see, is the same problem as yours, but the new code solved.
As you can see, is the same problem as yours, but the new code solved.