比较提交
合并到: unity-tech-cn:main
unity-tech-cn:/main
unity-tech-cn:/scriptablerenderloop-materialgraph
unity-tech-cn:/batch_rendering
unity-tech-cn:/vr_sandbox
unity-tech-cn:/Branch_Batching2
unity-tech-cn:/mikko-renderpass
unity-tech-cn:/fptl_cleanup
unity-tech-cn:/vr_fptl_sandbox
unity-tech-cn:/Branch_batcher
unity-tech-cn:/MobileDeferredRenderPass
unity-tech-cn:/vr_api_testbed
unity-tech-cn:/RenderPassXR_Sandbox
unity-tech-cn:/classicDeferredMobile
unity-tech-cn:/EnableVulkanAndES3
unity-tech-cn:/OnTileRenderPass2
unity-tech-cn:/sample_game
unity-tech-cn:/culling
unity-tech-cn:/OTDRP-develop
unity-tech-cn:/Add-support-for-light-specular-color-tint
unity-tech-cn:/stochastic_alpha_test
unity-tech-cn:/Yibing-Project-2
unity-tech-cn:/xr-hdrp-rt-test
unity-tech-cn:/system-shock-transitional-shader
unity-tech-cn:/feature-runtimeTextureCache
unity-tech-cn:/shader-library-include-paths
unity-tech-cn:/asmdef
unity-tech-cn:/namespace
unity-tech-cn:/feature-ReflectionProbeFit
unity-tech-cn:/prototype-decals
unity-tech-cn:/DrawSettings
unity-tech-cn:/projects-TheLastStand
unity-tech-cn:/iridesence
unity-tech-cn:/lw-nolightlist
unity-tech-cn:/Add-physical-light-unity-support
unity-tech-cn:/LightweightPipelineExperimental
unity-tech-cn:/switch_support
unity-tech-cn:/feature-ScreenSpaceProjection
unity-tech-cn:/use-roughness
unity-tech-cn:/LW-BakedIndirect
unity-tech-cn:/Branch_FixObjectMotion
unity-tech-cn:/srp_batcher
unity-tech-cn:/LW-LightOptimizations
unity-tech-cn:/Branch_ScriptableCulling
unity-tech-cn:/LW-LowEnd
unity-tech-cn:/feature-ReflectionProbeBaking
unity-tech-cn:/Improve-shader-generator
unity-tech-cn:/improve-shader-generator-data
unity-tech-cn:/2018.1
unity-tech-cn:/lwr-xr-shader-fixes-sandbox
unity-tech-cn:/uifoldout-fix
unity-tech-cn:/lw-callbacktests
unity-tech-cn:/lwrp-xr-sssm-DrawProc
unity-tech-cn:/lwrp-xr-tim-hacks
unity-tech-cn:/ss3HDRP
unity-tech-cn:/build-automation
unity-tech-cn:/HDRP_SurfaceShader
unity-tech-cn:/tag-1.1.0-beta
unity-tech-cn:/xr-hdrp-pyramids
unity-tech-cn:/lw-bias_per_cascade
unity-tech-cn:/040SimpleLighting
unity-tech-cn:/lw-tangentspacelightingtest
unity-tech-cn:/Lux-for-HDRI
unity-tech-cn:/HDRP_GraphicTests
unity-tech-cn:/projects-system-shock-2018.1
unity-tech-cn:/Change-cluster-Tile-to-dynamic-branch
unity-tech-cn:/Reduce-shader-variant
unity-tech-cn:/lw-shadow-optimization
unity-tech-cn:/LW-DistortionPass
unity-tech-cn:/lw-shader-optimization
unity-tech-cn:/Branch_RemoveCascadeBordersInUI
unity-tech-cn:/Branch_EnableLastSplitFade
unity-tech-cn:/Branch_DebugExposure
unity-tech-cn:/Documentation
unity-tech-cn:/lw-bugfixes
unity-tech-cn:/Branch_DebugExposure2
unity-tech-cn:/Branch_DebugWindowFix
unity-tech-cn:/lw-shadow-keyword
unity-tech-cn:/backport-shader-optimization
unity-tech-cn:/tag-1.1.4-preview
unity-tech-cn:/StackLitWork
unity-tech-cn:/tag-1.1.5-preview
unity-tech-cn:/tag-1.1.6-preview
unity-tech-cn:/stacklit
unity-tech-cn:/StackLit2
unity-tech-cn:/hdrp-staging
拉取从: unity-tech-cn:Add-physical-light-unity-support
unity-tech-cn:/main
unity-tech-cn:/scriptablerenderloop-materialgraph
unity-tech-cn:/batch_rendering
unity-tech-cn:/vr_sandbox
unity-tech-cn:/Branch_Batching2
unity-tech-cn:/mikko-renderpass
unity-tech-cn:/fptl_cleanup
unity-tech-cn:/vr_fptl_sandbox
unity-tech-cn:/Branch_batcher
unity-tech-cn:/MobileDeferredRenderPass
unity-tech-cn:/vr_api_testbed
unity-tech-cn:/RenderPassXR_Sandbox
unity-tech-cn:/classicDeferredMobile
unity-tech-cn:/EnableVulkanAndES3
unity-tech-cn:/OnTileRenderPass2
unity-tech-cn:/sample_game
unity-tech-cn:/culling
unity-tech-cn:/OTDRP-develop
unity-tech-cn:/Add-support-for-light-specular-color-tint
unity-tech-cn:/stochastic_alpha_test
unity-tech-cn:/Yibing-Project-2
unity-tech-cn:/xr-hdrp-rt-test
unity-tech-cn:/system-shock-transitional-shader
unity-tech-cn:/feature-runtimeTextureCache
unity-tech-cn:/shader-library-include-paths
unity-tech-cn:/asmdef
unity-tech-cn:/namespace
unity-tech-cn:/feature-ReflectionProbeFit
unity-tech-cn:/prototype-decals
unity-tech-cn:/DrawSettings
unity-tech-cn:/projects-TheLastStand
unity-tech-cn:/iridesence
unity-tech-cn:/lw-nolightlist
unity-tech-cn:/Add-physical-light-unity-support
unity-tech-cn:/LightweightPipelineExperimental
unity-tech-cn:/switch_support
unity-tech-cn:/feature-ScreenSpaceProjection
unity-tech-cn:/use-roughness
unity-tech-cn:/LW-BakedIndirect
unity-tech-cn:/Branch_FixObjectMotion
unity-tech-cn:/srp_batcher
unity-tech-cn:/LW-LightOptimizations
unity-tech-cn:/Branch_ScriptableCulling
unity-tech-cn:/LW-LowEnd
unity-tech-cn:/feature-ReflectionProbeBaking
unity-tech-cn:/Improve-shader-generator
unity-tech-cn:/improve-shader-generator-data
unity-tech-cn:/2018.1
unity-tech-cn:/lwr-xr-shader-fixes-sandbox
unity-tech-cn:/uifoldout-fix
unity-tech-cn:/lw-callbacktests
unity-tech-cn:/lwrp-xr-sssm-DrawProc
unity-tech-cn:/lwrp-xr-tim-hacks
unity-tech-cn:/ss3HDRP
unity-tech-cn:/build-automation
unity-tech-cn:/HDRP_SurfaceShader
unity-tech-cn:/tag-1.1.0-beta
unity-tech-cn:/xr-hdrp-pyramids
unity-tech-cn:/lw-bias_per_cascade
unity-tech-cn:/040SimpleLighting
unity-tech-cn:/lw-tangentspacelightingtest
unity-tech-cn:/Lux-for-HDRI
unity-tech-cn:/HDRP_GraphicTests
unity-tech-cn:/projects-system-shock-2018.1
unity-tech-cn:/Change-cluster-Tile-to-dynamic-branch
unity-tech-cn:/Reduce-shader-variant
unity-tech-cn:/lw-shadow-optimization
unity-tech-cn:/LW-DistortionPass
unity-tech-cn:/lw-shader-optimization
unity-tech-cn:/Branch_RemoveCascadeBordersInUI
unity-tech-cn:/Branch_EnableLastSplitFade
unity-tech-cn:/Branch_DebugExposure
unity-tech-cn:/Documentation
unity-tech-cn:/lw-bugfixes
unity-tech-cn:/Branch_DebugExposure2
unity-tech-cn:/Branch_DebugWindowFix
unity-tech-cn:/lw-shadow-keyword
unity-tech-cn:/backport-shader-optimization
unity-tech-cn:/tag-1.1.4-preview
unity-tech-cn:/StackLitWork
unity-tech-cn:/tag-1.1.5-preview
unity-tech-cn:/tag-1.1.6-preview
unity-tech-cn:/stacklit
unity-tech-cn:/StackLit2
unity-tech-cn:/hdrp-staging
此合并请求有变更与目标分支冲突。
/ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/HDLightEditor.Styles.cs
/ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/HDLightEditor.cs
/ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/HDAdditionalLightData.cs
/ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightUtils.cs
/ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightUtils.cs.meta
3 次代码提交
作者 | SHA1 | 备注 | 提交日期 |
---|---|---|---|
sebastienlagarde | 5a41c4fd | draft | 7 年前 |
sebastienlagarde | eae8ba2b | Merge remote-tracking branch 'refs/remotes/origin/master' into Add-physical-light-unity-support | 7 年前 |
sebastienlagarde | 8324b5e9 | Merge remote-tracking branch 'refs/remotes/origin/master' into Add-physical-light-unity-support | 7 年前 |
共有 5 个文件被更改,包括 103 次插入 和 6 次删除
-
1ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/HDLightEditor.Styles.cs
-
29ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/HDLightEditor.cs
-
13ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/HDAdditionalLightData.cs
-
55ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightUtils.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightUtils.cs.meta
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
|
|||
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|||
{ |
|||
public class LightUtils |
|||
{ |
|||
// Physical light unit helper
|
|||
// All light unit are in lumens (Luminous power) and convert to cd/(m^2*steradian) (luminance)
|
|||
// For an area light it is (Luminous Power / (Area * PI * steradian))
|
|||
// In the case of a punctual light, there is no area, so theoretically it is Candela but math are the same
|
|||
|
|||
// Note: area light calculation is done in Luminance, but punctual light calculation should be done in luminous intensity (Candela)
|
|||
// Math are identical, so no need to make a distinction here, the conversion handle it.
|
|||
// No change to shader code is required
|
|||
|
|||
public static float ConvertPointLightIntensity(float intensity) |
|||
{ |
|||
return intensity / (4.0f * Mathf.PI); |
|||
} |
|||
|
|||
// angle is the full angle, not the half angle in radiant
|
|||
public static float ConvertSpotLightIntensity(float intensity, float angle, bool exact) |
|||
{ |
|||
return exact ? intensity / (2.0f * (1.0f - Mathf.Cos(angle / 2.0f)) * Mathf.PI) : intensity / Mathf.PI; |
|||
} |
|||
|
|||
// angleA and angleB are the full opening angle, not half angle
|
|||
public static float ConvertFrustrumLightIntensity(float intensity, float angleA, float angleB) |
|||
{ |
|||
return intensity / (4.0f * Mathf.Asin(Mathf.Sin(angleA / 2.0f) * Mathf.Sin(angleB / 2.0f))); |
|||
} |
|||
|
|||
public static float ConvertSphereLightIntensity(float intensity, float sphereRadius) |
|||
{ |
|||
return intensity / (4.0f * Mathf.PI * sphereRadius * sphereRadius * Mathf.PI * Mathf.PI); |
|||
} |
|||
|
|||
public static float ConvertDiscLightIntensity(float intensity, float discRadius) |
|||
{ |
|||
return intensity / (discRadius * discRadius * Mathf.PI * Mathf.PI); |
|||
} |
|||
|
|||
public static float ConvertRectLightIntensity(float intensity, float width, float height) |
|||
{ |
|||
return intensity / (width * height * Mathf.PI); |
|||
} |
|||
|
|||
public static float calculateLineLightArea(float intensity, float lineRadius, float lineWidth) |
|||
{ |
|||
return intensity / (2.0f * Mathf.PI * lineRadius * lineWidth * Mathf.PI); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 130051a9e68edfe40ba94d4098cba040 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue