HDRP Directional Light - Affect Specular

HDRP Directional Light - Affect Specular

for HDRP can you explain why we cannot turn off the main light additional properties “Affect Specular” locally per material within shaders?

over the last few years this has plagued users who wish to use transparency or subsurface shaders

even PR’s have been submitted multiple times over the years but never gets accepted into the main branch … please explain why this is so hard for Unity to solve

3 Likes

Hi!

The feature has recently landed (it is in 2023.1.0a9 onwards) and it is named specular fade in the docs.

To enable it, first make sure to have it set in the global settings: HDRP Global Settings Window | High Definition RP | 15.0.7

Then, if a material has a specular color of below 2% it will fade to no specular contribution (when specular color is set to fully 0)

Here is an example:

Without the specular fade:


With specular fade:

This is not physically accurate, but the option is here.

that wonderful
i just tested and it worked as expected!!!

however, this option is found deep inside “global settings”

with assets developers we have no way to enable this from a preset for users RenderPipelineAsset files

do we have a way to turn this on from script to have as default set true when an asset is downloaded by user

include overrides to “global settings” since this is not found in RenderPipelineAsset ?

also will this be backported :wink:

small note
instead using the term “physically correct”

try “physical based”

Hi,

An API to control all the RP Asset and Global Settings by script is currently worked on and should be available for 23.1.
This option is sadly a settings and not enforce to not break compatibility with existing project.

We don’t backport feature in previous version.

Hi there! I’m a bit late to the party. As I can see only the Lit and StackLit which have the Specular Color will benefit from this feature. Working on this asset made especially for vegetation, most of my users would like to disable the specular for Subsurface Scattering shaders, which doesn’t have a specular color so the feature cannot be used unless you disable the specular on the directional light.

My idea would be to control the specular fade via the smoothness maybe so all shaders could benefit from it.
Or simply add a check box for it, I guess the internal shading code is the same regardless of metallic or specular workflow so I think this could be implemented.

Thank you!

1 Like

I really need this too, my trees look horrible because of the specular from the directional light.