playMaker

Author Topic: Using Post-process profile  (Read 5103 times)

Mupp

  • Full Member
  • ***
  • Posts: 167
Using Post-process profile
« on: February 13, 2020, 08:12:19 PM »
I'm wondering how I can modify my PP profile. I've checked out the package on Eco but most of my effects are custom made and I wonder how I can access them.

I'm looking for a way to turn them on/off and change their values.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Using Post-process profile
« Reply #1 on: February 14, 2020, 05:56:26 AM »
Hi,

 What do you mean by Custom Made?

Bye,

 Jean

Mupp

  • Full Member
  • ***
  • Posts: 167
Re: Using Post-process profile
« Reply #2 on: February 14, 2020, 08:41:41 AM »
What is unclear? The PP profile can have have more than Unitys default shaders. Many 3rd party assets and also my own are used through it.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Using Post-process profile
« Reply #3 on: February 17, 2020, 01:52:37 AM »
Hi,

 I did not know that Unity post processing profiles could be custom :) all the custom ones I used where using their own boiler plate components to create the effects.

Do you have a link to an asset that use the PP profile so that I can see how it integrates? thanks.

Can you explain how you created your own? It seems that you can only achieve that via c# coding right? if that's the case, then I think you have enough skills to create the custom action to control these scripts, right?

Bye,

 Jean

Mupp

  • Full Member
  • ***
  • Posts: 167
Re: Using Post-process profile
« Reply #4 on: February 17, 2020, 04:56:46 PM »
Sorry, I was a bit confused that I thought I wrote something wrong. I'm using this. http://staggart.xyz/unity/sc-post-effects/scpe-docs/?section=sc-post-effects

For my own shaders I use Amplify Shaders which auto generates a script for me. It can look like this.
Code: [Select]
// Amplify Shader Editor - Visual Shader Editing Tool
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
#if UNITY_POST_PROCESSING_STACK_V2
using System;
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;

[Serializable]
[PostProcess( typeof( ColourAdjustPPSRenderer ), PostProcessEvent.AfterStack, "Colour Adjust", true )]
public sealed class ColourAdjustPP : PostProcessEffectSettings
{
[Tooltip("Brightness")]
[Range(-1f, 1)]
public FloatParameter Brightness = new FloatParameter { value = 0f };
[Tooltip("Contrast")]
[Range(-1f, 1)]
public FloatParameter Contrast = new FloatParameter { value = 0f };
[Tooltip("Saturation")]
[Range(-1f, 1)]
public FloatParameter Saturation = new FloatParameter { value = 0f };
[Space(5)]
[Header("Tint")]
[Tooltip("H")]
[Range(0f, 1)]
public FloatParameter H = new FloatParameter { value = 0.5f };
[Tooltip("S")]
[Range(0f, 1)]
public FloatParameter S = new FloatParameter { value = 1f };
[Tooltip("V")]
[Range(0f, 1)]
public FloatParameter V = new FloatParameter { value = 0f };
}

public sealed class ColourAdjustPPSRenderer : PostProcessEffectRenderer<ColourAdjustPP>
{
public override void Render( PostProcessRenderContext context )
{
var sheet = context.propertySheets.Get( Shader.Find( "Colour Adjust" ) );
sheet.properties.SetFloat( "Brightness", settings.Brightness );
sheet.properties.SetFloat( "Contrast", settings.Contrast );
sheet.properties.SetFloat( "Saturation", settings.Saturation );
sheet.properties.SetFloat( "H", settings.H );
sheet.properties.SetFloat( "S", settings.S );
sheet.properties.SetFloat( "V", settings.V );
context.command.BlitFullscreenTriangle( context.source, context.destination, sheet, 0 );
}
}
#endif

Now, I don't expect a custom action for everything, that would be insane and it wouldn't work for my own stuff.
Using Get/Set properties does not work but maybe a custom action that can get/set the shaders variables in the profile?
Maybe something like the Conditional Expression action, there you have to write the variables and logic yourself would work?
« Last Edit: February 17, 2020, 07:17:21 PM by Mupp »

Mupp

  • Full Member
  • ***
  • Posts: 167
Re: Using Post-process profile
« Reply #5 on: February 23, 2020, 09:40:30 PM »
bump

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Using Post-process profile
« Reply #6 on: February 24, 2020, 03:25:40 AM »
Hi,

 I am in touch with the amplify author, I have allocated time for this this week, I'll see what can be done and if I can do a generic system or not.

Bye,

 Jean

Mupp

  • Full Member
  • ***
  • Posts: 167
Re: Using Post-process profile
« Reply #7 on: February 24, 2020, 09:24:09 AM »
Alright, looking forward to it.

Mupp

  • Full Member
  • ***
  • Posts: 167
Re: Using Post-process profile
« Reply #8 on: March 18, 2020, 08:03:06 PM »
How's this coming along?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Using Post-process profile
« Reply #9 on: March 19, 2020, 03:16:00 AM »
Hi,

 It's getting there :) I have the listing of effects ( including from packages, which was a pain to get...), list of actions already existing, the next big thing is to create the code to analyse the effect and generate the according setter and getter action, but I have some base to do that, so it's a matter of putting it together.




Bye,

 Jean

Mupp

  • Full Member
  • ***
  • Posts: 167
Re: Using Post-process profile
« Reply #10 on: March 19, 2020, 09:13:23 AM »
Yo, that looks sweet.  ;D

Mupp

  • Full Member
  • ***
  • Posts: 167
Re: Using Post-process profile
« Reply #11 on: April 21, 2020, 08:42:14 PM »
Not to nag but how's this coming along?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Using Post-process profile
« Reply #12 on: April 22, 2020, 02:13:54 AM »
Hi,

 not much progress unfortunatly, things got ectic, I hope I can allocate more time on this early next month.

Bye,

 Jean

thezigner2

  • Playmaker Newbie
  • *
  • Posts: 1
Re: Using Post-process profile
« Reply #13 on: April 23, 2020, 11:58:24 PM »
Hi,
is this going to allow to use URP or HDRP post-processing with Play Maker?
Or is it already possible?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Using Post-process profile
« Reply #14 on: April 28, 2020, 02:22:24 AM »
Hi,

 I am not sure, I haven't used HDRP, but I think URP is the default that we have currently right?

Bye,

 Jean