浏览代码

Merge pull request #240 from Unity-Technologies/postfx

Post-processing stack v2 integration
/Branch_batcher
GitHub 8 年前
当前提交
0f1a3e92
共有 12 个文件被更改,包括 56 次插入1254 次删除
  1. 4
      .gitmodules
  2. 40
      Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  3. 19
      Assets/TestScenes/HDTest/HDRenderLoopTest.unity
  4. 9
      Assets/ScriptableRenderPipeline/PostProcessing.meta
  5. 9
      Assets/ScriptableRenderPipeline/HDRenderPipeline/PostProcess.meta
  6. 1001
      Assets/Textures/LensDirt00.png
  7. 76
      Assets/Textures/LensDirt00.png.meta
  8. 76
      Assets/Textures/LensDirt01.png.meta
  9. 76
      Assets/Textures/LensDirt02.png.meta

4
.gitmodules


[submodule "Assets/TestScenes/Big"]
path = Assets/TestScenes/Big
url = https://github.com/Unity-Technologies/ScriptableRenderLoopScenes
[submodule "Assets/ScriptableRenderPipeline/PostProcessing"]
path = Assets/ScriptableRenderPipeline/PostProcessing
url = https://github.com/Unity-Technologies/PostProcessing
branch = v2

40
Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


using UnityEngine.Rendering;
using System;
using System.Linq;
using UnityEngine.Experimental.PostProcessing;
using UnityEngine.Experimental.Rendering.HDPipeline.TilePass;
#if UNITY_EDITOR

private RenderTargetIdentifier m_CameraDepthStencilBufferRT;
private RenderTargetIdentifier m_CameraDepthStencilBufferCopyRT;
// Post-processing context (recycled on every frame to avoid GC alloc)
readonly PostProcessRenderContext m_PostProcessContext;
// Detect when windows size is changing
int m_CurrentWidth;
int m_CurrentHeight;

m_SkyManager.Build();
m_SkyManager.skySettings = owner.skySettingsToUse;
m_PostProcessContext = new PostProcessRenderContext();
}
void InitializeDebugMaterials()

// Instead we chose to apply distortion at the end after we cumulate distortion vector and desired blurriness. This
RenderDistortion(cullResults, camera, renderContext);
FinalPass(camera, renderContext);
RenderPostProcesses(camera, renderContext);
}
}

}
}
void FinalPass(Camera camera, ScriptableRenderContext renderContext)
void RenderPostProcesses(Camera camera, ScriptableRenderContext renderContext)
using (new Utilities.ProfilingSample("Final", renderContext))
using (new Utilities.ProfilingSample("Post-processing", renderContext))
// All of this is temporary, sub-optimal and quickly hacked together but is necessary
// for artists to do lighting work until the fully-featured framework is ready
var postProcessLayer = camera.GetComponent<PostProcessLayer>();
var cmd = new CommandBuffer { name = "" };
var localPostProcess = camera.GetComponent<PostProcessingSRP>();
if (postProcessLayer != null && postProcessLayer.enabled)
{
cmd.SetGlobalTexture("_CameraDepthTexture", GetDepthTexture());
bool localActive = localPostProcess != null && localPostProcess.enabled;
var context = m_PostProcessContext;
context.Reset();
context.source = m_CameraColorBufferRT;
context.destination = BuiltinRenderTextureType.CameraTarget;
context.command = cmd;
context.camera = camera;
context.sourceFormat = RenderTextureFormat.ARGBHalf; // ?
context.flip = true;
if (!localActive)
postProcessLayer.Render(context);
}
else
var cmd = new CommandBuffer { name = "" };
renderContext.ExecuteCommandBuffer(cmd);
cmd.Dispose();
return;
localPostProcess.Render(camera, renderContext, m_CameraColorBufferRT, BuiltinRenderTextureType.CameraTarget);
renderContext.ExecuteCommandBuffer(cmd);
cmd.Dispose();
}
}

19
Assets/TestScenes/HDTest/HDRenderLoopTest.unity


- component: {fileID: 1828470162}
- component: {fileID: 1828470161}
- component: {fileID: 1828470160}
- component: {fileID: 1828470165}
- component: {fileID: 1828470165}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera

m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowMSAA: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10

m_GameObject: {fileID: 1828470159}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 92bb16b4ee20841929b24d6bd771738d, type: 3}
m_Script: {fileID: 11500000, guid: 948f4100a11a5c24981795d21301da5c, type: 3}
volumeTrigger: {fileID: 1828470164}
volumeLayer:
serializedVersion: 2
m_Bits: 1
antialiasingMode: 0
temporalAntialiasing:
jitterSpread: 0.75
sharpen: 0.25
stationaryBlending: 0.95
motionBlending: 0.85
showDebugUI: 0
debugView:
monitor: 1
--- !u!114 &1828470166
MonoBehaviour:
m_ObjectHideFlags: 0

9
Assets/ScriptableRenderPipeline/PostProcessing.meta


fileFormatVersion: 2
guid: f9e0215129f26be429b86e3119cc9a5c
folderAsset: yes
timeCreated: 1493295523
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
Assets/ScriptableRenderPipeline/HDRenderPipeline/PostProcess.meta


fileFormatVersion: 2
guid: 838933a8561a8704e9d537270132e500
folderAsset: yes
timeCreated: 1474641822
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

1001
Assets/Textures/LensDirt00.png
文件差异内容过多而无法显示
查看文件

76
Assets/Textures/LensDirt00.png.meta


fileFormatVersion: 2
guid: 69e847bbff1cf5449a4ee0bbd045dbc9
timeCreated: 1472572785
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 4096
textureSettings:
filterMode: -1
aniso: 0
mipBias: -1
wrapMode: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 1024
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 1024
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

76
Assets/Textures/LensDirt01.png.meta


fileFormatVersion: 2
guid: 3884f7a2d04ffe8409ad9200b275896f
timeCreated: 1472551546
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 4096
textureSettings:
filterMode: -1
aniso: 0
mipBias: -1
wrapMode: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 1024
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 1024
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

76
Assets/Textures/LensDirt02.png.meta


fileFormatVersion: 2
guid: a2960ffde020f27409e070d92fb2e00b
timeCreated: 1472632371
licenseType: Pro
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 4096
textureSettings:
filterMode: -1
aniso: 0
mipBias: -1
wrapMode: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 1024
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 1024
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

部分文件因为文件数量过多而无法显示

正在加载...
取消
保存