Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Texture Layer Reflection Doesn't Work

Discussion in 'Shaders' started by LostInDeepSpace, Mar 7, 2021.

  1. LostInDeepSpace

    LostInDeepSpace

    Joined:
    Dec 8, 2020
    Posts:
    4
    Hello everyone,

    I bought some materials and I want to use them as a terrain texture. It works except it doesn't show reflections.

    Reflection works just fine when I apply the material to any cube. When I created the terrain texture from the material's PNGs, reflections are gone.

    See this video where I explained the problem in detail:
    https://www.loom.com/share/7f57b21e04fb4440a4e8de42f650e011

    Screenshot 2021-03-07 at 19.05.24.png
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,265
    The built in renderer's Standard terrain shader requires the Diffuse texture have the smoothness map (inverted roughness) stored in the diffuse texture's alpha. You'll need to copy that data into the texture yourself in an external application.
     
    LostInDeepSpace likes this.
  3. LostInDeepSpace

    LostInDeepSpace

    Joined:
    Dec 8, 2020
    Posts:
    4
    Thank you! Good thing is that now I know that it can be done. Do you know about some tutorial on how to do it?
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,265
    Open Photoshop
    Open Roughness / Smoothness texture
    Invert the color if it's a roughness texture
    Select All and copy
    Open Diffuse texture
    Go to Channels window, select or add an Alpha channel
    Paste while the Alpha channel is selected while other channels are disabled
    Save as .tga or .psd

    Photoshop's built in .png file support will totally break the file, so don't use that. And no other formats support alpha channels.

    If you don't have Photoshop ... I have no idea because neither Gimp nor Krita handle alpha channels as separate data channels properly.
     
    LostInDeepSpace likes this.
  5. LostInDeepSpace

    LostInDeepSpace

    Joined:
    Dec 8, 2020
    Posts:
    4
    Thank you so much, I solved my problem and it looks fantastic! For people with a similar issue here are some tips:

    I was exporting the file in PNG which is the reason why I failed. I found TIFF and BMP working as well.
    The roughness texture if not inverter might cause a plastic/liquid material look.
     

    Attached Files: