Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

How to set a texture offset from custom post process

Discussion in 'General Graphics' started by nantoaqui, Jul 9, 2020.

  1. nantoaqui

    nantoaqui

    Joined:
    Oct 1, 2014
    Posts:
    42
    Hello!

    How do you set a texture offset from a PostProcessEffectRenderer ?

    Code (CSharp):
    1.  
    2. public override void Render(PostProcessRenderContext context)
    3. {
    4. _paletteShader = Shader.Find ("Hidden/Custom/PaletteSwap");
    5. var sheet = context.propertySheets.Get (_paletteShader);
    6. // No clue of how to add the texture offset :|
    7. sheet.properties.SetTexture ("_PaletteTex", settings.LookupTexture);
    8. context.command.BlitFullscreenTriangle(context.source, context.destination, sheet, 0);
    9. }
    10.  
    Before I was using a material to set the texture offset:

    Code (CSharp):
    1.  material.SetTextureOffset ("_PaletteTex", TextureOffset);