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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Error in shader compilation when building: HDRP/Lit: SampleDirectionalLightmap can't convert type

Discussion in 'High Definition Render Pipeline' started by TieSKey, Jun 20, 2022.

  1. TieSKey

    TieSKey

    Joined:
    Apr 14, 2011
    Posts:
    219
    Whenever I try to build my game (unity 2021.3.4f1 standalone-windows-mono-vulkan) I get the following errors on several (but not all) shaders:

    Shader error in 'HDRP/Lit': 'SampleDirectionalLightmap': cannot implicitly convert from 'Texture2D<float4>' to 'Texture2DArray<float4>' at <MyGameFolder>/Library/PackageCache/com.unity.render-pipelines.high-definition@12.1.7/Runtime/Material/BuiltinGIUtilities.hlsl(88) (on d3d11)

    (Why does it even say d3d11 when the only graphics api is vulkan ¯\_(ツ)_/¯

    So I've tried reimporting packages, deleting entire Library folder, opening and re-saving my own shader graphs (not that would affect the default HDRP/Lit one...)

    The game works just fine in the editor.

    Any ideas/suggestions/hits?

    Thx in advance.
     
    bisewski likes this.
  2. akhileshrao

    akhileshrao

    Joined:
    Oct 11, 2020
    Posts:
    6
    same issue
     
  3. bisewski

    bisewski

    Joined:
    Jan 16, 2014
    Posts:
    157
  4. bisewski

    bisewski

    Joined:
    Jan 16, 2014
    Posts:
    157


    Hi! Did you solve this error? I am sttuck here.