Search Unity

ShaderLab syntax clarification

Discussion in 'Formats & External Tools' started by HakanaiVR, Oct 2, 2021.

  1. HakanaiVR

    HakanaiVR

    Joined:
    Jan 1, 2018
    Posts:
    6
    ShaderLab files often refer to floating point numbers, e.g. in material properties you can have:

    Code (csharp):
    1. _ExampleName ("Float display name", Float) = 0.5
    2.  
    For the floating point numbers here and elsewhere in ShaderLab files, what exactly is supported?

    It seems that at least the following are valid:
    • 0.

    • 0
    • 0.5
    • .5

    Are there any other cases which work? e.g. what about things like
    5E-1
    ?

    Further to this, is there a grammar for this format I can refer to?