浏览代码
Merge remote-tracking branch 'refs/remotes/origin/master' into Improve-forward-opaque-pass
/main
Merge remote-tracking branch 'refs/remotes/origin/master' into Improve-forward-opaque-pass
/main
sebastienlagarde
7 年前
当前提交
2bc6907f
共有 40 个文件被更改,包括 750 次插入 和 377 次删除
-
148ScriptableRenderPipeline/Core/CoreRP/GeometryUtils.cs
-
14ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Common.hlsl
-
20ScriptableRenderPipeline/HDRenderPipeline/HDRP/Camera/HDCamera.cs
-
3ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs
-
8ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDStringConstants.cs
-
2ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Deferred.shader
-
2ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightEvaluation.hlsl
-
2ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/Deferred.compute
-
2ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.cs
-
10ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/Resources/VolumetricLighting.compute
-
31ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VBuffer.hlsl
-
125ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VolumetricLighting.cs
-
18ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/DiffusionProfile/DiffusionProfileSettings.cs
-
44ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl
-
3ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/SubsurfaceScattering/SubsurfaceScattering.compute
-
35ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/SubsurfaceScattering/SubsurfaceScattering.hlsl
-
3ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/SubsurfaceScattering/SubsurfaceScattering.shader
-
2ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderPass/ShaderPassForward.hlsl
-
8ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderVariables.hlsl
-
2ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/AtmosphericScattering/AtmosphericScattering.hlsl
-
5ScriptableRenderPipeline/LightweightPipeline/LWRP/Data/LightweightPipelineAsset.cs
-
2ScriptableRenderPipeline/LightweightPipeline/LWRP/Data/LightweightPipelineResources.asset
-
1ScriptableRenderPipeline/LightweightPipeline/LWRP/Data/LightweightPipelineResources.cs
-
122ScriptableRenderPipeline/LightweightPipeline/LWRP/LightweightPipeline.cs
-
30ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Core.hlsl
-
9ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Lighting.hlsl
-
4ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/LightweightPassLit.hlsl
-
6ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/LightweightPassShadow.hlsl
-
151ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Shadows.hlsl
-
8ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightStandard.shader
-
8ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightStandardSimpleLighting.shader
-
8ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightStandardTerrain.shader
-
48ScriptableRenderPipeline/Core/CoreRP/GeometryUtils.cs.hlsl
-
9ScriptableRenderPipeline/Core/CoreRP/GeometryUtils.cs.hlsl.meta
-
59ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/HomogeneousDensityVolume.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/HomogeneousDensityVolume.cs.meta
-
85ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightScreenSpaceShadows.shader
-
9ScriptableRenderPipeline/LightweightPipeline/LWRP/Shaders/LightweightScreenSpaceShadows.shader.meta
-
13ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/HomogeneousFog.cs.meta
-
57ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/HomogeneousFog.cs
|
|||
// |
|||
// This file was automatically generated. Please don't edit by hand. |
|||
// |
|||
|
|||
#ifndef GEOMETRYUTILS_CS_HLSL |
|||
#define GEOMETRYUTILS_CS_HLSL |
|||
// Generated from UnityEngine.Experimental.Rendering.OrientedBBox |
|||
// PackingRules = Exact |
|||
struct OrientedBBox |
|||
{ |
|||
float3 center; |
|||
float extentX; |
|||
float3 right; |
|||
float extentY; |
|||
float3 up; |
|||
float extentZ; |
|||
}; |
|||
|
|||
// |
|||
// Accessors for UnityEngine.Experimental.Rendering.OrientedBBox |
|||
// |
|||
float3 GetCenter(OrientedBBox value) |
|||
{ |
|||
return value.center; |
|||
} |
|||
float GetExtentX(OrientedBBox value) |
|||
{ |
|||
return value.extentX; |
|||
} |
|||
float3 GetRight(OrientedBBox value) |
|||
{ |
|||
return value.right; |
|||
} |
|||
float GetExtentY(OrientedBBox value) |
|||
{ |
|||
return value.extentY; |
|||
} |
|||
float3 GetUp(OrientedBBox value) |
|||
{ |
|||
return value.up; |
|||
} |
|||
float GetExtentZ(OrientedBBox value) |
|||
{ |
|||
return value.extentZ; |
|||
} |
|||
|
|||
|
|||
#endif |
|
|||
fileFormatVersion: 2 |
|||
guid: c168c5bb5d2fae84499b8ee8f2a3cdbc |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|||
{ |
|||
[ExecuteInEditMode] |
|||
[AddComponentMenu("Rendering/Homogeneous Density Volume", 1100)] |
|||
public class HomogeneousDensityVolume : MonoBehaviour |
|||
{ |
|||
public VolumeParameters volumeParameters = new VolumeParameters(); |
|||
|
|||
private void Awake() |
|||
{ |
|||
} |
|||
|
|||
private void OnEnable() |
|||
{ |
|||
} |
|||
|
|||
private void OnDisable() |
|||
{ |
|||
} |
|||
|
|||
private void Update() |
|||
{ |
|||
} |
|||
|
|||
private void OnValidate() |
|||
{ |
|||
volumeParameters.Constrain(); |
|||
} |
|||
|
|||
void OnDrawGizmos() |
|||
{ |
|||
if (volumeParameters.IsLocalVolume()) |
|||
{ |
|||
Gizmos.color = volumeParameters.albedo; |
|||
Gizmos.matrix = transform.localToWorldMatrix; |
|||
Gizmos.DrawWireCube(Vector3.zero, Vector3.one); |
|||
} |
|||
} |
|||
|
|||
// Returns NULL if a global fog component does not exist, or is not enabled.
|
|||
public static HomogeneousDensityVolume GetGlobalHomogeneousDensityVolume() |
|||
{ |
|||
HomogeneousDensityVolume globalVolume = null; |
|||
|
|||
HomogeneousDensityVolume[] volumes = FindObjectsOfType(typeof(HomogeneousDensityVolume)) as HomogeneousDensityVolume[]; |
|||
|
|||
foreach (HomogeneousDensityVolume volume in volumes) |
|||
{ |
|||
if (volume.enabled && !volume.volumeParameters.IsLocalVolume()) |
|||
{ |
|||
globalVolume = volume; |
|||
break; |
|||
} |
|||
} |
|||
|
|||
return globalVolume; |
|||
} |
|||
} |
|||
} // UnityEngine.Experimental.Rendering.HDPipeline
|
|
|||
fileFormatVersion: 2 |
|||
guid: 1c273c50d71d46a4f98a1d23256a8c63 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
Shader "Hidden/LightweightPipeline/ScreenSpaceShadows" |
|||
{ |
|||
SubShader |
|||
{ |
|||
Tags{ "RenderPipeline" = "LightweightPipeline" } |
|||
|
|||
HLSLINCLUDE |
|||
|
|||
//Keep compiler quiet about Shadows.hlsl. |
|||
#include "CoreRP/ShaderLibrary/Common.hlsl" |
|||
#include "CoreRP/ShaderLibrary/EntityLighting.hlsl" |
|||
#include "CoreRP/ShaderLibrary/ImageBasedLighting.hlsl" |
|||
#include "LWRP/ShaderLibrary/Core.hlsl" |
|||
#include "LWRP/ShaderLibrary/Shadows.hlsl" |
|||
|
|||
TEXTURE2D(_CameraDepthTexture); |
|||
SAMPLER(sampler_CameraDepthTexture); |
|||
|
|||
struct VertexInput |
|||
{ |
|||
float4 vertex : POSITION; |
|||
float2 texcoord : TEXCOORD0; |
|||
UNITY_VERTEX_INPUT_INSTANCE_ID |
|||
}; |
|||
|
|||
struct Interpolators |
|||
{ |
|||
half4 pos : SV_POSITION; |
|||
half4 texcoord : TEXCOORD0; |
|||
UNITY_VERTEX_INPUT_INSTANCE_ID |
|||
}; |
|||
|
|||
Interpolators Vertex(VertexInput i) |
|||
{ |
|||
Interpolators o; |
|||
UNITY_SETUP_INSTANCE_ID(i); |
|||
UNITY_TRANSFER_INSTANCE_ID(i, o); |
|||
|
|||
o.pos = TransformObjectToHClip(i.vertex.xyz); |
|||
|
|||
float4 projPos = o.pos * 0.5; |
|||
projPos.xy = projPos.xy + projPos.w; |
|||
|
|||
o.texcoord.xy = i.texcoord; |
|||
o.texcoord.zw = projPos.xy; |
|||
|
|||
return o; |
|||
} |
|||
|
|||
half Fragment(Interpolators i) : SV_Target |
|||
{ |
|||
UNITY_SETUP_INSTANCE_ID(i); |
|||
|
|||
float deviceDepth = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, sampler_CameraDepthTexture, i.texcoord.xy); |
|||
|
|||
#if UNITY_REVERSED_Z |
|||
deviceDepth = 1 - deviceDepth; |
|||
#endif |
|||
deviceDepth = 2 * deviceDepth - 1; //NOTE: Currently must massage depth before computing CS position. |
|||
|
|||
float3 vpos = ComputeViewSpacePosition(i.texcoord.zw, deviceDepth, unity_CameraInvProjection); |
|||
float3 wpos = mul(unity_CameraToWorld, float4(vpos, 1)).xyz; |
|||
|
|||
//Fetch shadow coordinates for cascade. |
|||
float4 coords = ComputeShadowCoord(wpos); |
|||
|
|||
return SampleShadowmap(coords); |
|||
} |
|||
|
|||
ENDHLSL |
|||
|
|||
Pass |
|||
{ |
|||
ZTest Always ZWrite Off |
|||
|
|||
HLSLPROGRAM |
|||
#pragma multi_compile _ _SHADOWS_SOFT |
|||
#pragma multi_compile _ _SHADOWS_CASCADE |
|||
|
|||
#pragma vertex Vertex |
|||
#pragma fragment Fragment |
|||
ENDHLSL |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 0f854b35a0cf61a429bd5dcfea30eddd |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 8f608e240d5376341bcef2478d231457 |
|||
timeCreated: 1503411233 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|||
{ |
|||
[ExecuteInEditMode] |
|||
[AddComponentMenu("Rendering/Homogenous Fog", 1100)] |
|||
public class HomogeneousFog : MonoBehaviour |
|||
{ |
|||
public VolumeParameters volumeParameters = new VolumeParameters(); |
|||
|
|||
private void Awake() |
|||
{ |
|||
} |
|||
|
|||
private void OnEnable() |
|||
{ |
|||
} |
|||
|
|||
private void OnDisable() |
|||
{ |
|||
} |
|||
|
|||
private void Update() |
|||
{ |
|||
} |
|||
|
|||
private void OnValidate() |
|||
{ |
|||
volumeParameters.Constrain(); |
|||
} |
|||
|
|||
void OnDrawGizmos() |
|||
{ |
|||
if (volumeParameters != null && !volumeParameters.IsVolumeUnbounded()) |
|||
{ |
|||
Gizmos.DrawWireCube(volumeParameters.bounds.center, volumeParameters.bounds.size); |
|||
} |
|||
} |
|||
|
|||
// Returns NULL if a global fog component does not exist, or is not enabled.
|
|||
public static HomogeneousFog GetGlobalFogComponent() |
|||
{ |
|||
HomogeneousFog globalFogComponent = null; |
|||
|
|||
HomogeneousFog[] fogComponents = FindObjectsOfType(typeof(HomogeneousFog)) as HomogeneousFog[]; |
|||
|
|||
foreach (HomogeneousFog fogComponent in fogComponents) |
|||
{ |
|||
if (fogComponent.enabled && fogComponent.volumeParameters.IsVolumeUnbounded()) |
|||
{ |
|||
globalFogComponent = fogComponent; |
|||
break; |
|||
} |
|||
} |
|||
|
|||
return globalFogComponent; |
|||
} |
|||
} |
|||
} // UnityEngine.Experimental.Rendering.HDPipeline
|
撰写
预览
正在加载...
取消
保存
Reference in new issue