Merge branch 'Retro-Visual' of https://bitbucket.clubconjure.com/scm/cegj/32bit_jam_conjure into Level1-wShader

This commit is contained in:
Jean Lamarre 2022-10-29 03:55:59 -04:00
commit da6500e9bc
21 changed files with 913 additions and 46 deletions

148
Assets/Material/CRTBlit.mat Normal file
View File

@ -0,0 +1,148 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-937696407428621231
MonoBehaviour:
m_ObjectHideFlags: 11
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: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 5
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: CRTBlit
m_Shader: {fileID: 4800000, guid: 7d830e9754227db4b89bacfdc753e135, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _Blend: 0
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Surface: 0
- _WorkflowMode: 1
- _ZWrite: 1
- u_bend: 3.15
- u_blue_offset_y: 0.00403
- u_green_offset_y: 0
- u_noise_amount: 0.012
- u_noise_size: 337
- u_red_offset_y: -0.00409
- u_scanlin_transparence1: 0.194
- u_scanlin_transparence2: 0.098
- u_scanline_amount: 0.019
- u_scanline_size_1: 308
- u_scanline_size_2: 521
- u_scanline_speed_1: 94.13
- u_scanline_speed_2: 30
- u_time: 15.95
- u_vignette_edge_round: 8.5
- u_vignette_size: 1.89
- u_vignette_smoothness: 0.56
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
- u_blue_offset: {r: 0, g: 0.002, b: 0, a: 0}
- u_blue_offset_y: {r: 0.25, g: 0.5, b: 0.5, a: 0}
- u_green_offset: {r: 0, g: 0, b: 0, a: 0}
- u_green_offset_y: {r: 0.25, g: 0.5, b: 0.5, a: 0}
- u_red_offset: {r: 0, g: -0.002, b: 0, a: 0}
- u_red_offset_y: {r: 0.25, g: 0.5, b: 0.5, a: 0}
m_BuildTextureStacks: []

View File

@ -1,8 +1,8 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 8105016687592461f977c054a80ce2f2 guid: a110daba21b580f4898ccf841727c0c2
NativeFormatImporter: NativeFormatImporter:
externalObjects: {} externalObjects: {}
mainObjectFileID: 0 mainObjectFileID: 2100000
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:

View File

@ -0,0 +1,166 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-4790970344126815099
MonoBehaviour:
m_ObjectHideFlags: 11
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: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 5
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: PixelBlit
m_Shader: {fileID: 4800000, guid: c4d7011496fb8f34ead8b47276ae3f0a, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BASE_COLOR_MAP:
m_Texture: {fileID: 2800000, guid: 116e65d2b34493c439f545f71aa487b5, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EMISSION_COLOR_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _METALNESS_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 8.38, y: 5.31}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NORMAL_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SPECULAR_COLOR_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SPECULAR_IOR_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SPECULAR_ROUGHNESS_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _Blend: 0
- _BlendOp: 0
- _BumpScale: 1
- _CellSizeX: 2
- _CellSizeY: 2
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _METALNESS: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueControl: 0
- _QueueOffset: 0
- _ReceiveShadows: 1
- _SPECULAR_IOR: 1.5
- _SPECULAR_ROUGHNESS: 0
- _SampleGI: 0
- _ScreenHeight: 480
- _ScreenWidth: 640
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Surface: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BASE_COLOR: {r: 1, g: 1, b: 1, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EMISSION_COLOR: {r: 0, g: 0, b: 0, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SPECULAR_COLOR: {r: 1, g: 1, b: 1, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bc45e5f0151133446b26221ec8ea680c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -237,9 +237,9 @@ MonoBehaviour:
m_Transition: 1 m_Transition: 1
m_Colors: m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1} m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} m_HighlightedColor: {r: 0.5377358, g: 0.5377358, b: 0.5377358, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} m_PressedColor: {r: 0.5754717, g: 0.3441972, b: 0.3441972, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} m_SelectedColor: {r: 0.5283019, g: 0.5283019, b: 0.5283019, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1 m_ColorMultiplier: 1
m_FadeDuration: 0.1 m_FadeDuration: 0.1

View File

@ -1,34 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
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: fcf7219bab7fe46a1ad266029b2fee19, type: 3}
m_Name: Readme
m_EditorClassIdentifier:
icon: {fileID: 2800000, guid: 727a75301c3d24613a3ebcec4a24c2c8, type: 3}
title: URP Empty Template
sections:
- heading: Welcome to the Universal Render Pipeline
text: This template includes the settings and assets you need to start creating with the Universal Render Pipeline.
linkText:
url:
- heading: URP Documentation
text:
linkText: Read more about URP
url: https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@latest
- heading: Forums
text:
linkText: Get answers and support
url: https://forum.unity.com/forums/universal-render-pipeline.383/
- heading: Report bugs
text:
linkText: Submit a report
url: https://unity3d.com/unity/qa/bug-reporting
loadedLayout: 1

View File

@ -380,7 +380,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0} m_FirstSelected: {fileID: 1335784365}
m_sendNavigationEvents: 1 m_sendNavigationEvents: 1
m_DragThreshold: 10 m_DragThreshold: 10
--- !u!4 &185700930 --- !u!4 &185700930
@ -698,7 +698,7 @@ MonoBehaviour:
m_BlockingObjects: 0 m_BlockingObjects: 0
m_BlockingMask: m_BlockingMask:
serializedVersion: 2 serializedVersion: 2
m_Bits: 4294967295 m_Bits: 255
--- !u!114 &753457326 --- !u!114 &753457326
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -918,7 +918,7 @@ PrefabInstance:
- target: {fileID: 5917528464183523172, guid: 0bdc45a9254ade843b7ba60aaab62301, - target: {fileID: 5917528464183523172, guid: 0bdc45a9254ade843b7ba60aaab62301,
type: 3} type: 3}
propertyPath: m_fontSize propertyPath: m_fontSize
value: 11.85 value: 10.05
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5917528464644539588, guid: 0bdc45a9254ade843b7ba60aaab62301, - target: {fileID: 5917528464644539588, guid: 0bdc45a9254ade843b7ba60aaab62301,
type: 3} type: 3}
@ -1073,7 +1073,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1} m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -77.453, y: -53.482} m_AnchoredPosition: {x: -77.453, y: -53.481995}
m_SizeDelta: {x: 154.907, y: 106.963} m_SizeDelta: {x: 154.907, y: 106.963}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1281004662 --- !u!114 &1281004662
@ -1173,6 +1173,12 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1281004660} m_GameObject: {fileID: 1281004660}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!1 &1335784365 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 5917528464644539588, guid: 0bdc45a9254ade843b7ba60aaab62301,
type: 3}
m_PrefabInstance: {fileID: 5917528464004223745}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1451380979 --- !u!1 &1451380979
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1293,7 +1299,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 82.547, y: -53.407} m_AnchoredPosition: {x: 82.547, y: -53.407013}
m_SizeDelta: {x: -165.09, y: -106.81} m_SizeDelta: {x: -165.09, y: -106.81}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1703051055 --- !u!114 &1703051055

View File

@ -40,7 +40,8 @@ MonoBehaviour:
type: 3} type: 3}
m_RendererFeatures: m_RendererFeatures:
- {fileID: -1878332245247344467} - {fileID: -1878332245247344467}
m_RendererFeatureMap: adc0de57c6d2eee5 - {fileID: 6059349672888060108}
m_RendererFeatureMap: adc0de57c6d2eee5cc485f766c221754
m_UseNativeRenderPass: 0 m_UseNativeRenderPass: 0
postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2}
xrSystemData: {fileID: 11400000, guid: 60e1133243b97e347b653163a8c01b64, type: 2} xrSystemData: {fileID: 11400000, guid: 60e1133243b97e347b653163a8c01b64, type: 2}
@ -80,3 +81,23 @@ MonoBehaviour:
m_ClusteredRendering: 0 m_ClusteredRendering: 0
m_TileSize: 32 m_TileSize: 32
m_IntermediateTextureMode: 1 m_IntermediateTextureMode: 1
--- !u!114 &6059349672888060108
MonoBehaviour:
m_ObjectHideFlags: 0
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: d2d5de177d814a8d8c64638ad49b1b1d, type: 3}
m_Name: CRTPass
m_EditorClassIdentifier:
m_Active: 1
settings:
Event: 550
blitMaterial: {fileID: 2100000, guid: a110daba21b580f4898ccf841727c0c2, type: 2}
blitMaterialPassIndex: 0
destination: 0
textureId: _BlitPassTexture
alwaysRender: 1

View File

@ -27,6 +27,9 @@ MonoBehaviour:
m_SupportsHDR: 1 m_SupportsHDR: 1
m_MSAA: 4 m_MSAA: 4
m_RenderScale: 1 m_RenderScale: 1
m_UpscalingFilter: 0
m_FsrOverrideSharpness: 0
m_FsrSharpness: 0.92
m_MainLightRenderingMode: 1 m_MainLightRenderingMode: 1
m_MainLightShadowsSupported: 1 m_MainLightShadowsSupported: 1
m_MainLightShadowmapResolution: 4096 m_MainLightShadowmapResolution: 4096
@ -48,6 +51,8 @@ MonoBehaviour:
m_ShadowDepthBias: 1 m_ShadowDepthBias: 1
m_ShadowNormalBias: 1 m_ShadowNormalBias: 1
m_SoftShadowsSupported: 1 m_SoftShadowsSupported: 1
m_ConservativeEnclosingSphere: 0
m_NumIterationsEnclosingSphere: 64
m_AdditionalLightsCookieResolution: 4096 m_AdditionalLightsCookieResolution: 4096
m_AdditionalLightsCookieFormat: 4 m_AdditionalLightsCookieFormat: 4
m_UseSRPBatcher: 1 m_UseSRPBatcher: 1

8
Assets/Shaders.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0af3415c87b444145affb5364f460618
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

127
Assets/Shaders/Blit.cs Normal file
View File

@ -0,0 +1,127 @@
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
/*
* https://cyangamedev.wordpress.com/2020/06/22/urp-post-processing/
*/
namespace Shaders
{
public class Blit : ScriptableRendererFeature
{
private class BlitPass : ScriptableRenderPass
{
public enum RenderTarget
{
Color,
RenderTexture,
}
public Material blitMaterial = null;
public int blitShaderPassIndex = 0;
public FilterMode filterMode { get; set; }
private RenderTargetIdentifier source { get; set; }
private RenderTargetHandle destination { get; set; }
RenderTargetHandle m_TemporaryColorTexture;
string m_ProfilerTag;
public BlitPass(RenderPassEvent renderPassEvent, Material blitMaterial, int blitShaderPassIndex, string tag)
{
this.renderPassEvent = renderPassEvent;
this.blitMaterial = blitMaterial;
this.blitShaderPassIndex = blitShaderPassIndex;
m_ProfilerTag = tag;
m_TemporaryColorTexture.Init("_TemporaryColorTexture");
}
public void Setup(RenderTargetIdentifier source, RenderTargetHandle destination)
{
this.source = source;
this.destination = destination;
}
public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
{
CommandBuffer cmd = CommandBufferPool.Get(m_ProfilerTag);
RenderTextureDescriptor opaqueDesc = renderingData.cameraData.cameraTargetDescriptor;
opaqueDesc.depthBufferBits = 0;
// Can't read and write to same color target, use a TemporaryRT
if (destination == RenderTargetHandle.CameraTarget)
{
cmd.GetTemporaryRT(m_TemporaryColorTexture.id, opaqueDesc, filterMode);
Blit(cmd, source, m_TemporaryColorTexture.Identifier(), blitMaterial, blitShaderPassIndex);
Blit(cmd, m_TemporaryColorTexture.Identifier(), source);
}
else
{
Blit(cmd, source, destination.Identifier(), blitMaterial, blitShaderPassIndex);
}
context.ExecuteCommandBuffer(cmd);
CommandBufferPool.Release(cmd);
}
public override void FrameCleanup(CommandBuffer cmd)
{
if (destination == RenderTargetHandle.CameraTarget)
cmd.ReleaseTemporaryRT(m_TemporaryColorTexture.id);
}
}
[System.Serializable]
public class BlitSettings
{
public RenderPassEvent Event = RenderPassEvent.AfterRenderingOpaques;
public Material blitMaterial = null;
public int blitMaterialPassIndex = -1;
public Target destination = Target.Color;
public string textureId = "_BlitPassTexture";
public bool alwaysRender = false;
}
public enum Target
{
Color,
Texture
}
public BlitSettings settings = new BlitSettings();
RenderTargetHandle m_RenderTextureHandle;
BlitPass blitPass;
public override void Create()
{
var passIndex = settings.blitMaterial != null ? settings.blitMaterial.passCount - 1 : 1;
settings.blitMaterialPassIndex = Mathf.Clamp(settings.blitMaterialPassIndex, -1, passIndex);
blitPass = new BlitPass(settings.Event, settings.blitMaterial, settings.blitMaterialPassIndex, name);
m_RenderTextureHandle.Init(settings.textureId);
}
public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
{
var src = renderer.cameraColorTarget;
var dest = (settings.destination == Target.Color) ? RenderTargetHandle.CameraTarget : m_RenderTextureHandle;
if (settings.blitMaterial == null)
{
Debug.LogWarningFormat(
"Missing Blit Material. {0} blit pass will not execute. Check for missing reference in the assigned renderer.",
GetType().Name);
return;
}
if (Application.isPlaying || settings.alwaysRender)
{
blitPass.Setup(src, dest);
renderer.EnqueuePass(blitPass);
}
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: d2d5de177d814a8d8c64638ad49b1b1d
timeCreated: 1666983505

View File

@ -0,0 +1,19 @@
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
namespace Shaders
{
public class BlitShaderGUI : ShaderGUI
{
public override void OnGUI (MaterialEditor materialEditor, MaterialProperty[] properties)
{
// var propertiesList = properties.ToList()
// .Where(prop => prop.displayName != "Texture");
// properties = propertiesList.ToArray();
base.OnGUI (materialEditor, properties);
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: ea9e1aab61914fdc984d1ba78a132f7c
timeCreated: 1667020752

View File

@ -0,0 +1,158 @@
Shader "CRTShader"
{
Properties
{
_MainTex("Texture", 2D) = "Transparent" {}
u_time("Time",float) = 0.5
u_bend("Bend",range(0.5, 5.0)) = 0.5
u_scanlin_transparence1("Scanline 1 Transparence",range(0, 1)) = 0.5
u_scanline_size_1("Scanline Size 1",range(0, 750)) = 0.5
u_scanline_speed_1("Scanline Speed 1",float) = 0.5
u_scanlin_transparence2("Scanline 2 Transparence",range(0, 1)) = 0.5
u_scanline_size_2("Scanline Size 2",range(0, 750)) = 0.5
u_scanline_speed_2("Scanline Speed 2",float) = 0.5
u_scanline_amount("Scanline Amount",range(0, 1)) = 0.5
u_vignette_size("Vignette Size",range(0, 10)) = 0.5
u_vignette_smoothness("Vignette Smoothness",range(0, 2)) = 0.5
u_vignette_edge_round("Vignette Edge Round",range(0, 100)) = 0.5
u_noise_size("Noise Size",range(0, 500 )) = 0.5
u_noise_amount("Noise Amount",range(0, 0.3)) = 0.5
u_red_offset_y("Red Offset",range(-0.01,0.01)) = 0
u_green_offset_y("Green Offset",range(-0.01,0.01)) = 0
u_blue_offset_y("Blue Offset",range(-0.01,0.01)) = 0
}
// The Unity Editor uses the class ExampleCustomEditor to configure the Inspector for this shader asset
CustomEditor "Shaders.BlitShaderGUI"
SubShader
{
// No culling or depth
Cull Off ZWrite Off ZTest Always
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
v2f vert(appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
sampler2D _MainTex;
uniform float u_time;
uniform float u_bend;
uniform float u_scanlin_transparence1;
uniform float u_scanline_size_1;
uniform float u_scanline_speed_1;
uniform float u_scanlin_transparence2;
uniform float u_scanline_size_2;
uniform float u_scanline_speed_2;
uniform float u_scanline_amount;
uniform float u_vignette_size;
uniform float u_vignette_smoothness;
uniform float u_vignette_edge_round;
uniform float u_noise_size;
uniform float u_noise_amount;
uniform float u_red_offset_y;
uniform float u_green_offset_y;
uniform float u_blue_offset_y;
half2 u_color_offset(float offset)
{
return half2(0,offset);
}
half2 crt_coords(half2 uv, float bend)
{
// By subtracting 0.5, we go from 0 to 1 into -0.5 to 0.5
uv -= 0.5;
// Multiplying by puts us in -1 to 1 space.
uv *= 2.;
// Curves lines
uv.x *= 1. + pow(abs(uv.y) / bend, 2.);
uv.y *= 1. + pow(abs(uv.x) / bend, 2.);
//return coordinates to 0 to 1 space.
uv /= 2;
return uv + 0.5;
}
float vignette(half2 uv, float size, float smoothness, float edgeRounding)
{
uv -= .5;
uv *= size;
float amount = sqrt(pow(abs(uv.x), edgeRounding) + pow(abs(uv.y), edgeRounding));
amount = 1. - amount;
return smoothstep(0, smoothness, amount);
}
float scanline(half2 uv, float lines, float speed, float transparence)
{
return sin(uv.y * lines + u_time * speed) * transparence;
}
float random(half2 uv)
{
return frac(sin(dot(uv, half2(15.1511, 42.5225))) * 12341.51611 * sin(u_time * 0.03));
}
float noise(half2 uv)
{
half2 i = floor(uv);
half2 f = frac(uv);
float a = random(i);
float b = random(i + half2(1., 0.));
float c = random(i + half2(0, 1.));
float d = random(i + half2(1., 1.));
half2 u = smoothstep(0., 1., f);
return lerp(a, b, u.x) + (c - a) * u.y * (1. - u.x) + (d - b) * u.x * u.y;
}
fixed4 frag(v2f i) : SV_Target
{
u_time = _Time;
half2 crt_uv = crt_coords(i.uv, u_bend);
fixed4 col;
col.r = tex2D(_MainTex, crt_uv + u_color_offset(u_red_offset_y)).r;
col.g = tex2D(_MainTex, crt_uv + u_color_offset(u_green_offset_y)).g;
col.b = tex2D(_MainTex, crt_uv + u_color_offset(u_blue_offset_y)).b;
col.a = tex2D(_MainTex, crt_uv).a;
float s1 = scanline(i.uv, u_scanline_size_1, u_scanline_speed_1, u_scanlin_transparence1);
float s2 = scanline(i.uv, u_scanline_size_2, u_scanline_speed_2,u_scanlin_transparence2);
col = lerp(col, fixed(s1 + s2), u_scanline_amount);
return lerp(col, fixed(noise(i.uv * u_noise_size)), u_noise_amount) * vignette(
i.uv, u_vignette_size, u_vignette_smoothness, u_vignette_edge_round);
}
ENDCG
}
}
}

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 7d830e9754227db4b89bacfdc753e135
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,62 @@
Shader "PixelShader"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
_ScreenWidth("screen width", float) = 320.0
_ScreenHeight("screen height", float) = 240.0
_CellSizeX("size of x cell", float) = 4.0
_CellSizeY("size of y cell", float) = 4.0
}
SubShader
{
// No culling or depth
Cull Off ZWrite Off ZTest Always
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
v2f vert(appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
sampler2D _MainTex;
float _ScreenWidth;
float _ScreenHeight;
float _CellSizeX;
float _CellSizeY;
fixed4 frag(v2f i) : SV_Target
{
float2 uv = i.uv;
float pixelX = _ScreenWidth / _CellSizeX;
float pixelY = _ScreenHeight / _CellSizeY;
return tex2D(_MainTex, float2(floor(pixelX * uv.x) / pixelX, floor(pixelY * uv.y) / pixelY));
}
ENDCG
}
}
}

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: c4d7011496fb8f34ead8b47276ae3f0a
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -0,0 +1,147 @@
fileFormatVersion: 2
guid: d1ac00be1def81845b41bef35d80621c
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 750
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Windows Store Apps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -19,7 +19,7 @@ TagManager:
- -
- -
- -
- - PostProcessing
- -
- -
- -