Search Unity

Question Using a Texture2D asset node as input in sampler Texture2d LOD node

Discussion in 'Shader Graph' started by nasos_333, Dec 27, 2020.

  1. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,364
    Hi,

    I want to use a texture in both vertex and fragment shaders, i use a sampler Texture2d LOD node in vertex (as a Sampler Texture 2D wont work), but cant reuse the Texture2D asset node.

    The reason i want to sample a Texture2Dasset is because i need the texelsize, which wont work with Texture2D input for some reason.

    Is there a way to do so ?

    Also how do i change the texture of a Texture2D asset with code, there is no name related to the node input.

    And also why there is a separate Texture2D asset, besides the normal Texture2D input ? And why cant get the texel size with the Texture2D as input ?

    Also is the shader Graph generally production ready, or is better to skip it at this point ? Seems to have some strange limitations.

    Thanks
     
    Last edited: Dec 27, 2020