浏览代码
Revert "Merge branch 'master' of https://github.com/Unity-Technologies/ScriptableRenderPipeline into xrsettings"
Revert "Merge branch 'master' of https://github.com/Unity-Technologies/ScriptableRenderPipeline into xrsettings"
This reverts commit b4235a00abc6fa6e57b0ec4e3b9ac5476a00483b, reversing changes made to 9f8c48222c8e832dafba28a61d7eb38a18a5f9c8./main
Nerites
6 年前
当前提交
7a18f28e
共有 120 个文件被更改,包括 1293 次插入 和 2217 次删除
-
2com.unity.render-pipelines.core/CoreRP/Editor/Debugging/DebugWindow.cs
-
8com.unity.render-pipelines.core/CoreRP/Shadow/AdditionalShadowData.cs
-
21com.unity.render-pipelines.high-definition/CHANGELOG.md
-
38com.unity.render-pipelines.high-definition/HDRP/Camera/HDAdditionalCameraData.cs
-
4com.unity.render-pipelines.high-definition/HDRP/Debug/DebugDisplay.cs
-
35com.unity.render-pipelines.high-definition/HDRP/Editor/Camera/HDCameraEditor.cs
-
30com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/HDLightEditor.cs
-
11com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/EditorReflectionSystem.cs
-
6com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/EditorReflectionSystemGUI.cs
-
196com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Handles.cs
-
21com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.ProbeUtility.cs
-
14com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.cs
-
55com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditorUtility.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeUI.Drawers.cs
-
4com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Drawers.cs
-
5com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Decal/DecalProjectorComponentEditor.cs
-
162com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Decal/DecalUI.cs
-
1com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/GlobalDecalSettingsUI.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/SerializedGlobalDecalSettings.cs
-
4com.unity.render-pipelines.high-definition/HDRP/Editor/ShaderGraph/HDPBRPass.template
-
4com.unity.render-pipelines.high-definition/HDRP/Editor/ShaderGraph/HDUnlitPassForward.template
-
6com.unity.render-pipelines.high-definition/HDRP/Editor/Upgraders/HDRPVersion.cs
-
35com.unity.render-pipelines.high-definition/HDRP/Editor/Upgraders/UpgradeMenuItem.cs
-
27com.unity.render-pipelines.high-definition/HDRP/Lighting/Light/HDAdditionalLightData.cs
-
63com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoopDef.hlsl
-
4com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoopSettings.cs
-
8com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/cleardispatchindirect.compute
-
23com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/HDAdditionalReflectionData.cs
-
22com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/PlanarReflectionProbe.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/PlanarReflectionProbe.cs.meta
-
2com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/Volumes/ReflectionProxyVolumeComponent.cs.meta
-
22com.unity.render-pipelines.high-definition/HDRP/Material/Decal/DBufferManager.cs
-
23com.unity.render-pipelines.high-definition/HDRP/Material/Decal/Decal.cs
-
42com.unity.render-pipelines.high-definition/HDRP/Material/Decal/Decal.cs.hlsl
-
134com.unity.render-pipelines.high-definition/HDRP/Material/Decal/Decal.hlsl
-
422com.unity.render-pipelines.high-definition/HDRP/Material/Decal/Decal.shader
-
42com.unity.render-pipelines.high-definition/HDRP/Material/Decal/DecalData.hlsl
-
2com.unity.render-pipelines.high-definition/HDRP/Material/Decal/DecalProjectorComponent.cs
-
32com.unity.render-pipelines.high-definition/HDRP/Material/Decal/DecalSystem.cs
-
103com.unity.render-pipelines.high-definition/HDRP/Material/Decal/DecalUtilities.hlsl
-
1com.unity.render-pipelines.high-definition/HDRP/Material/Decal/GlobalDecalSettings.cs
-
3com.unity.render-pipelines.high-definition/HDRP/Material/LayeredLit/LayeredLit.shader
-
3com.unity.render-pipelines.high-definition/HDRP/Material/LayeredLit/LayeredLitTessellation.shader
-
11com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.cs
-
3com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.shader
-
3com.unity.render-pipelines.high-definition/HDRP/Material/Lit/LitTessellation.shader
-
2com.unity.render-pipelines.high-definition/HDRP/Material/Material.hlsl
-
4com.unity.render-pipelines.high-definition/HDRP/Material/PreIntegratedFGD/PreIntegratedFGD.cs
-
11com.unity.render-pipelines.high-definition/HDRP/Material/StackLit/StackLit.cs
-
6com.unity.render-pipelines.high-definition/HDRP/Material/StackLit/StackLit.shader
-
20com.unity.render-pipelines.high-definition/HDRP/Material/SubsurfaceScattering/SubsurfaceScattering.hlsl
-
35com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDRenderPipeline.cs
-
20com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDStringConstants.cs
-
10com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/Settings/FrameSettings.cs
-
81com.unity.render-pipelines.high-definition/HDRP/RenderPipelineResources/HDRenderPipelineResources.asset
-
94com.unity.render-pipelines.high-definition/HDRP/ShaderVariables.hlsl
-
10com.unity.render-pipelines.high-definition/HDRP/ShaderVariablesFunctions.hlsl
-
3com.unity.render-pipelines.high-definition/HDRP/ShaderVariablesMatrixDefsHDCamera.hlsl
-
2com.unity.render-pipelines.high-definition/HDRP/ShaderVariablesMatrixDefsLegacyUnity.hlsl
-
183com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGraph/LightWeightPBRSubShader.cs
-
183com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGraph/LightWeightUnlitSubShader.cs
-
44com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGraph/lightweightPBRExtraPasses.template
-
44com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGraph/lightweightUnlitExtraPasses.template
-
28com.unity.shadergraph/CHANGELOG.md
-
2com.unity.shadergraph/Editor/Data/Graphs/TextureShaderProperty.cs
-
13com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalCreateNode.cs
-
10com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DArrayNode.cs
-
2com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture3DNode.cs
-
12com.unity.shadergraph/Editor/Data/Util/ShaderGenerator.cs
-
2com.unity.shadergraph/Editor/Drawing/Views/Slots/TextureSlotControlView.cs
-
2com.unity.shadergraph/Editor/Importers/ShaderGraphImporter.cs
-
6com.unity.render-pipelines.high-definition/HDRP/Sky/OpaqueAtmosphericScattering.shader
-
2com.unity.render-pipelines.high-definition/HDRP/Sky/AtmosphericScattering/AtmosphericScattering.cs.meta
-
10com.unity.render-pipelines.high-definition/HDRP/Sky/AtmosphericScattering.meta
-
10com.unity.render-pipelines.high-definition/HDRP/Sky/OpaqueAtmosphericScattering.shader.meta
-
20com.unity.render-pipelines.high-definition/HDRP/Sky/SkyVariables.hlsl
-
10com.unity.render-pipelines.high-definition/HDRP/Sky/SkyVariables.hlsl.meta
-
10com.unity.render-pipelines.high-definition/HDRP/Sky/AtmosphericScattering/AtmosphericScattering.cs.hlsl.meta
-
113com.unity.render-pipelines.high-definition/HDRP/Sky/AtmosphericScattering/AtmosphericScattering.hlsl
-
10com.unity.render-pipelines.high-definition/HDRP/Sky/AtmosphericScattering/AtmosphericScattering.hlsl.meta
-
188com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Gizmos.cs
-
11com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Gizmos.cs.meta
-
39com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Skin.cs
-
11com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Skin.cs.meta
-
8com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Icons.meta
-
68com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/ShaderVariablesLightLoop.hlsl
-
9com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/ShaderVariablesLightLoop.hlsl.meta
-
8com.unity.render-pipelines.high-definition/HDRP/Lighting/AtmosphericScattering.meta
-
8com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceLighting.meta
-
5com.unity.render-pipelines.high-definition/HDRP/Material/Decal/ShaderVariablesDecal.hlsl
-
9com.unity.render-pipelines.high-definition/HDRP/Material/Decal/ShaderVariablesDecal.hlsl.meta
-
18com.unity.render-pipelines.high-definition/HDRP/Material/SubsurfaceScattering/ShaderVariablesSubsurfaceScattering.hlsl
-
9com.unity.render-pipelines.high-definition/HDRP/Material/SubsurfaceScattering/ShaderVariablesSubsurfaceScattering.hlsl.meta
-
3com.unity.shadergraph/.data/normal_derive_nodes.PNG
-
3com.unity.shadergraph/.data/texel_size_node.PNG
-
436com.unity.shadergraph/.data/wave_form_nodes.PNG
|
|||
fileFormatVersion: 2 |
|||
guid: d522828bc0314e14cb6faa4291bb64da |
|||
folderAsset: yes |
|||
timeCreated: 1507718579 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 326059e48e5735e46a98047eff4f0295 |
|||
timeCreated: 1507736585 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
#ifndef UNITY_SKY_VARIABLES_INCLUDED |
|||
#define UNITY_SKY_VARIABLES_INCLUDED |
|||
|
|||
TEXTURECUBE(_SkyTexture); |
|||
|
|||
CBUFFER_START(SkyParameters) |
|||
float _SkyTextureMipCount; |
|||
CBUFFER_END |
|||
|
|||
float4 SampleSkyTexture(float3 texCoord) |
|||
{ |
|||
return SAMPLE_TEXTURECUBE(_SkyTexture, s_trilinear_clamp_sampler, texCoord); |
|||
} |
|||
|
|||
float4 SampleSkyTexture(float3 texCoord, float lod) |
|||
{ |
|||
return SAMPLE_TEXTURECUBE_LOD(_SkyTexture, s_trilinear_clamp_sampler, texCoord, lod); |
|||
} |
|||
|
|||
#endif |
|
|||
fileFormatVersion: 2 |
|||
guid: 7ed7d57e43fdd874ab5d047358e9fbe1 |
|||
timeCreated: 1508156067 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 746eb08eff3e2bd40b7f247282758859 |
|||
timeCreated: 1507735980 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
#ifndef UNITY_ATMOSPHERIC_SCATTERING_INCLUDED |
|||
#define UNITY_ATMOSPHERIC_SCATTERING_INCLUDED |
|||
|
|||
#include "CoreRP/ShaderLibrary/VolumeRendering.hlsl" |
|||
#include "CoreRP/ShaderLibrary/Filtering.hlsl" |
|||
|
|||
#include "AtmosphericScattering.cs.hlsl" |
|||
#include "../SkyVariables.hlsl" |
|||
#include "../../ShaderVariables.hlsl" |
|||
#include "../../Lighting/Volumetrics/VBuffer.hlsl" |
|||
|
|||
TEXTURE3D(_VBufferLighting); |
|||
|
|||
#ifdef DEBUG_DISPLAY |
|||
#include "../../Debug/DebugDisplay.hlsl" |
|||
#endif |
|||
|
|||
CBUFFER_START(AtmosphericScattering) |
|||
int _AtmosphericScatteringType; |
|||
// Common |
|||
float _FogColorMode; |
|||
float4 _FogColorDensity; // color in rgb, density in alpha |
|||
float4 _MipFogParameters; |
|||
// Linear fog |
|||
float4 _LinearFogParameters; |
|||
// Exp fog |
|||
float4 _ExpFogParameters; |
|||
CBUFFER_END |
|||
|
|||
#define _MipFogNear _MipFogParameters.x |
|||
#define _MipFogFar _MipFogParameters.y |
|||
#define _MipFogMaxMip _MipFogParameters.z |
|||
|
|||
#define _FogDensity _FogColorDensity.w |
|||
#define _FogColor _FogColorDensity |
|||
|
|||
#define _LinearFogStart _LinearFogParameters.x |
|||
#define _LinearFogOneOverRange _LinearFogParameters.y |
|||
#define _LinearFogHeightEnd _LinearFogParameters.z |
|||
#define _LinearFogHeightOneOverRange _LinearFogParameters.w |
|||
|
|||
#define _ExpFogDistance _ExpFogParameters.x |
|||
#define _ExpFogBaseHeight _ExpFogParameters.y |
|||
#define _ExpFogHeightAttenuation _ExpFogParameters.z |
|||
|
|||
float3 GetFogColor(PositionInputs posInput) |
|||
{ |
|||
if (_FogColorMode == FOGCOLORMODE_CONSTANT_COLOR) |
|||
{ |
|||
return _FogColor.rgb; |
|||
} |
|||
else if (_FogColorMode == FOGCOLORMODE_SKY_COLOR) |
|||
{ |
|||
// Based on Uncharted 4 "Mip Sky Fog" trick: http://advances.realtimerendering.com/other/2016/naughty_dog/NaughtyDog_TechArt_Final.pdf |
|||
float mipLevel = (1.0 - _MipFogMaxMip * saturate((posInput.linearDepth - _MipFogNear) / (_MipFogFar - _MipFogNear))) * _SkyTextureMipCount; |
|||
float3 dir = -GetWorldSpaceNormalizeViewDir(posInput.positionWS); |
|||
return SampleSkyTexture(dir, mipLevel).rgb; |
|||
} |
|||
else // Should not be possible. |
|||
return float3(0.0, 0.0, 0.0); |
|||
} |
|||
|
|||
// Returns fog color in rgb and fog factor in alpha. |
|||
float4 EvaluateAtmosphericScattering(PositionInputs posInput) |
|||
{ |
|||
float3 fogColor = 0; |
|||
float fogFactor = 0; |
|||
|
|||
#ifdef DEBUG_DISPLAY |
|||
// Don't sample atmospheric scattering when lighting debug more are enabled so fog is not visible |
|||
if (_DebugLightingMode == DEBUGLIGHTINGMODE_DIFFUSE_LIGHTING || _DebugLightingMode == DEBUGLIGHTINGMODE_SPECULAR_LIGHTING || _DebugLightingMode == DEBUGLIGHTINGMODE_LUX_METER) |
|||
return float4(0, 0, 0, 0); |
|||
#endif |
|||
|
|||
switch (_AtmosphericScatteringType) |
|||
{ |
|||
case FOGTYPE_LINEAR: |
|||
{ |
|||
fogColor = GetFogColor(posInput); |
|||
fogFactor = _FogDensity * saturate((posInput.linearDepth - _LinearFogStart) * _LinearFogOneOverRange) * saturate((_LinearFogHeightEnd - GetAbsolutePositionWS(posInput.positionWS).y) * _LinearFogHeightOneOverRange); |
|||
break; |
|||
} |
|||
case FOGTYPE_EXPONENTIAL: |
|||
{ |
|||
fogColor = GetFogColor(posInput); |
|||
float distance = length(GetWorldSpaceViewDir(posInput.positionWS)); |
|||
float fogHeight = max(0.0, GetAbsolutePositionWS(posInput.positionWS).y - _ExpFogBaseHeight); |
|||
fogFactor = _FogDensity * TransmittanceHomogeneousMedium(_ExpFogHeightAttenuation, fogHeight) * (1.0f - TransmittanceHomogeneousMedium(1.0f / _ExpFogDistance, distance)); |
|||
break; |
|||
} |
|||
case FOGTYPE_VOLUMETRIC: |
|||
{ |
|||
float4 volFog = SampleVolumetricLighting(TEXTURE3D_PARAM(_VBufferLighting, s_linear_clamp_sampler), |
|||
posInput.positionNDC, |
|||
posInput.linearDepth, |
|||
_VBufferResolution, |
|||
_VBufferSliceCount.xy, |
|||
_VBufferUvScaleAndLimit.xy, |
|||
_VBufferUvScaleAndLimit.zw, |
|||
_VBufferDepthEncodingParams, |
|||
_VBufferDepthDecodingParams, |
|||
true, true); |
|||
|
|||
fogFactor = 1 - volFog.a; // Opacity from transmittance |
|||
fogColor = volFog.rgb * min(rcp(fogFactor), FLT_MAX); // Un-premultiply, clamp to avoid (0 * INF = NaN) |
|||
break; |
|||
} |
|||
} |
|||
|
|||
return float4(fogColor, fogFactor); |
|||
} |
|||
|
|||
#endif |
|
|||
fileFormatVersion: 2 |
|||
guid: 79c365cd29649284492547604a3cf00f |
|||
timeCreated: 1507717326 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEditorInternal; |
|||
using UnityEngine; |
|||
using UnityEngine.Experimental.Rendering; |
|||
using UnityEngine.Experimental.Rendering.HDPipeline; |
|||
|
|||
namespace UnityEditor.Experimental.Rendering |
|||
{ |
|||
partial class HDReflectionProbeEditor |
|||
{ |
|||
static Mesh sphere; |
|||
static Material material; |
|||
|
|||
[DrawGizmo(GizmoType.Active)] |
|||
static void RenderGizmo(ReflectionProbe reflectionProbe, GizmoType gizmoType) |
|||
{ |
|||
var e = GetEditorFor(reflectionProbe); |
|||
if (e == null || !e.sceneViewEditing) |
|||
return; |
|||
|
|||
var reflectionData = reflectionProbe.GetComponent<HDAdditionalReflectionData>(); |
|||
|
|||
switch (EditMode.editMode) |
|||
{ |
|||
// Influence editing
|
|||
case EditMode.SceneViewEditMode.ReflectionProbeBox: |
|||
Gizmos_Influence(reflectionProbe, reflectionData, e, true); |
|||
break; |
|||
// Influence fade editing
|
|||
case EditMode.SceneViewEditMode.GridBox: |
|||
Gizmos_InfluenceFade(reflectionProbe, reflectionData, e, InfluenceType.Standard, true); |
|||
break; |
|||
// Influence normal fade editing
|
|||
case EditMode.SceneViewEditMode.Collider: |
|||
Gizmos_InfluenceFade(reflectionProbe, reflectionData, e, InfluenceType.Normal, true); |
|||
break; |
|||
} |
|||
} |
|||
|
|||
[DrawGizmo(GizmoType.Selected)] |
|||
static void DrawSelectedGizmo(ReflectionProbe reflectionProbe, GizmoType gizmoType) |
|||
{ |
|||
var e = GetEditorFor(reflectionProbe); |
|||
if (e == null) |
|||
return; |
|||
|
|||
var reflectionData = reflectionProbe.GetComponent<HDAdditionalReflectionData>(); |
|||
Gizmos_CapturePoint(reflectionProbe, reflectionData, e); |
|||
|
|||
if (!e.sceneViewEditing) |
|||
return; |
|||
|
|||
//Gizmos_Influence(reflectionProbe, reflectionData, e, false);
|
|||
Gizmos_InfluenceFade(reflectionProbe, reflectionData, null, InfluenceType.Standard, false); |
|||
Gizmos_InfluenceFade(reflectionProbe, reflectionData, null, InfluenceType.Normal, false); |
|||
|
|||
DrawVerticalRay(reflectionProbe.transform); |
|||
} |
|||
|
|||
static void Gizmos_InfluenceFade(ReflectionProbe p, HDAdditionalReflectionData a, HDReflectionProbeEditor e, InfluenceType type, bool isEdit) |
|||
{ |
|||
var col = Gizmos.color; |
|||
var mat = Gizmos.matrix; |
|||
|
|||
Gizmo6FacesBoxContained box; |
|||
Vector3 boxCenterOffset; |
|||
Vector3 boxSizeOffset; |
|||
float sphereRadiusOffset; |
|||
Color color; |
|||
switch (type) |
|||
{ |
|||
default: |
|||
case InfluenceType.Standard: |
|||
{ |
|||
box = e != null ? e.m_UIState.alternativeBoxBlendHandle : null; |
|||
boxCenterOffset = a.boxBlendCenterOffset; |
|||
boxSizeOffset = a.boxBlendSizeOffset; |
|||
sphereRadiusOffset = a.sphereBlendRadiusOffset; |
|||
color = isEdit ? k_GizmoThemeColorInfluenceBlendFace : k_GizmoThemeColorInfluenceBlend; |
|||
break; |
|||
} |
|||
case InfluenceType.Normal: |
|||
{ |
|||
box = e != null ? e.m_UIState.alternativeBoxBlendNormalHandle : null; |
|||
boxCenterOffset = a.boxBlendNormalCenterOffset; |
|||
boxSizeOffset = a.boxBlendNormalSizeOffset; |
|||
sphereRadiusOffset = a.sphereBlendNormalRadiusOffset; |
|||
color = isEdit ? k_GizmoThemeColorInfluenceNormalBlendFace : k_GizmoThemeColorInfluenceNormalBlend; |
|||
break; |
|||
} |
|||
} |
|||
|
|||
Gizmos.matrix = HDReflectionProbeEditorUtility.GetLocalSpace(p); |
|||
switch (a.influenceShape) |
|||
{ |
|||
case ShapeType.Box: |
|||
{ |
|||
Gizmos.color = color; |
|||
if (e != null) // e == null may occure when editor have still not been created at selection while the tool is not used for this part
|
|||
{ |
|||
box.DrawHull(isEdit); |
|||
} |
|||
else |
|||
{ |
|||
if (isEdit) |
|||
Gizmos.DrawCube(p.center + boxCenterOffset, p.size + boxSizeOffset); |
|||
else |
|||
Gizmos.DrawWireCube(p.center + boxCenterOffset, p.size + boxSizeOffset); |
|||
} |
|||
break; |
|||
} |
|||
case ShapeType.Sphere: |
|||
{ |
|||
Gizmos.color = color; |
|||
if (isEdit) |
|||
Gizmos.DrawSphere(p.center, a.influenceSphereRadius + sphereRadiusOffset); |
|||
else |
|||
Gizmos.DrawWireSphere(p.center, a.influenceSphereRadius + sphereRadiusOffset); |
|||
break; |
|||
} |
|||
} |
|||
|
|||
Gizmos.matrix = mat; |
|||
Gizmos.color = col; |
|||
} |
|||
|
|||
static void Gizmos_Influence(ReflectionProbe p, HDAdditionalReflectionData a, HDReflectionProbeEditor e, bool isEdit) |
|||
{ |
|||
var col = Gizmos.color; |
|||
var mat = Gizmos.matrix; |
|||
|
|||
Gizmos.matrix = HDReflectionProbeEditorUtility.GetLocalSpace(p); |
|||
switch (a.influenceShape) |
|||
{ |
|||
case ShapeType.Box: |
|||
{ |
|||
Gizmos.color = k_GizmoThemeColorExtentFace; |
|||
e.m_UIState.alternativeBoxInfluenceHandle.DrawHull(isEdit); |
|||
break; |
|||
} |
|||
case ShapeType.Sphere: |
|||
{ |
|||
Gizmos.color = k_GizmoThemeColorExtentFace; |
|||
if (isEdit) |
|||
Gizmos.DrawSphere(p.center, a.influenceSphereRadius); |
|||
else |
|||
Gizmos.DrawWireSphere(p.center, a.influenceSphereRadius); |
|||
break; |
|||
} |
|||
} |
|||
|
|||
Gizmos.matrix = mat; |
|||
Gizmos.color = col; |
|||
} |
|||
|
|||
static void DrawVerticalRay(Transform transform) |
|||
{ |
|||
Ray ray = new Ray(transform.position, Vector3.down); |
|||
RaycastHit hit; |
|||
if (Physics.Raycast(ray, out hit)) |
|||
{ |
|||
Handles.color = Color.green; |
|||
Handles.zTest = UnityEngine.Rendering.CompareFunction.LessEqual; |
|||
Handles.DrawLine(transform.position - Vector3.up * 0.5f, hit.point); |
|||
Handles.DrawWireDisc(hit.point, hit.normal, 0.5f); |
|||
|
|||
Handles.color = Color.red; |
|||
Handles.zTest = UnityEngine.Rendering.CompareFunction.Greater; |
|||
Handles.DrawLine(transform.position, hit.point); |
|||
Handles.DrawWireDisc(hit.point, hit.normal, 0.5f); |
|||
} |
|||
} |
|||
|
|||
static void Gizmos_CapturePoint(ReflectionProbe p, HDAdditionalReflectionData a, HDReflectionProbeEditor e) |
|||
{ |
|||
if(sphere == null) |
|||
{ |
|||
sphere = Resources.GetBuiltinResource<Mesh>("New-Sphere.fbx"); |
|||
} |
|||
if(material == null) |
|||
{ |
|||
material = new Material(Shader.Find("Debug/ReflectionProbePreview")); |
|||
} |
|||
material.SetTexture("_Cubemap", p.texture); |
|||
material.SetPass(0); |
|||
Graphics.DrawMeshNow(sphere, Matrix4x4.TRS(p.transform.position, Quaternion.identity, Vector3.one)); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: f0521a8f59de2c548bc5a6796cd32be9 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using UnityEditor.IMGUI.Controls; |
|||
using UnityEditorInternal; |
|||
using UnityEngine; |
|||
using UnityEngine.Experimental.Rendering; |
|||
using UnityEngine.Experimental.Rendering.HDPipeline; |
|||
|
|||
namespace UnityEditor.Experimental.Rendering |
|||
{ |
|||
partial class HDReflectionProbeEditor |
|||
{ |
|||
internal static Color k_GizmoThemeColorExtent = new Color(255f / 255f, 229f / 255f, 148f / 255f, 80f / 255f); |
|||
internal static Color k_GizmoThemeColorExtentFace = new Color(255f / 255f, 229f / 255f, 148f / 255f, 45f / 255f); |
|||
internal static Color k_GizmoThemeColorInfluenceBlend = new Color(83f / 255f, 255f / 255f, 95f / 255f, 75f / 255f); |
|||
internal static Color k_GizmoThemeColorInfluenceBlendFace = new Color(83f / 255f, 255f / 255f, 95f / 255f, 17f / 255f); |
|||
internal static Color k_GizmoThemeColorInfluenceNormalBlend = new Color(0f / 255f, 229f / 255f, 255f / 255f, 80f / 255f); |
|||
internal static Color k_GizmoThemeColorInfluenceNormalBlendFace = new Color(0f / 255f, 229f / 255f, 255f / 255f, 36f / 255f); |
|||
internal static Color k_GizmoThemeColorProjection = new Color(0x00 / 255f, 0xE5 / 255f, 0xFF / 255f, 0x20 / 255f); |
|||
internal static Color k_GizmoThemeColorProjectionFace = new Color(0x00 / 255f, 0xE5 / 255f, 0xFF / 255f, 0x20 / 255f); |
|||
internal static Color k_GizmoThemeColorDisabled = new Color(0x99 / 255f, 0x89 / 255f, 0x59 / 255f, 0x10 / 255f); |
|||
internal static Color k_GizmoThemeColorDisabledFace = new Color(0x99 / 255f, 0x89 / 255f, 0x59 / 255f, 0x10 / 255f); |
|||
|
|||
internal static readonly Color[][] k_handlesColor = new Color[][] |
|||
{ |
|||
new Color[] |
|||
{ |
|||
Color.red, |
|||
Color.green, |
|||
Color.blue |
|||
}, |
|||
new Color[] |
|||
{ |
|||
new Color(.5f, 0f, 0f, 1f), |
|||
new Color(0f, .5f, 0f, 1f), |
|||
new Color(0f, 0f, .5f, 1f) |
|||
} |
|||
}; |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 4bdc573336d075b419133b489a094c6a |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 97dc5286d61263d47b2705992cffe2d9 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
#ifdef SHADER_VARIABLES_INCLUDE_CB |
|||
|
|||
#define MAX_ENV2D_LIGHT 32 |
|||
|
|||
uint _DirectionalLightCount; |
|||
uint _PunctualLightCount; |
|||
uint _AreaLightCount; |
|||
uint _EnvLightCount; |
|||
uint _EnvProxyCount; |
|||
int _EnvLightSkyEnabled; // TODO: make it a bool |
|||
|
|||
uint _NumTileFtplX; |
|||
uint _NumTileFtplY; |
|||
|
|||
// these uniforms are only needed for when OPAQUES_ONLY is NOT defined |
|||
// but there's a problem with our front-end compilation of compute shaders with multiple kernels causing it to error |
|||
//#ifdef USE_CLUSTERED_LIGHTLIST |
|||
float4x4 g_mInvScrProjection; // TODO: remove, unused in HDRP |
|||
|
|||
float g_fClustScale; |
|||
float g_fClustBase; |
|||
float g_fNearPlane; |
|||
float g_fFarPlane; |
|||
int g_iLog2NumClusters; // We need to always define these to keep constant buffer layouts compatible |
|||
|
|||
uint g_isLogBaseBufferEnabled; |
|||
//#endif |
|||
|
|||
//#ifdef USE_CLUSTERED_LIGHTLIST |
|||
uint _NumTileClusteredX; |
|||
uint _NumTileClusteredY; |
|||
|
|||
float4x4 _Env2DCaptureVP[MAX_ENV2D_LIGHT]; |
|||
|
|||
#else |
|||
|
|||
#include "HDRP/Lighting/LightDefinition.cs.hlsl" |
|||
#include "CoreRP/Shadow/ShadowBase.cs.hlsl" |
|||
|
|||
StructuredBuffer<uint> g_vLightListGlobal; // don't support Buffer yet in unity |
|||
|
|||
StructuredBuffer<uint> g_vLayeredOffsetsBuffer; // don't support Buffer yet in unity |
|||
StructuredBuffer<float> g_logBaseBuffer; // don't support Buffer yet in unity |
|||
//#endif |
|||
|
|||
#ifdef USE_INDIRECT |
|||
StructuredBuffer<uint> g_TileFeatureFlags; |
|||
#endif |
|||
|
|||
StructuredBuffer<DirectionalLightData> _DirectionalLightDatas; |
|||
StructuredBuffer<LightData> _LightDatas; |
|||
StructuredBuffer<EnvLightData> _EnvLightDatas; |
|||
StructuredBuffer<ShadowData> _ShadowDatas; |
|||
|
|||
// Used by directional and spot lights |
|||
TEXTURE2D_ARRAY(_CookieTextures); |
|||
|
|||
// Used by point lights |
|||
TEXTURECUBE_ARRAY_ABSTRACT(_CookieCubeTextures); |
|||
|
|||
// Use texture array for reflection (or LatLong 2D array for mobile) |
|||
TEXTURECUBE_ARRAY_ABSTRACT(_EnvCubemapTextures); |
|||
TEXTURE2D_ARRAY(_Env2DTextures); |
|||
|
|||
// XRTODO: Need to stereo-ize access |
|||
TEXTURE2D(_DeferredShadowTexture); |
|||
|
|||
#endif |
|
|||
fileFormatVersion: 2 |
|||
guid: 63d561c067f228044bff7c3922047bf2 |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 41811d2641d454a48819f6e50a816af9 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 8201940de2426934dbd592ff5cf182c9 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
#ifdef SHADER_VARIABLES_INCLUDE_CB |
|||
uint _EnableDBuffer; |
|||
float2 _DecalAtlasResolution; |
|||
#else |
|||
#endif |
|
|||
fileFormatVersion: 2 |
|||
guid: 9f6cea0783427804084f429e8502ad33 |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
#ifdef SHADER_VARIABLES_INCLUDE_CB |
|||
#include "HDRP/Material/DiffusionProfile/DiffusionProfileSettings.cs.hlsl" |
|||
|
|||
// Warning: Unity is not able to losslessly transfer integers larger than 2^24 to the shader system. |
|||
// Therefore, we bitcast uint to float in C#, and bitcast back to uint in the shader. |
|||
uint _EnableSubsurfaceScattering; // Globally toggles subsurface and transmission scattering on/off |
|||
float _TexturingModeFlags; // 1 bit/profile; 0 = PreAndPostScatter, 1 = PostScatter |
|||
float _TransmissionFlags; // 1 bit/profile; 0 = regular, 1 = thin |
|||
// Old SSS Model >>> |
|||
float4 _HalfRcpVariancesAndWeights[DIFFUSION_PROFILE_COUNT][2]; // 2x Gaussians in RGB, A is interpolation weights |
|||
// <<< Old SSS Model |
|||
// Use float4 to avoid any packing issue between compute and pixel shaders |
|||
float4 _ThicknessRemaps[DIFFUSION_PROFILE_COUNT]; // R: start, G = end - start, BA unused |
|||
float4 _ShapeParams[DIFFUSION_PROFILE_COUNT]; // RGB = S = 1 / D, A = filter radius |
|||
float4 _TransmissionTintsAndFresnel0[DIFFUSION_PROFILE_COUNT]; // RGB = 1/4 * color, A = fresnel0 |
|||
float4 _WorldScales[DIFFUSION_PROFILE_COUNT]; // X = meters per world unit; Y = world units per meter |
|||
#else |
|||
#endif |
|
|||
fileFormatVersion: 2 |
|||
guid: 63af6347132378d43b75aa5e4efeb029 |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
version https://git-lfs.github.com/spec/v1 |
|||
oid sha256:2c14e830338ddf74ff5479bb56e8aa4a4d0f9274e96390d9897d97228f281d8e |
|||
size 54715 |
|
|||
version https://git-lfs.github.com/spec/v1 |
|||
oid sha256:7502c3fdf5b201b4460a317b577d4e0490e500a6926ba35c53e236afa15ab76a |
|||
size 82906 |
部分文件因为文件数量过多而无法显示
撰写
预览
正在加载...
取消
保存
Reference in new issue