Glossy - Shiny terrain after updating V2020.3.26 to 2021.2.15

After update most things are too bright - I could change this by going thru the materials.

But the glossy terrain is ugly and that was not there before:

Now (colors are also different):

I have tried the metallic / specular parameters in the terrain layers, I tried changing light intensity. Gloss does not go away. Even when I remove layers from the terrain, the raw model would shine.
Why?
I am trying to dig thru the URP terrain/lit shader and changed some values to find where that is happening, but I cannot find it. It is definitely coming from the one and only main directional light.

Any ideas?

1 Like

even when there is no texture assigned to a layer:

I found the cause but still no fix. I compared to the working 2020.3 project. When I change the Smoothness of a layer from 0 to 1 it shows exactly the same effect.
So, obviously the smoothness in 2021.2.15 is always 1 for all terrain layers. When I move the slider it does not change! So there must be an error in the shader?!

next try: I replaced the new terrainLit shader in 2021.2 with the old one. It still does not work. Smoothness slider has NO effect.

there was an issue in 2019:

seems to be the same effect.
My textures do NOT have an alpha channel.

1 Like

It seems I found a workaround!
Each texture has an output format which is set to automatic. When I change it to 24bit, the smoothness slider is working. One would say, yes but you have alpha source set. This is true but even setting it to none would not work.
So for me it seems, they broke something with the automatic format.

Yet, I did not check iOS and Android behaviour - I see some other “automatic” formats there which I do not know, if they would work.

19 Likes

you saved my day, thank you!

Yeah but that trick is horrible on mobile. All terrain textures uncompressed… bye bye RAM on android.

I played around with the shader and the bug seems to be on the smoothness. It’s completely ignored on Android. I edited the shader manually and set it to 0 and the reflection is gone.

1 Like

which shader did you edited?

The terrain lit shader. It gets the smoothness values and metallic values from who knows where. I’ve just edit the shader and set it to 0 and it works as expected in Android.

When I edit and save it, it returns back to the default values,
I am setting smoothness values as 0.

1 Like

Those are not what you have to change. You actually need to go into the include hsls files and change the code by hand and set it to zero. That’s why I said I have no idea where it get those values from because the input (what you are changing) has no impact. You have to literally hard code those values into the shader files.

Edit: I actually found out where it’s getting those values from. From the alpha channel. That’s why setting the texture to anything that doesn’t have alpha, fixes it. But this is a major terrain shader bug.

1 Like

When I change also .hlsl fileses and save,it compiles and after complied it returns back to original hlsl file.
TerrainLitPasses.hlsl
TerrainLitInput.hlsl
TerrainMetaPass.hlsl

i have changed, after save it returns back to original.

1 Like

Did you copy those files into your project? You have to manually place them into your project so they don’t get overriden.

I’ve posted a fix that doesn’t involve editing shaders or changing texture format in this other post : Unity terrain looks like a shiny rock in URP mobile

Hi,
I posted here the fix. You can edit AO value of all brushes. Also you can edit metallic value.

That is what it looks like when AO set to 0 and when Texture format set to ignore alpha channel.
9667478--1376945--upload_2024-2-27_17-4-54.png9667478--1376948--upload_2024-2-27_17-5-16.png

Sir, You save me


happen in 2022.3.19f1 LTS too !!
for workaround i try enable debug mode in inspector and override smoothness to 2 or 3 .
in case i cant afford rgb24 format due to memory

Look at texture import settings in the Inspector window.
Set Alpha Source to From Grayscale

Should do the trick