mirror of
https://github.com/mixandjam/Splatoon-Ink.git
synced 2026-04-25 15:58:15 -05:00
Tweakable downsampling. RenderMetaballs refactoring.
This commit is contained in:
parent
b5d5f87890
commit
e68a90c05f
|
|
@ -1,123 +0,0 @@
|
||||||
%YAML 1.1
|
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
|
||||||
--- !u!114 &-6663363066767020329
|
|
||||||
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: 4
|
|
||||||
--- !u!21 &2100000
|
|
||||||
Material:
|
|
||||||
serializedVersion: 6
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name: Blur
|
|
||||||
m_Shader: {fileID: 4800000, guid: c2cce5cab35b66c4482bc5a1d6f4ad99, type: 3}
|
|
||||||
m_ShaderKeywords:
|
|
||||||
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_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
|
|
||||||
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.2, g: 0.2, b: 0.2, a: 1}
|
|
||||||
m_BuildTextureStacks: []
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 0359b9610290c564e9a85a22826ef73f
|
|
||||||
NativeFormatImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
mainObjectFileID: 2100000
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -16,10 +16,10 @@ public class RenderMetaballs : ScriptableRendererFeature
|
||||||
int _metaballRTLargeId;
|
int _metaballRTLargeId;
|
||||||
int _metaballRTLarge2Id;
|
int _metaballRTLarge2Id;
|
||||||
|
|
||||||
|
int _downsamplingAmount = 4;
|
||||||
|
|
||||||
public Material BlitMaterial;
|
public Material BlitMaterial;
|
||||||
public Material BlurMaterial;
|
public Material BlurMaterial;
|
||||||
public Material BlitCopyMaterial;
|
|
||||||
public Material BlitCopyWithDepthMaterial;
|
|
||||||
public Material BlitCopyDepthMaterial;
|
public Material BlitCopyDepthMaterial;
|
||||||
|
|
||||||
RenderTargetIdentifier _metaballRTSmall;
|
RenderTargetIdentifier _metaballRTSmall;
|
||||||
|
|
@ -31,7 +31,6 @@ public class RenderMetaballs : ScriptableRendererFeature
|
||||||
RenderQueueType renderQueueType;
|
RenderQueueType renderQueueType;
|
||||||
FilteringSettings m_FilteringSettings;
|
FilteringSettings m_FilteringSettings;
|
||||||
RenderObjects.CustomCameraSettings m_CameraSettings;
|
RenderObjects.CustomCameraSettings m_CameraSettings;
|
||||||
string m_ProfilerTag;
|
|
||||||
ProfilingSampler m_ProfilingSampler;
|
ProfilingSampler m_ProfilingSampler;
|
||||||
|
|
||||||
public Material overrideMaterial { get; set; }
|
public Material overrideMaterial { get; set; }
|
||||||
|
|
@ -42,11 +41,10 @@ public class RenderMetaballs : ScriptableRendererFeature
|
||||||
RenderStateBlock m_RenderStateBlock;
|
RenderStateBlock m_RenderStateBlock;
|
||||||
|
|
||||||
public RenderMetaballsPass(string profilerTag, RenderPassEvent renderPassEvent, string[] shaderTags,
|
public RenderMetaballsPass(string profilerTag, RenderPassEvent renderPassEvent, string[] shaderTags,
|
||||||
RenderQueueType renderQueueType, int layerMask, RenderObjects.CustomCameraSettings cameraSettings)
|
RenderQueueType renderQueueType, int layerMask, RenderObjects.CustomCameraSettings cameraSettings, int downsamplingAmount)
|
||||||
{
|
{
|
||||||
profilingSampler = new ProfilingSampler(nameof(RenderObjectsPass));
|
profilingSampler = new ProfilingSampler(nameof(RenderObjectsPass));
|
||||||
|
|
||||||
m_ProfilerTag = profilerTag;
|
|
||||||
m_ProfilingSampler = new ProfilingSampler(profilerTag);
|
m_ProfilingSampler = new ProfilingSampler(profilerTag);
|
||||||
this.renderPassEvent = renderPassEvent;
|
this.renderPassEvent = renderPassEvent;
|
||||||
this.renderQueueType = renderQueueType;
|
this.renderQueueType = renderQueueType;
|
||||||
|
|
@ -73,9 +71,9 @@ public class RenderMetaballs : ScriptableRendererFeature
|
||||||
m_RenderStateBlock = new RenderStateBlock(RenderStateMask.Nothing);
|
m_RenderStateBlock = new RenderStateBlock(RenderStateMask.Nothing);
|
||||||
m_CameraSettings = cameraSettings;
|
m_CameraSettings = cameraSettings;
|
||||||
|
|
||||||
BlitCopyMaterial = new Material(Shader.Find("Hidden/BlitCopy"));
|
|
||||||
BlitCopyWithDepthMaterial = new Material(Shader.Find("Hidden/BlitCopyWithDepth"));
|
|
||||||
BlitCopyDepthMaterial = new Material(Shader.Find("Hidden/BlitToDepth"));
|
BlitCopyDepthMaterial = new Material(Shader.Find("Hidden/BlitToDepth"));
|
||||||
|
BlurMaterial = new Material(Shader.Find("Hidden/KawaseBlur"));
|
||||||
|
_downsamplingAmount = downsamplingAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method is called before executing the render pass.
|
// This method is called before executing the render pass.
|
||||||
|
|
@ -86,8 +84,8 @@ public class RenderMetaballs : ScriptableRendererFeature
|
||||||
public override void OnCameraSetup(CommandBuffer cmd, ref RenderingData renderingData)
|
public override void OnCameraSetup(CommandBuffer cmd, ref RenderingData renderingData)
|
||||||
{
|
{
|
||||||
RenderTextureDescriptor smallBlitTargetDescriptor = renderingData.cameraData.cameraTargetDescriptor;
|
RenderTextureDescriptor smallBlitTargetDescriptor = renderingData.cameraData.cameraTargetDescriptor;
|
||||||
smallBlitTargetDescriptor.width /= 4;
|
smallBlitTargetDescriptor.width /= _downsamplingAmount;
|
||||||
smallBlitTargetDescriptor.height /= 4;
|
smallBlitTargetDescriptor.height /= _downsamplingAmount;
|
||||||
smallBlitTargetDescriptor.colorFormat = RenderTextureFormat.ARGB32;
|
smallBlitTargetDescriptor.colorFormat = RenderTextureFormat.ARGB32;
|
||||||
|
|
||||||
RenderTextureDescriptor largeBlitTargetDescriptor = renderingData.cameraData.cameraTargetDescriptor;
|
RenderTextureDescriptor largeBlitTargetDescriptor = renderingData.cameraData.cameraTargetDescriptor;
|
||||||
|
|
@ -119,13 +117,6 @@ public class RenderMetaballs : ScriptableRendererFeature
|
||||||
// You don't have to call ScriptableRenderContext.submit, the render pipeline will call it at specific points in the pipeline.
|
// You don't have to call ScriptableRenderContext.submit, the render pipeline will call it at specific points in the pipeline.
|
||||||
public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
|
public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
CommandBuffer cmd = CommandBufferPool.Get();
|
|
||||||
Blit(cmd, _source, _destination, BlitMaterial);
|
|
||||||
context.ExecuteCommandBuffer(cmd);
|
|
||||||
CommandBufferPool.Release(cmd);
|
|
||||||
*/
|
|
||||||
|
|
||||||
SortingCriteria sortingCriteria = (renderQueueType == RenderQueueType.Transparent)
|
SortingCriteria sortingCriteria = (renderQueueType == RenderQueueType.Transparent)
|
||||||
? SortingCriteria.CommonTransparent
|
? SortingCriteria.CommonTransparent
|
||||||
: renderingData.cameraData.defaultOpaqueSortFlags;
|
: renderingData.cameraData.defaultOpaqueSortFlags;
|
||||||
|
|
@ -199,19 +190,18 @@ public class RenderMetaballs : ScriptableRendererFeature
|
||||||
}
|
}
|
||||||
|
|
||||||
public Material blitMaterial;
|
public Material blitMaterial;
|
||||||
public Material blurMaterial;
|
|
||||||
RenderMetaballsPass _scriptableMetaballsPass;
|
RenderMetaballsPass _scriptableMetaballsPass;
|
||||||
public RenderObjects.RenderObjectsSettings renderObjectsSettings = new RenderObjects.RenderObjectsSettings();
|
public RenderObjects.RenderObjectsSettings renderObjectsSettings = new RenderObjects.RenderObjectsSettings();
|
||||||
|
[Range(1, 16)] public int downsamplingAmount;
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public override void Create()
|
public override void Create()
|
||||||
{
|
{
|
||||||
RenderObjects.FilterSettings filter = renderObjectsSettings.filterSettings;
|
RenderObjects.FilterSettings filter = renderObjectsSettings.filterSettings;
|
||||||
_scriptableMetaballsPass = new RenderMetaballsPass(renderObjectsSettings.passTag, renderObjectsSettings.Event,
|
_scriptableMetaballsPass = new RenderMetaballsPass(renderObjectsSettings.passTag, renderObjectsSettings.Event,
|
||||||
filter.PassNames, filter.RenderQueueType, filter.LayerMask, renderObjectsSettings.cameraSettings)
|
filter.PassNames, filter.RenderQueueType, filter.LayerMask, renderObjectsSettings.cameraSettings, downsamplingAmount)
|
||||||
{
|
{
|
||||||
BlitMaterial = blitMaterial,
|
BlitMaterial = blitMaterial,
|
||||||
BlurMaterial = blurMaterial
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
Shader "Custom/KawaseBlur"
|
Shader "Hidden/KawaseBlur"
|
||||||
{
|
{
|
||||||
Properties
|
Properties
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -11403,7 +11403,7 @@ Transform:
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 869074592}
|
m_GameObject: {fileID: 869074592}
|
||||||
m_LocalRotation: {x: 0.09112676, y: 0.03213698, z: -0.00294232, w: 0.99531627}
|
m_LocalRotation: {x: 0.09112655, y: 0.032211166, z: -0.0029491126, w: 0.9953139}
|
||||||
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_Children:
|
m_Children:
|
||||||
|
|
@ -11508,7 +11508,7 @@ Transform:
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 906262002}
|
m_GameObject: {fileID: 906262002}
|
||||||
m_LocalRotation: {x: 0.05491182, y: 0.032222655, z: -0.0017730044, w: 0.99796957}
|
m_LocalRotation: {x: 0.054911688, y: 0.032297026, z: -0.0017770969, w: 0.9979672}
|
||||||
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_Children:
|
m_Children:
|
||||||
|
|
@ -15557,7 +15557,7 @@ ParticleSystem:
|
||||||
m_RotationOrder: 4
|
m_RotationOrder: 4
|
||||||
minKillSpeed: 0
|
minKillSpeed: 0
|
||||||
maxKillSpeed: 10000
|
maxKillSpeed: 10000
|
||||||
radiusScale: 1
|
radiusScale: 0.15
|
||||||
collidesWith:
|
collidesWith:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Bits: 55
|
m_Bits: 55
|
||||||
|
|
@ -17174,7 +17174,7 @@ Transform:
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1687258581}
|
m_GameObject: {fileID: 1687258581}
|
||||||
m_LocalRotation: {x: 0.091126755, y: 0.032136988, z: -0.00294232, w: 0.99531627}
|
m_LocalRotation: {x: 0.09112655, y: 0.032211162, z: -0.002949112, w: 0.9953139}
|
||||||
m_LocalPosition: {x: 0, y: 2.5, z: -7.04}
|
m_LocalPosition: {x: 0, y: 2.5, z: -7.04}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
|
|
@ -17583,7 +17583,7 @@ Transform:
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 2101118512}
|
m_GameObject: {fileID: 2101118512}
|
||||||
m_LocalRotation: {x: 0.09112676, y: 0.03213698, z: -0.00294232, w: 0.99531627}
|
m_LocalRotation: {x: 0.09112655, y: 0.032211166, z: -0.0029491126, w: 0.9953139}
|
||||||
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_Children:
|
m_Children:
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,6 @@ MonoBehaviour:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_Active: 1
|
m_Active: 1
|
||||||
blitMaterial: {fileID: 2100000, guid: ba62d2f9845041e498edc0cfd32a8813, type: 2}
|
blitMaterial: {fileID: 2100000, guid: ba62d2f9845041e498edc0cfd32a8813, type: 2}
|
||||||
blurMaterial: {fileID: 2100000, guid: 0359b9610290c564e9a85a22826ef73f, type: 2}
|
|
||||||
renderObjectsSettings:
|
renderObjectsSettings:
|
||||||
passTag: RenderMetaballs
|
passTag: RenderMetaballs
|
||||||
Event: 400
|
Event: 400
|
||||||
|
|
@ -80,6 +79,7 @@ MonoBehaviour:
|
||||||
restoreCamera: 1
|
restoreCamera: 1
|
||||||
offset: {x: 0, y: 0, z: 0, w: 0}
|
offset: {x: 0, y: 0, z: 0, w: 0}
|
||||||
cameraFieldOfView: 60
|
cameraFieldOfView: 60
|
||||||
|
downsamplingAmount: 4
|
||||||
--- !u!114 &11400000
|
--- !u!114 &11400000
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user