cailean
10 months ago
17 changed files with 1663 additions and 19 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,8 @@ |
|||
fileFormatVersion: 2 |
|||
guid: ed0941eff36bab04eaee01ca80e8932b |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
@ -0,0 +1,43 @@ |
|||
using UnityEngine; |
|||
using UnityEngine.Rendering; |
|||
using UnityEngine.Rendering.HighDefinition; |
|||
using System; |
|||
|
|||
[Serializable, VolumeComponentMenu("Post-processing/Custom/Ramp")] |
|||
public sealed class Ramp : CustomPostProcessVolumeComponent, IPostProcessComponent |
|||
{ |
|||
[Tooltip("Controls the intensity of the effect.")] |
|||
public ClampedFloatParameter intensity = new ClampedFloatParameter(0f, 0f, 1f); |
|||
|
|||
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/Ramp"; |
|||
|
|||
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 Ramp 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.SetTexture("_MainTex", source); |
|||
HDUtils.DrawFullScreen(cmd, m_Material, destination, shaderPassId: 0); |
|||
} |
|||
|
|||
public override void Cleanup() |
|||
{ |
|||
CoreUtils.Destroy(m_Material); |
|||
} |
|||
} |
@ -0,0 +1,2 @@ |
|||
fileFormatVersion: 2 |
|||
guid: e3f28ae5e03094946a7a9c9ddfc1a178 |
File diff suppressed because it is too large
@ -0,0 +1,10 @@ |
|||
fileFormatVersion: 2 |
|||
guid: 5c60e083243bdbe479046bb8653eeacc |
|||
ScriptedImporter: |
|||
internalIDToNameTable: [] |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} |
Loading…
Reference in new issue