Search Unity

Sampler state of GrabTexture

Discussion in 'Shaders' started by RyuHayaboosa, May 1, 2020.

  1. RyuHayaboosa

    RyuHayaboosa

    Joined:
    Mar 8, 2015
    Posts:
    14
    Hi, when using a GrabPass, is there a way to set the sampler state of the texture? For example, to enable bilinear filtering? Thanks!
     
  2. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,549
    Instead of using
    tex2D()
    to sample it, you can define your own
    SamplerState
    and use it in the
    .Sample()
    function that the grab texture or any defined
    Texture
    for that matter will have.

    There are some examples here:
    https://docs.unity3d.com/Manual/SL-SamplerStates.html
     
    RyuHayaboosa likes this.