Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question (NOT FIXED, it is important for my game) Shader graph get color variable from script

Discussion in 'Shader Graph' started by TrueSoSense, Jan 28, 2023.

  1. TrueSoSense

    TrueSoSense

    Joined:
    Sep 10, 2021
    Posts:
    13
    Hello, I am making a voxel engine, and I would like to choose a block's color using a list of structs (I want to use this technique this technique for voxel lighting).
    There are 256 structs in the list.
    Here is a quick sketch I made in paint:
    How can I achieve that using shader graph ? Any help would be appreciated.

    EDIT: All blocks are baked into a single mesh
     

    Attached Files:

    Last edited: Apr 28, 2023
  2. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,115
  3. TrueSoSense

    TrueSoSense

    Joined:
    Sep 10, 2021
    Posts:
    13

    ALL cubes are baked into one mesh, that's the problem...