Search Unity

Normal Texture Sampler generates error: undeclared identifier UnpackNormal

Discussion in 'Visual Effect Graph' started by sergiusz308, Feb 6, 2020.

  1. sergiusz308

    sergiusz308

    Joined:
    Aug 23, 2016
    Posts:
    235
    Hello, I am using custom shader plugged into VFX graph.
    If I only have normal map sampler node in the shader I got this error:

    "Shader error in 'Hidden/VFX/vfx_Warp_Test3/System 1/Output Particle Quad': undeclared identifier 'UnpackNormal' at line 1798 (on d3d11)"

    When I remove normal sampler node, shader works fine.

    VFX graph is very basic, just a minimum setup to spawn some particles with Quad Output node and custom shader.

    What's happening?

    Custom shader normal part:

    upload_2020-2-6_16-36-1.png

    VFX part:

    upload_2020-2-6_16-36-28.png
     
  2. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Hi @sergiusz308 ,

    We can reproduce this as well with unlit graphs. It works for lit graphs, you can switch your VFX shader graph master to be lit, use a lit Output Particle Quad, and connect the normal map to the Normal slot to get :


    Thanks for flagging this, the ShaderGraph integration is still experimental and we hope to make it a bit easier in the future to work with unlit/lit graphs. A fix for sampling normal maps in unlit is on the way.

    Hope this helps!
     

    Attached Files:

    Last edited: Feb 7, 2020
    sergiusz308 likes this.