Specular problem

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


aymar
Greenskin
Posts: 145
Joined: Fri Jun 12, 2015 6:53 pm
Location: Florianopolis, Brazil
x 17

Re: Specular problem

Post by aymar »

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?
User avatar
miki3d
Halfling
Posts: 56
Joined: Wed Jul 18, 2012 1:30 pm
Location: Italy
x 4

Re: Specular problem

Post by miki3d »

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?
Hi!

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
It seems more consistent now, I'm waiting a confirm from matias (but I think he's going to implement it) if it's the right (an only) place.
Image
Co-Founder and Design Director at VaeVictis
Current project Racecraft
aymar
Greenskin
Posts: 145
Joined: Fri Jun 12, 2015 6:53 pm
Location: Florianopolis, Brazil
x 17

Re: Specular problem

Post by aymar »

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

Re: Specular problem

Post by dark_sylinc »

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.
User avatar
miki3d
Halfling
Posts: 56
Joined: Wed Jul 18, 2012 1:30 pm
Location: Italy
x 4

Re: Specular problem

Post by miki3d »

Hi Matias!

After your fix I still see a wrong reflection on the bottom part (my cubemap is completely black on the floor) :(

Image

Tnx :)
Image
Co-Founder and Design Director at VaeVictis
Current project Racecraft
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5299
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1279
Contact:

Re: Specular problem

Post by dark_sylinc »

Can I get the cubemap? Send it via PM or Skype.
User avatar
GlowingPotato
Goblin
Posts: 211
Joined: Wed May 08, 2013 2:58 pm
x 10

Re: Specular problem

Post by GlowingPotato »

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