Search Unity

Accessing _UseClipRect in the Shader

Discussion in 'UGUI & TextMesh Pro' started by Stephan-B, Oct 4, 2015.

  1. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Since the new 2D Rect Mask is using MaterialPropertyBlocks internally, is there a way to determine whether or not _UseClipRect is set to 0 or 1?
     
  2. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Could you elaborate what you mean? This value is set to either 0 or 1 depending on if the rect should be used.
     
  3. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    When I try to get that value from the shader, it is always 0 even though it is clearly set to 1 (somewhere) and executed correctly by the shader. Unless I am missing something, I am thinking it might be due to that property being set by the materialpropertyblock.

    In the end, I am just trying to get the value of _UseClipRect to know if it is set to 0 or 1.