Weird highlighting on vegetations backside

Hi all,

I have a problem with the lighting on my tree’s backside.

What are these and how do I fix it? The environment is the HDRP terrain demo scene on Unity 2022.3.13f1. The trees are using the default HDRP Speedtree shader. I already checked that they have nothing to do with smoothness and thickness.

In PBR the theory has a Hardcoded Fresnel value of ~0.5 which accounts for something like 90% of materials, but there is still a range to that if you wanted something ‘ground truth’, so no matter what the directional light always casts that 0.5 number as well and it does it within the specular pass which includes smoothness values tok

When you’re looking at an inf flat plane which branches usually are, once you hit acute angles the Fresnel is at 100% an infinitely thick plane, so naturally it pretty much maximises the pixel value, and add the other pass still back on top, ( this includes mesh normal angles to buy the way)

The spec pass can only be turned off fully or in a scene by scene basis in HDRP, but by doing so you also rid of roughness pass so it’s not always ideal and will break PBR, which if that a stipulation not to in you project you may have to think about which direction is best.

It has been a thing in unity HDRP since the beginning really, I think URP has a kill slider now, or it was in progress.

Some ways you could approach blending in the results.

Check your branch normal mesh angles, usually spherical re projection is used here, which could potentially - remove or dampen acute angles, this is probably the most used technique here

Contact shadows, if your project allows it, this can sometimes fill this area some

Turning off specular on the directional light or system wide ( my least recommended approach as imo you’ll be purposely breaking PBR for the “wrong reason”). generally I’m interested in seeing people’s responses to this, and if Unity have any plans or best practices for this as it probably is a troublesome problem for technical reasons too.

Thank you for the brief explanation!

These trees in screenshot actually already applied normal puffiness re-projection. I found trees have the best front-side looking with the normal puffiness and the ‘None’ Double-Sided mode. But that makes the worst Fresnel issue. My tree is like a sphere under this Fresnel effect xD.

I found a related thread and the Unity staff mentioned a trick in Ability to disable specular highlights for translucent shaders (HDRP) . Is this trick currently usable or it’s still not released?

1 Like

Definitely looks like manipulated mesh normals, try to set the normals to “Calculate” instead of “Import” in the model settings of your tree meshes.

1 Like

As Boxo mentions 2022 HDRP specular switch is for the specular shader ls only ( this is the "trick)
Seb (Unity} said this trick has been made available only because there’s a reusable “sum” in the existing shader, there is otherwise no room on the Gbuffer to make another pass or change it because of the technical constraints ( possibly the fixed 0.5.

We discuss all this quite regularly with Boxo and unity as well.

Definitely worth checking what seb (lazy) said too and see if unity can recalculate some if your Speedtree settings isn’t giving you the results you need either ( which is also a shame ).

Seb ( lazy) is also a really switched on user and often tinkers deeply into systems

In HDRP you can use the pipeline debugger to preview the full screen normals whilst comparing different mesh normal set ups, you might be able to find best case easier that way too, but unfortunately it does look like it’s a limitation here to stay and may just have to be compensated/ mitigated where possible.

This normal manipulation is intended to make the tree have a puffy looking.

Current normal set up already gives the best looking for most angles of view, it only looks horrible when the tree is between the camera and the sun. Sadly we can’t use contact shadow because we are a city builder game and need grass to blend with terrain at a top-down view. I really hope that Unity can give us a way to do some hackings on this, like disable or decrease the fresnel specular per material or per shader. :frowning:

1 Like

It’s intended to cheaply imitate translucency for shaders that don’t support it (eg. URP Lit), but HDRP Lit properly supports translucency, so mesh normal manipulation is not needed here and will lead to incorrect lighting.

I don’t agree with that. Most AAA games do this manipulation too. It does improve how it looks.

I got some comparisons:

9508066--1339627--Comparison1.jpg

9508066--1339630--Comparison2.jpg

9508066--1339633--Comparison3.jpg

Not sure if your trees are modeled with the manipulated normals in mind or if it’s just a translucency / diffusion settings issue, it’s hard to tell with such small images.

My tree assets look perfectly fine with non-manipulated mesh normals.

Another point to inject here it is to ensure you lighting passes are up to date to whether that’s realtime screen space baked GI/reflections/ambience etc. I’m sure this case has already been considered, just thought I would mention it to cover basis