Browse Source

scale pp shader added

main
cailean 10 months ago
parent
commit
0ad0d07645
  1. 44
      Assets/14_CustomPP/Scale.cs
  2. 2
      Assets/14_CustomPP/Scale.cs.meta
  3. 1114
      Assets/14_CustomPP/Scale.shadergraph
  4. 10
      Assets/14_CustomPP/Scale.shadergraph.meta
  5. 8
      Assets/6_Scenes/Beep.unity
  6. 32
      Assets/Settings/HDRPDefaultResources/C Surveillance.asset
  7. 1
      Assets/Settings/HDRPDefaultResources/HDRenderPipelineGlobalSettings.asset
  8. 20
      Assets/Settings/SkyandFogSettingsProfile.asset

44
Assets/14_CustomPP/Scale.cs

@ -0,0 +1,44 @@
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;
using System;
[Serializable, VolumeComponentMenu("Post-processing/Custom/Scale")]
public sealed class Scale : CustomPostProcessVolumeComponent, IPostProcessComponent
{
[Tooltip("Controls the intensity of the effect.")]
public ClampedFloatParameter intensity = new ClampedFloatParameter(0f, 0f, 1f);
public ClampedFloatParameter scale = new ClampedFloatParameter(0f, 0f, 1);
Material m_Material;
public bool IsActive() => m_Material != null && intensity.value > 0f;
// Do not forget to add this post process in the Custom Post Process Orders list (Project Settings > Graphics > HDRP Global Settings).
public override CustomPostProcessInjectionPoint injectionPoint => CustomPostProcessInjectionPoint.AfterPostProcess;
const string kShaderName = "Shader Graphs/Scale";
public override void Setup()
{
if (Shader.Find(kShaderName) != null)
m_Material = new Material(Shader.Find(kShaderName));
else
Debug.LogError($"Unable to find shader '{kShaderName}'. Post Process Volume Scale is unable to load.");
}
public override void Render(CommandBuffer cmd, HDCamera camera, RTHandle source, RTHandle destination)
{
if (m_Material == null)
return;
m_Material.SetFloat("_Intensity", intensity.value);
m_Material.SetFloat("_Scale", scale.value);
m_Material.SetTexture("_MainTex", source);
HDUtils.DrawFullScreen(cmd, m_Material, destination, shaderPassId: 0);
}
public override void Cleanup()
{
CoreUtils.Destroy(m_Material);
}
}

2
Assets/14_CustomPP/Scale.cs.meta

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: d39585a76d5fe4440a829bdff2e7d6f5

1114
Assets/14_CustomPP/Scale.shadergraph

File diff suppressed because it is too large

10
Assets/14_CustomPP/Scale.shadergraph.meta

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 78fab9e2adf9a6d4cb00cbebbd101f32
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}

8
Assets/6_Scenes/Beep.unity

@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1 m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0} m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0} m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 18715.012, g: 22259.738, b: 24972.97, a: 1} m_IndirectSpecularColor: {r: 18717.44, g: 22261.611, b: 24975.488, a: 1}
m_UseRadianceAmbientProbe: 0 m_UseRadianceAmbientProbe: 0
--- !u!157 &3 --- !u!157 &3
LightmapSettings: LightmapSettings:
@ -913,7 +913,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 377437129} m_GameObject: {fileID: 377437129}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: -0.03783876, y: 0.8817096, z: -0.07178476, w: -0.46476156} m_LocalRotation: {x: -0.03783878, y: 0.8817097, z: -0.071784794, w: -0.46476156}
m_LocalPosition: {x: -128.4, y: 13, z: -248.6} m_LocalPosition: {x: -128.4, y: 13, z: -248.6}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
@ -1510,7 +1510,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 513050371} m_GameObject: {fileID: 513050371}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0.09170884, y: 0.7875376, z: -0.12092027, w: 0.59728754} m_LocalRotation: {x: 0.09170884, y: 0.7875376, z: -0.12092028, w: 0.5972875}
m_LocalPosition: {x: -3.8285522, y: -3.5073547, z: -14.092346} m_LocalPosition: {x: -3.8285522, y: -3.5073547, z: -14.092346}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
@ -2875,7 +2875,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1178814724} m_GameObject: {fileID: 1178814724}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0.11851884, y: 0.6224197, z: -0.0960943, w: 0.76766723} m_LocalRotation: {x: 0.11851883, y: 0.6224197, z: -0.0960943, w: 0.76766723}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0

32
Assets/Settings/HDRPDefaultResources/C Surveillance.asset

@ -119,6 +119,25 @@ MonoBehaviour:
gain: gain:
m_OverrideState: 1 m_OverrideState: 1
m_Value: {x: 1, y: 1, z: 1, w: 0} m_Value: {x: 1, y: 1, z: 1, w: 0}
--- !u!114 &-6734514037984257599
MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d39585a76d5fe4440a829bdff2e7d6f5, type: 3}
m_Name: Scale
m_EditorClassIdentifier:
active: 1
intensity:
m_OverrideState: 1
m_Value: 1
scale:
m_OverrideState: 1
m_Value: 0.848
--- !u!114 &-5803946911733098170 --- !u!114 &-5803946911733098170
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 3 m_ObjectHideFlags: 3
@ -460,6 +479,7 @@ MonoBehaviour:
- {fileID: -2868304836233947053} - {fileID: -2868304836233947053}
- {fileID: -1404954356258110032} - {fileID: -1404954356258110032}
- {fileID: 9099200747249414281} - {fileID: 9099200747249414281}
- {fileID: -6734514037984257599}
--- !u!114 &1648429249874712153 --- !u!114 &1648429249874712153
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 3 m_ObjectHideFlags: 3
@ -1183,6 +1203,18 @@ MonoBehaviour:
maximumIntensity: maximumIntensity:
m_OverrideState: 1 m_OverrideState: 1
m_Value: 10 m_Value: 10
denoising:
m_OverrideState: 0
m_Value: 0
useAOVs:
m_OverrideState: 0
m_Value: 1
temporal:
m_OverrideState: 0
m_Value: 0
asyncDenoising:
m_OverrideState: 0
m_Value: 1
skyImportanceSampling: skyImportanceSampling:
m_OverrideState: 1 m_OverrideState: 1
m_Value: 0 m_Value: 0

1
Assets/Settings/HDRPDefaultResources/HDRenderPipelineGlobalSettings.asset

@ -126,6 +126,7 @@ MonoBehaviour:
afterPostProcessBlursCustomPostProcesses: [] afterPostProcessBlursCustomPostProcesses: []
afterPostProcessCustomPostProcesses: afterPostProcessCustomPostProcesses:
- Ramp, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - Ramp, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- Scale, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
beforeTAACustomPostProcesses: [] beforeTAACustomPostProcesses: []
defaultRenderingLayerMask: 257 defaultRenderingLayerMask: 257
renderingLayerNames: renderingLayerNames:

20
Assets/Settings/SkyandFogSettingsProfile.asset

@ -1638,6 +1638,7 @@ MonoBehaviour:
- {fileID: -4627288363748534694} - {fileID: -4627288363748534694}
- {fileID: -7599423270992533750} - {fileID: -7599423270992533750}
- {fileID: -2552918245885184257} - {fileID: -2552918245885184257}
- {fileID: 4440327153818238715}
--- !u!114 &831513112825940344 --- !u!114 &831513112825940344
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 3 m_ObjectHideFlags: 3
@ -1901,6 +1902,25 @@ MonoBehaviour:
saturation: saturation:
m_OverrideState: 1 m_OverrideState: 1
m_Value: 0 m_Value: 0
--- !u!114 &4440327153818238715
MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d39585a76d5fe4440a829bdff2e7d6f5, type: 3}
m_Name: Scale
m_EditorClassIdentifier:
active: 1
intensity:
m_OverrideState: 1
m_Value: 0
scale:
m_OverrideState: 1
m_Value: 0
--- !u!114 &5135003436626079803 --- !u!114 &5135003436626079803
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 3 m_ObjectHideFlags: 3

Loading…
Cancel
Save