lightDiffuse and lightSpecular in PBS

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


Post Reply
User avatar
DimA
Halfling
Posts: 59
Joined: Tue Jan 10, 2006 12:52 pm
Location: Ukraine
x 6
Contact:

lightDiffuse and lightSpecular in PBS

Post by DimA »

Hi all!

Current Ogre2.2 implementation of PBS uses two light colors: lightDiffuse and lightSpecular.

Code: Select all

float3 BRDF( float3 lightDir, float3 lightDiffuse, float3 lightSpecular, PixelData pixelData ){ ... }
But is it physically correct to have a separate light color for specular calculation?
Do we really need to force designers provide two colors for one light source instead of one?

Thanks,
Dima
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: lightDiffuse and lightSpecular in PBS

Post by dark_sylinc »

DimA wrote: Sat Jan 16, 2021 4:36 pm But is it physically correct to have a separate light color for specular calculation?
It would be a rare phenomenon, probably artificial because someone put a polarized filter at either the light source or camera lens, or could also happen in nature (aurora borealis perhaps?)

But is indeed rare.

It is more likely an artist may want to take advantage of it during a cutscene for artistic purposes
DimA wrote: Sat Jan 16, 2021 4:36 pm Do we really need to force designers provide two colors for one light source instead of one?
Because we're a graphics engine and not a fully fledged game engine, what you expose to your artist is up to you: you can expose a single colour value in your GUI and force both values to match.

The only question is whether we should add a perf. optimization property in Hlms so that we source from the same variable both spec and diffuse unless explicitly doing otherwise. The most likely answer is yes
User avatar
DimA
Halfling
Posts: 59
Joined: Tue Jan 10, 2006 12:52 pm
Location: Ukraine
x 6
Contact:

Re: lightDiffuse and lightSpecular in PBS

Post by DimA »

Thanks for prompt response!
Indeed, it would be great to have an option in Hlms and allow both approaches with light diffuse+specular and with light diffuse only.
Post Reply