andytouch
5 年前
当前提交
83bb51a8
共有 31 个文件被更改,包括 680 次插入 和 92 次删除
-
2Assets/Data/UniversalRP/BoatDemoRenderer.asset
-
43Assets/Data/UniversalRP/BoatRetroRenderer.asset
-
3Assets/Data/UniversalRP/PipelineAsset_High.asset
-
2Assets/Data/UniversalRP/PipelineAsset_Low.asset
-
2Assets/Data/UniversalRP/PipelineAsset_Medium.asset
-
6Assets/Objects/Levels/Island/Terrain_0_0.asset
-
9Assets/Objects/Levels/Island/Terrain_1_0.asset
-
2Assets/Objects/misc/checkpoint.prefab
-
2Assets/ScriptableRenderFeatures/RetroPass/Mat_Pass_Retro.mat
-
2Assets/ScriptableRenderFeatures/RetroPass/ShaderGraph_Retro.shadergraph
-
2Assets/ScriptableRenderFeatures/SobelOutlinePass/Mat_Pass_OutlineSobel.mat
-
161Assets/scenes/demo_Island.unity
-
4Packages/manifest.json
-
4ProjectSettings/ProjectVersion.txt
-
4ProjectSettings/QualitySettings.asset
-
2Assets/ScriptableRenderFeatures/GradientFog/ShaderGraph_GradientFog.shadergraph.meta
-
77Assets/Data/UniversalRP/BoatGradientFogRenderer.asset
-
8Assets/Data/UniversalRP/BoatGradientFogRenderer.asset.meta
-
8Assets/ScriptableRenderFeatures/GradientFog.meta
-
102Assets/ScriptableRenderFeatures/RenderPasses/GradientFog.cs
-
11Assets/ScriptableRenderFeatures/RenderPasses/GradientFog.cs.meta
-
15ProjectSettings/URPProjectSettings.asset
-
16Assets/ScriptableRenderFeatures/GradientFog/GradientFogFunction.hlsl
-
9Assets/ScriptableRenderFeatures/GradientFog/GradientFogFunction.hlsl.meta
-
224Assets/ScriptableRenderFeatures/GradientFog/ShaderGraph_GradientFog.shadergraph
-
36Assets/Data/UniversalRP/BoatXRayRenderer.asset
-
8Assets/Data/UniversalRP/BoatXRayRenderer.asset.meta
-
8Assets/ScriptableRenderFeatures/DitherPass.meta
-
0/Assets/ScriptableRenderFeatures/GradientFog/ShaderGraph_GradientFog.shadergraph.meta
6
Assets/Objects/Levels/Island/Terrain_0_0.asset
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
9
Assets/Objects/Levels/Island/Terrain_1_0.asset
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
2
Assets/ScriptableRenderFeatures/RetroPass/ShaderGraph_Retro.shadergraph
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
m_EditorVersion: 2019.3.0f6 |
|||
m_EditorVersionWithRevision: 2019.3.0f6 (27ab2135bccf) |
|||
m_EditorVersion: 2019.3.13f1 |
|||
m_EditorVersionWithRevision: 2019.3.13f1 (d4ddf0d95db9) |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!114 &-8245398564993106213 |
|||
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: 1386573b276c54a468778c523d829e91, type: 3} |
|||
m_Name: Gradient Fog |
|||
m_EditorClassIdentifier: |
|||
m_Active: 1 |
|||
settings: |
|||
Event: 500 |
|||
StartDistance: -8.7 |
|||
EndDistance: 58 |
|||
NearColor: {r: 0.42866677, g: 0.5183965, b: 0.5377358, a: 0.31764707} |
|||
MiddleColor: {r: 0.5566038, g: 0.42360774, b: 0.31243324, a: 0.72156864} |
|||
FarColor: {r: 0.40650585, g: 0.5703295, b: 0.8207547, a: 0.4117647} |
|||
--- !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: de640fe3d0db1804a85f9fc8f5cadab6, type: 3} |
|||
m_Name: BoatGradientFogRenderer |
|||
m_EditorClassIdentifier: |
|||
m_RendererFeatures: |
|||
- {fileID: 1999314579490882026} |
|||
- {fileID: -8245398564993106213} |
|||
m_RendererFeatureMap: ea41d06804febe1bdbfe11eeb075928d |
|||
postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} |
|||
shaders: |
|||
blitPS: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3} |
|||
copyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3} |
|||
screenSpaceShadowPS: {fileID: 4800000, guid: 0f854b35a0cf61a429bd5dcfea30eddd, |
|||
type: 3} |
|||
samplingPS: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3} |
|||
fallbackErrorPS: {fileID: 4800000, guid: e6e9a19c3678ded42a3bc431ebef7dbd, type: 3} |
|||
m_OpaqueLayerMask: |
|||
serializedVersion: 2 |
|||
m_Bits: 4294967295 |
|||
m_TransparentLayerMask: |
|||
serializedVersion: 2 |
|||
m_Bits: 4294967295 |
|||
m_DefaultStencilState: |
|||
overrideStencilState: 0 |
|||
stencilReference: 0 |
|||
stencilCompareFunction: 8 |
|||
passOperation: 0 |
|||
failOperation: 0 |
|||
zFailOperation: 0 |
|||
m_ShadowTransparentReceive: 1 |
|||
--- !u!114 &1999314579490882026 |
|||
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: adbe377f4f72c497faee64bc3f0580b9, type: 3} |
|||
m_Name: NewWaterSystemFeature |
|||
m_EditorClassIdentifier: |
|||
m_Active: 1 |
|||
settings: |
|||
causticScale: 0.25 |
|||
debug: 0 |
|||
causticShader: {fileID: 4800000, guid: 90939d2e4b62841d29c136c866715501, type: 3} |
|
|||
fileFormatVersion: 2 |
|||
guid: f06a214f7c2afa545ab1295a706adaa4 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: bf17ba41c2bec0641bd728b0ddffc92a |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEngine; |
|||
using UnityEngine.Rendering; |
|||
using UnityEngine.Rendering.Universal; |
|||
|
|||
public class GradientFog : ScriptableRendererFeature |
|||
{ |
|||
[System.Serializable] |
|||
public class GradientFogSettings |
|||
{ |
|||
public RenderPassEvent Event = RenderPassEvent.AfterRenderingOpaques; |
|||
public float StartDistance = 0; |
|||
public float EndDistance = 50; |
|||
public Color NearColor = new Color(0, 0.2f, 0.35f, 1); |
|||
public Color MiddleColor = new Color(0.62f, 0.86f, 1, 1); |
|||
public Color FarColor = new Color(0.85f, 0.96f, 1, 1); |
|||
} |
|||
|
|||
|
|||
class GradientFogPass : ScriptableRenderPass |
|||
{ |
|||
public GradientFogSettings settings; |
|||
|
|||
private Material fogMaterial; |
|||
|
|||
private RenderTargetIdentifier source { get; set; } |
|||
private RenderTargetHandle m_TempTex; |
|||
|
|||
public GradientFogPass() |
|||
{ |
|||
m_TempTex.Init("_TempTex"); |
|||
fogMaterial = new Material(Shader.Find("Shader Graphs/ShaderGraph_GradientFog")); |
|||
} |
|||
|
|||
public void Setup(RenderTargetIdentifier cameraColorTarget) |
|||
{ |
|||
source = cameraColorTarget; |
|||
fogMaterial.SetFloat("_StartDist", settings.StartDistance); |
|||
fogMaterial.SetFloat("_EndDist", settings.EndDistance); |
|||
fogMaterial.SetColor("_NearCol", settings.NearColor); |
|||
fogMaterial.SetColor("_MidCol", settings.MiddleColor); |
|||
fogMaterial.SetColor("_FarCol", settings.FarColor); |
|||
} |
|||
|
|||
// This method is called before executing the render pass.
|
|||
// It can be used to configure render targets and their clear state. Also to create temporary render target textures.
|
|||
// When empty this render pass will render to the active camera render target.
|
|||
// You should never call CommandBuffer.SetRenderTarget. Instead call <c>ConfigureTarget</c> and <c>ConfigureClear</c>.
|
|||
// The render pipeline will ensure target setup and clearing happens in an performance manner.
|
|||
public override void Configure(CommandBuffer cmd, RenderTextureDescriptor cameraTextureDescriptor) |
|||
{ |
|||
} |
|||
|
|||
// Here you can implement the rendering logic.
|
|||
// Use <c>ScriptableRenderContext</c> to issue drawing commands or execute command buffers
|
|||
// https://docs.unity3d.com/ScriptReference/Rendering.ScriptableRenderContext.html
|
|||
// 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) |
|||
{ |
|||
CommandBuffer cmd = CommandBufferPool.Get("Gradient Fog"); |
|||
|
|||
RenderTextureDescriptor opaqueDesc = renderingData.cameraData.cameraTargetDescriptor; |
|||
|
|||
opaqueDesc.depthBufferBits = 0; |
|||
|
|||
cmd.GetTemporaryRT(m_TempTex.id, opaqueDesc); |
|||
|
|||
|
|||
Blit(cmd, source, m_TempTex.Identifier(), fogMaterial); |
|||
Blit(cmd, m_TempTex.Identifier(), source); |
|||
|
|||
context.ExecuteCommandBuffer(cmd); |
|||
CommandBufferPool.Release(cmd); |
|||
} |
|||
|
|||
/// Cleanup any allocated resources that were created during the execution of this render pass.
|
|||
public override void FrameCleanup(CommandBuffer cmd) |
|||
{ |
|||
cmd.ReleaseTemporaryRT(m_TempTex.id); |
|||
} |
|||
} |
|||
|
|||
GradientFogPass m_GradientFogPass; |
|||
public GradientFogSettings settings = new GradientFogSettings(); |
|||
|
|||
public override void Create() |
|||
{ |
|||
m_GradientFogPass = new GradientFogPass(); |
|||
m_GradientFogPass.settings = settings; |
|||
|
|||
// Configures where the render pass should be injected.
|
|||
m_GradientFogPass.renderPassEvent = settings.Event; |
|||
} |
|||
|
|||
// Here you can inject one or multiple render passes in the renderer.
|
|||
// This method is called when setting up the renderer once per-camera.
|
|||
public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData) |
|||
{ |
|||
var src = renderer.cameraColorTarget; |
|||
m_GradientFogPass.Setup(src); |
|||
renderer.EnqueuePass(m_GradientFogPass); |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 1386573b276c54a468778c523d829e91 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!114 &1 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 61 |
|||
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: 247994e1f5a72c2419c26a37e9334c01, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
m_LastMaterialVersion: 1 |
|
|||
#ifndef GRADIENTFOGFUNCTION_INCLUDED |
|||
#define GRADIENTFOGFUNCTION_INCLUDED |
|||
|
|||
float4 noFog = float4(0,0,0,1); |
|||
|
|||
void FogGradient_float(float4 a, float4 b, float4 c, float t, out float4 Out) { |
|||
float alpha = step(t, 0.3) * lerp(0, 0.7, t*3.3); |
|||
alpha += step(0.3, t) * lerp(0.7, 1, (t-0.3)*1.42); |
|||
|
|||
float4 color = step(t, 0.3) * lerp(noFog, a, t*3.3); |
|||
color += step(0.3, t) * step(t, 0.6) * lerp(a, b, (t-0.3)*3.3); |
|||
color += step(0.6, t) * lerp(b,c, saturate((t-0.6)*2.5)); |
|||
|
|||
Out = float4(color.r, color.g, color.b, saturate(alpha)); |
|||
} |
|||
#endif |
|
|||
fileFormatVersion: 2 |
|||
guid: c09f29dd61d5ae94d82327f71a164e3a |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
224
Assets/ScriptableRenderFeatures/GradientFog/ShaderGraph_GradientFog.shadergraph
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
%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: de640fe3d0db1804a85f9fc8f5cadab6, type: 3} |
|||
m_Name: BoatXRayRenderer |
|||
m_EditorClassIdentifier: |
|||
m_RendererFeatures: [] |
|||
postProcessData: {fileID: 0} |
|||
shaders: |
|||
blitPS: {fileID: 0} |
|||
copyDepthPS: {fileID: 0} |
|||
screenSpaceShadowPS: {fileID: 0} |
|||
samplingPS: {fileID: 0} |
|||
fallbackErrorPS: {fileID: 0} |
|||
m_OpaqueLayerMask: |
|||
serializedVersion: 2 |
|||
m_Bits: 4294967295 |
|||
m_TransparentLayerMask: |
|||
serializedVersion: 2 |
|||
m_Bits: 4294967295 |
|||
m_DefaultStencilState: |
|||
overrideStencilState: 0 |
|||
stencilReference: 0 |
|||
stencilCompareFunction: 8 |
|||
passOperation: 0 |
|||
failOperation: 0 |
|||
zFailOperation: 0 |
|||
m_ShadowTransparentReceive: 1 |
|
|||
fileFormatVersion: 2 |
|||
guid: 936e79759a86c0b48a42e4be70b6de87 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: f408f669171964041b051a8fd88d3efe |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue