ok visual, stop me
This commit is contained in:
parent
6d9ada8b4b
commit
9a920baaa7
@ -12,4 +12,6 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 0517c7201b6a73841950436abd2ee35f, type: 3}
|
||||
m_Name: CustomPostProcessingMaterials
|
||||
m_EditorClassIdentifier:
|
||||
crtEffect: {fileID: 2100000, guid: a110daba21b580f4898ccf841727c0c2, type: 2}
|
||||
customEffect: {fileID: 2100000, guid: a110daba21b580f4898ccf841727c0c2, type: 2}
|
||||
customEffect2: {fileID: -8761910824519130491, guid: 68b1b3ac4888d5447a2da3fd32249a63,
|
||||
type: 3}
|
||||
|
||||
@ -17,6 +17,22 @@ MonoBehaviour:
|
||||
intensity:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
--- !u!114 &-4700976073357303510
|
||||
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: 2dce45078901e8743bb35a183fe9b463, type: 3}
|
||||
m_Name: CustomEffectComponent
|
||||
m_EditorClassIdentifier:
|
||||
active: 1
|
||||
intensity:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
--- !u!114 &-4031894175476099154
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
@ -46,7 +62,7 @@ MonoBehaviour:
|
||||
m_Name: crtVolme
|
||||
m_EditorClassIdentifier:
|
||||
components:
|
||||
- {fileID: 6751770758831210905}
|
||||
- {fileID: -4700976073357303510}
|
||||
--- !u!114 &1967504787037751920
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
@ -80,19 +96,3 @@ MonoBehaviour:
|
||||
intensity:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
--- !u!114 &6751770758831210905
|
||||
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: 2dce45078901e8743bb35a183fe9b463, type: 3}
|
||||
m_Name: CustomEffectComponent
|
||||
m_EditorClassIdentifier:
|
||||
active: 1
|
||||
intensity:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
|
||||
@ -11,7 +11,7 @@ using UnityEngine.Rendering.Universal;
|
||||
namespace Shaders
|
||||
{
|
||||
[Serializable,
|
||||
VolumeComponentMenuForRenderPipeline("Custom/CustomEffectComponent", typeof(UniversalRenderPipeline))]
|
||||
VolumeComponentMenuForRenderPipeline("Custom/"+nameof(CustomEffectComponent), typeof(UniversalRenderPipeline))]
|
||||
public class CustomEffectComponent : VolumeComponent, IPostProcessComponent
|
||||
{
|
||||
// For example, an intensity parameter that goes from 0 to 1
|
||||
|
||||
@ -90,17 +90,16 @@ namespace Shaders
|
||||
// Only process if the effect is active
|
||||
if (customEffect.IsActive())
|
||||
{
|
||||
var crtMaterial = materials.crtEffect;
|
||||
var customMaterial = materials.customEffect;
|
||||
// P.s. optimize by caching the property ID somewhere else
|
||||
crtMaterial.SetFloat(Shader.PropertyToID("_Intensity"), customEffect.intensity.value);
|
||||
customMaterial.SetFloat(Shader.PropertyToID("_Intensity"), customEffect.intensity.value);
|
||||
|
||||
BlitTo(crtMaterial);
|
||||
BlitTo(customMaterial);
|
||||
}
|
||||
|
||||
// Add any other custom effect/component you want, in your preferred order
|
||||
// Custom effect 2, 3 , ...
|
||||
|
||||
|
||||
// DONE! Now that we have processed all our custom effects, applies the final result to camera
|
||||
Blit(cmd, latestDest, source);
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ namespace Shaders
|
||||
public class CustomPostProcessingMaterials : UnityEngine.ScriptableObject
|
||||
{
|
||||
//---Your Materials---
|
||||
public Material crtEffect;
|
||||
public Material customEffect;
|
||||
|
||||
//---Accessing the data from the Pass---
|
||||
static CustomPostProcessingMaterials _instance;
|
||||
|
||||
@ -119,11 +119,11 @@ Material:
|
||||
- _WorkflowMode: 1
|
||||
- _ZWrite: 1
|
||||
- u_bend: 4.84
|
||||
- u_blue_offset_y: 0.0042
|
||||
- u_blue_offset_y: 0.0021
|
||||
- u_green_offset_y: 0
|
||||
- u_noise_amount: 0.015
|
||||
- u_noise_size: 417
|
||||
- u_red_offset_y: -0.0042
|
||||
- u_red_offset_y: -0.0021
|
||||
- u_scanlin_transparence1: 0.024
|
||||
- u_scanlin_transparence2: 0.024
|
||||
- u_scanline_amount: 0.047
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user