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.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

How to use Material correctly in PPv2?

Discussion in 'General Graphics' started by Gumou, Aug 2, 2021.

  1. Gumou


    Nov 4, 2018
    I want use Material because I want only expose few settings in PostProcessEffectSettings and tweak most properties in Material.
    So I tried this :
    Code (CSharp):
    2. [Serializable]
    3. [PostProcess(typeof(PostMaterialRender),PostProcessEvent.AfterStack,"Custom/PostMaterial")]
    4. public sealed class PostMaterial : PostProcessEffectSettings {
    5.     public MaterialParameter mat = new MaterialParameter() {value = null};
    6. }
    7. public sealed class PostMaterialRender : PostProcessEffectRenderer<PostMaterial> {
    8.     public override void Render(PostProcessRenderContext context) {
    9.         Material mat = settings.mat;
    10.         context.command.Blit(context.source,context.destination,mat,0);
    11.     }
    12. }
    13. [Serializable]
    14. public sealed class MaterialParameter : ParameterOverride<Material>{}
    Then I got this result.Only 1/4 of the screen rendered.So how to use Material correctly?