Jump to content

[HDRP - Tree material] Leaf underside tinted green


sergiogf93
Go to solution Solved by Peter,

Recommended Posts

Hello, I am trying to modify the look of trees in the Alpine Meadow Biome. I am taking one of the tree prefabs and modifying the material on the leaves. What I am doing is make the albedo texture have white leaves so that I can then modify the albedo tint to give different colors.

My issue is that for some reason the underside still shows a green tint. Is there a setting somewhere for this?

Here is an image of the tree from the top: https://imgtr.ee/image/6FDDj

And here is one from the bottom: https://imgtr.ee/image/6F9Ss

Link to comment
Share on other sites

Hi @sergiogf93,

could it be that you are using the "cover" feature of the shader to achieve the white tint?

image.png


If yes, that might explain it: The cover feature is intended to simulate things like snow, sand or moss cover. By default, it only covers things from the top, for example here I'm covering this stone with a snow texture:

image.png

The snow only rests on the flat parts on top that point upwards. Unless I increase the "wrap" parameter that controls that aspect:

image.png


If you are using the cover feature as well, you should get the underside of the leaves to be tinted as well if you increase the wrap setting.

Note that you are then "abusing" the cover feature a little bit in order to tint the leaves. The cleaner way would be to control the tint via the tint color:

image.png
 

However this would not work if you want to turn the tree leaves white, since they have a natural green on the albedo texture. You would need to desaturate and brighten the albedo textures in photoshop / gimp to achieve this then.

 

image.png

Link to comment
Share on other sites

Hi @Peter, thank you very much for your reply. I thought it could be the cover options, but I don't see a difference when disabling it. Also I should have mentioned that I did modify the albedo texture with gimp to make the leaves white so that I can control the tint with the tint color next to the albedo texture. This works, but seemengly only with the upperside of the leaves.

Here is a picture that includes the material settings I use, I now unchecked the cover options:

spacer.png

If I change the tint color to fully red: (255, 0, 0) I get the expected result:spacer.png

But if I use a color with some green values (255,80,80) I get the green underside:

spacer.png

Link to comment
Share on other sites

Hi @sergiogf93, with the new information from your post I think the issue might be in the HDRP diffusion profiles: Those profiles control how light / color behaves when shining through translucent objects like leaves. Can you please search for the "PW Foliage Diffusion Profile" in your project and see if adjusting the color values in this profile influences your problem? If yes, you should be able to tweak the colors there to better match your red leaves.

Link to comment
Share on other sites

Hi @Peter, indeed I think that the issue is comming from the PostProcessing Volumes. If I disable the directional light, the green underside also goes away.

However, I'm not able to find what is the slider that I need to modify in the "PW Foliage Diffusion Profile":

spacer.png

I think I modified all of the foliage diffusion profiles but saw no impact on the tree. Is this the profile you were referring to?

Link to comment
Share on other sites

Hi @sergiogf93
 

Quote

indeed I think that the issue is comming from the PostProcessing Volumes. If I disable the directional light, the green underside also goes away.

Hmm, it might be an odd post processing setting maybe. If you would turn off the directional light, that would also stop all translucency though, so it might still be connected to that.

The diffusion profile you need to edit should be the "PW Foliage Diffusion Profile" as shown in your screenshot. You can double check that you are editing the correct diffusion profile by clicking "Edit" next to the shader name in the material, then check in the Shader graph what diffusion profile is being used by this shader:

image.png

You should see a direct impact when you edit that. You would need to alter the color behind "Scattering Distance", but the white color as shown in your screenshot should be correct.

I tried to reproduce your issue by using your color values for the tint (255,80,80), but I do not seem to see to get your issue, when I desaturate the needle texture and then apply the tint, I'm getting this here:

image.png

I can force the issue by setting up a green tint in the diffusion profile, this is why I was so focused on them:

image.png

 

To rule out that this is an issue with the lighting setup, could you please try to set up e.g. the daytime lighting from the Gaia runtime tab in a new scene to see if the tree shows the same issue then? If not, this might be caused by the overall lighting setup in the scene somehow.

Link to comment
Share on other sites

Thanks for your help. I am still looking into it. If I put the tree in an empty scene, I also get the difference between the tint on each side of the leaves. 

Now I'm thinking that the issue is in the material. If I remove the albedo, normal and mask textures; There is a difference between each side of the leaves:

spacer.png

 

Link to comment
Share on other sites

  • Solution

Hi @sergiogf93 I have another idea what this could be - you mentioned that when you edited the diffusion profiles, there was no change on the vegetation at all?
Could you please check if those diffusion profiles are not part of your HDRP configuration to begin with? The location to check that is unfortunately different from unity version to unity version, in 2023.1 it is under GraphicsSettings -> HDRP Global Settings -> Default Volume Profile:

image.png

But I believe in earlier versions it was directly under HDRP Global Settings, and at some point also under Graphics in the render pipeline asset I think.

The reason I'm asking is: In 2023.1 unity started to render surfaces red when the diffusion profile was missing, here it is how it looks for me in 2023.1 when I clear the diffusion profile list:

image.png

But I know that in earlier unity versions it was some other (random?) color, see this example here:

https://canopy.procedural-worlds.com/forums/topic/1638-partitially-pink-grass/#comment-7640

Can you please check if you have that profile in the HDRP configuration? My bet is it is missing there, and this is why the vegetation did not react to any changes to it & you are getting this green color.

Link to comment
Share on other sites

Hi @Peter, that was it! Indeed the foliage diffusion profile assigned in the material was not registered in the Diffusion Profile List of the HDRP Global Setting. After adding it to the list, the green underside of the leaves went away.

Thank you very much for your help!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...