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

Resolved Converting one line of shader code to shader graph, is this correct?

Discussion in 'Shader Graph' started by Vyzier, May 8, 2019.

  1. Vyzier

    Vyzier

    Joined:
    Feb 22, 2015
    Posts:
    21
    Hello! Is my conversion here correct?

    someFloat4.xyz = lerp(0.25, 1, someFloat4.xyz);


    And the shader graph:
    upload_2019-5-8_12-4-30.png

    Thanks!
     
  2. alexandral_unity

    alexandral_unity

    Unity Technologies

    Joined:
    Jun 18, 2018
    Posts:
    163
    Yup, you're correct. c:
     
    Vyzier likes this.
  3. Vyzier

    Vyzier

    Joined:
    Feb 22, 2015
    Posts:
    21
    Thanks! Sorry, new to shaders in general, and even newer to shader graphs here. :D
     
  4. studentutu

    studentutu

    Joined:
    Oct 22, 2017
    Posts:
    105
    But does it write into the input field when converrting from float 0.25 to float3 (0.25, 0.25, 0.25) or (0.25,0,0)?
     
  5. A132LW

    A132LW

    Joined:
    Jun 21, 2017
    Posts:
    37
    float 0.25 to float3 (0.25, 0.25, 0.25) by default.