Evgenii Golubev
7 年前
当前提交
1df1dda7
共有 9 个文件被更改,包括 118 次插入 和 106 次删除
-
6ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDStringConstants.cs
-
2ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightEvaluation.hlsl
-
8ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/Resources/VolumetricLighting.compute
-
60ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VolumetricLighting.cs
-
6ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderVariables.hlsl
-
59ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/HomogeneousMediumVolume.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/HomogeneousMediumVolume.cs.meta
-
13ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/HomogeneousFog.cs.meta
-
59ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/HomogeneousFog.cs
|
|||
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|||
{ |
|||
[ExecuteInEditMode] |
|||
[AddComponentMenu("RenderPipeline/High Definition/Homogeneous Medium Volume", -1)] |
|||
public class HomogeneousMediumVolume : 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 HomogeneousMediumVolume GetGlobalHomogeneousMediumVolume() |
|||
{ |
|||
HomogeneousMediumVolume globalVolume = null; |
|||
|
|||
HomogeneousMediumVolume[] volumes = FindObjectsOfType(typeof(HomogeneousMediumVolume)) as HomogeneousMediumVolume[]; |
|||
|
|||
foreach (HomogeneousMediumVolume 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: |
|
|||
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("RenderPipeline/High Definition/Homogenous Fog", -1)] |
|||
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.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 HomogeneousFog GetGlobalFogComponent() |
|||
{ |
|||
HomogeneousFog globalFogComponent = null; |
|||
|
|||
HomogeneousFog[] fogComponents = FindObjectsOfType(typeof(HomogeneousFog)) as HomogeneousFog[]; |
|||
|
|||
foreach (HomogeneousFog fogComponent in fogComponents) |
|||
{ |
|||
if (fogComponent.enabled && !fogComponent.volumeParameters.IsLocalVolume()) |
|||
{ |
|||
globalFogComponent = fogComponent; |
|||
break; |
|||
} |
|||
} |
|||
|
|||
return globalFogComponent; |
|||
} |
|||
} |
|||
} // UnityEngine.Experimental.Rendering.HDPipeline
|
撰写
预览
正在加载...
取消
保存
Reference in new issue