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. Dismiss Notice

Shader code throwing up errors

Discussion in 'General Discussion' started by Rey3356, May 19, 2023.

  1. Rey3356

    Rey3356

    Joined:
    Sep 1, 2020
    Posts:
    2
    Hi. Newbie here! I've been trying to follow this <> pixelization shader tutorial on here from youtube, but whenever i create a shader, mainly the image effect shader, and open it in VS, it starts throwing many errors. Almost as the there is a compiler issue and it tries to read it as basic c# code. Please help me understand the problem.

    for context, ive recently reset my pc and resetup unity and vs. This has never happened before when ive worked with shaders. let me know if there are things setting up wise that i can look into please. again sorry if this is a stupid question. upload_2023-5-19_17-46-49.png
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,899
    Maybe this helps: https://docs.unity3d.com/Manual/SL-DebuggingD3D11ShadersWithVS.html

    Last thing I know is that VS required plugins to understand Unity shaders. But the ones I know haven't been updated in ~6 years.
    ShaderLabs: https://github.com/wudixiaop/ShaderlabVS
    this plugin: https://marketplace.visualstudio.com/items?itemName=MarcinODev.ShaderUnitySupport

    They're probably not aware of today's scriptable render pipeline stuff though, so probably not worthwhile checking out.


    In any case, you can just ignore these errors as long as it compiles in Unity. You may be able to disable syntax highlighting and error checking for .shader files.
     
    Rey3356 likes this.
  3. Rey3356

    Rey3356

    Joined:
    Sep 1, 2020
    Posts:
    2
    Thanks a lot! I'll defo give this a try.