sebastienlagarde
7 年前
当前提交
6c870111
共有 88 个文件被更改,包括 2271 次插入 和 910 次删除
-
61TestProjects/GraphicsTests/Packages/manifest.json
-
49TestProjects/LWGraphicsTest/Packages/manifest.json
-
57TestProjects/ShaderGraph/Packages/manifest.json
-
13com.unity.render-pipelines.core/CoreRP/Debugging/MousePositionDebug.cs
-
205com.unity.render-pipelines.core/CoreRP/Editor/CoreEditorUtils.cs
-
13com.unity.render-pipelines.core/CoreRP/Utilities/CoreUtils.cs
-
28com.unity.render-pipelines.high-definition/CHANGELOG.md
-
103com.unity.render-pipelines.high-definition/HDRP/Editor/BuildProcessors/HDRPreprocessShaders.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/HDLightEditor.Styles.cs
-
18com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/ReflectionMenuItem.cs
-
14com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/HDEditorUtils.cs
-
16com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/HDRenderPipelineMenuItems.cs
-
22com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/RenderPipelineSettingsUI.cs
-
3com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/Settings/SerializedRenderPipelineSettings.cs
-
105com.unity.render-pipelines.high-definition/HDRP/Editor/ShaderGraph/HDPBRPass.template
-
342com.unity.render-pipelines.high-definition/HDRP/Editor/ShaderGraph/HDPBRSubShader.cs
-
226com.unity.render-pipelines.high-definition/HDRP/Editor/ShaderGraph/HDSubShaderUtilities.cs
-
94com.unity.render-pipelines.high-definition/HDRP/Editor/ShaderGraph/HDUnlitPassForward.template
-
262com.unity.render-pipelines.high-definition/HDRP/Editor/ShaderGraph/HDUnlitSubShader.cs
-
13com.unity.render-pipelines.high-definition/HDRP/Editor/Upgraders/HDRPVersion.cs
-
14com.unity.render-pipelines.high-definition/HDRP/Editor/Upgraders/UpgradeMenuItem.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Material/LayeredLit/LayeredLit.shader
-
2com.unity.render-pipelines.high-definition/HDRP/Material/LayeredLit/LayeredLitData.hlsl
-
2com.unity.render-pipelines.high-definition/HDRP/Material/LayeredLit/LayeredLitTessellation.shader
-
39com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.hlsl
-
2com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.shader
-
2com.unity.render-pipelines.high-definition/HDRP/Material/Lit/LitTessellation.shader
-
23com.unity.render-pipelines.high-definition/HDRP/Material/StackLit/StackLit.shader
-
4com.unity.render-pipelines.high-definition/HDRP/Material/StackLit/StackLitProperties.hlsl
-
2com.unity.render-pipelines.high-definition/HDRP/Material/Unlit/Unlit.shader
-
26com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDRenderPipeline.cs
-
1com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/Settings/RenderPipelineSettings.cs
-
12com.unity.render-pipelines.high-definition/HDRP/ShaderPass/ShaderPassVelocity.hlsl
-
4com.unity.render-pipelines.high-definition/HDRP/ShaderPass/VertMesh.hlsl
-
58com.unity.render-pipelines.lightweight/LWRP/Editor/LightweightLightEditor.cs
-
16com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGraph/LightWeightPBRSubShader.cs
-
16com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGraph/LightWeightUnlitSubShader.cs
-
14com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGraph/lightweightPBRExtraPasses.template
-
13com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGraph/lightweightPBRForwardPass.template
-
14com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGraph/lightweightUnlitExtraPasses.template
-
13com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGraph/lightweightUnlitPass.template
-
38com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderPreprocessor.cs
-
28com.unity.render-pipelines.lightweight/LWRP/LightweightForwardRenderer.cs
-
4com.unity.render-pipelines.lightweight/LWRP/LightweightPipeline.cs
-
30com.unity.render-pipelines.lightweight/LWRP/LightweightPipelineCore.cs
-
3com.unity.render-pipelines.lightweight/LWRP/Passes/DepthOnlyPass.cs
-
3com.unity.render-pipelines.lightweight/LWRP/Passes/DirectionalShadowsPass.cs
-
49com.unity.render-pipelines.lightweight/LWRP/Passes/ForwardLitPass.cs
-
3com.unity.render-pipelines.lightweight/LWRP/Passes/LocalShadowsPass.cs
-
11com.unity.render-pipelines.lightweight/LWRP/Passes/ScreenSpaceShadowResolvePass.cs
-
4com.unity.render-pipelines.lightweight/LWRP/Passes/ScriptableRenderPass.cs
-
3com.unity.render-pipelines.lightweight/LWRP/Shaders/LightweightScreenSpaceShadows.shader
-
30com.unity.shadergraph/CHANGELOG.md
-
55com.unity.shadergraph/Editor/Data/Graphs/PreviewProperty.cs
-
8com.unity.shadergraph/Editor/Data/Graphs/ShaderGraphRequirements.cs
-
14com.unity.shadergraph/Editor/Data/Nodes/Procedural/CheckerboardNode.cs
-
69com.unity.shadergraph/Editor/Data/Util/GraphUtil.cs
-
16com.unity.shadergraph/Editor/Data/Util/ShaderGenerator.cs
-
1com.unity.shadergraph/Editor/Data/Util/ShaderGeneratorNames.cs
-
1com.unity.shadergraph/Editor/Drawing/Views/MaterialNodeView.cs
-
52com.unity.shadergraph/Editor/Importers/ShaderGraphImporter.cs
-
8com.unity.render-pipelines.core/CoreRP/Editor/Shadow.meta
-
143com.unity.render-pipelines.high-definition/CHANGELOG.md.orig
-
77com.unity.render-pipelines.high-definition/HDRP/Editor/Material/BaseShaderPreprocessor.cs
-
11com.unity.render-pipelines.high-definition/HDRP/Editor/Material/BaseShaderPreprocessor.cs.meta
-
69com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Lit/LitShaderPreprocessor.cs
-
11com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Lit/LitShaderPreprocessor.cs.meta
-
23com.unity.render-pipelines.high-definition/HDRP/Editor/Material/StackLit/StackLitShaderPreprocessor.cs
-
11com.unity.render-pipelines.high-definition/HDRP/Editor/Material/StackLit/StackLitShaderPreprocessor.cs.meta
-
23com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Unlit/UnlitShaderPreprocessor.cs
-
11com.unity.render-pipelines.high-definition/HDRP/Editor/Material/Unlit/UnlitShaderPreprocessor.cs.meta
-
3com.unity.shadergraph/.data/face_sign.png
-
3com.unity.shadergraph/.data/hd_render_pipeline.png
-
3com.unity.shadergraph/.data/texture_2d_lod_node.PNG
-
3com.unity.shadergraph/.data/texture_nodes.png
-
3com.unity.shadergraph/.data/vertex_position.png
-
18com.unity.shadergraph/Editor/Data/Interfaces/IMayRequireFaceSign.cs
-
3com.unity.shadergraph/Editor/Data/Interfaces/IMayRequireFaceSign.cs.meta
-
120com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DLODNode.cs
-
11com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DLODNode.cs.meta
-
41com.unity.shadergraph/Editor/Data/Nodes/Utility/Logic/IsFrontFaceNode.cs
-
11com.unity.shadergraph/Editor/Data/Nodes/Utility/Logic/IsFrontFaceNode.cs.meta
-
214com.unity.render-pipelines.core/CoreRP/Editor/Shadow/ShadowCascadeSplitGUI.cs
-
11com.unity.render-pipelines.core/CoreRP/Editor/Shadow/ShadowCascadeSplitGUI.cs.meta
-
1TestProjects/GraphicsTests/ProjectSettings/ProjectVersion.txt
-
1TestProjects/LWGraphicsTest/ProjectSettings/ProjectVersion.txt
-
1TestProjects/ShaderGraph/ProjectSettings/ProjectVersion.txt
|
|||
{ |
|||
"dependencies": { |
|||
"com.unity.postprocessing": "file:../../../com.unity.postprocessing", |
|||
"com.unity.render-pipelines.core": "file:../../../com.unity.render-pipelines.core", |
|||
"com.unity.shadergraph": "file:../../../com.unity.shadergraph", |
|||
"com.unity.render-pipelines.high-definition": "file:../../../com.unity.render-pipelines.high-definition", |
|||
"com.unity.render-pipelines.lightweight": "file:../../../com.unity.render-pipelines.lightweight" |
|||
}, |
|||
"testables": [ |
|||
"com.unity.render-pipelines.core", |
|||
"com.unity.render-pipelines.high-definition", |
|||
"com.unity.render-pipelines.lightweight" |
|||
] |
|||
"dependencies": { |
|||
"com.unity.ads": "2.0.8", |
|||
"com.unity.analytics": "2.0.16", |
|||
"com.unity.collab-proxy": "1.2.4-preview", |
|||
"com.unity.package-manager-ui": "2.0.0-preview.2", |
|||
"com.unity.postprocessing": "file:../../../com.unity.postprocessing", |
|||
"com.unity.purchasing": "2.0.1", |
|||
"com.unity.render-pipelines.core": "file:../../../com.unity.render-pipelines.core", |
|||
"com.unity.render-pipelines.high-definition": "file:../../../com.unity.render-pipelines.high-definition", |
|||
"com.unity.render-pipelines.lightweight": "file:../../../com.unity.render-pipelines.lightweight", |
|||
"com.unity.shadergraph": "file:../../../com.unity.shadergraph", |
|||
"com.unity.standardevents": "1.0.13", |
|||
"com.unity.textmeshpro": "1.2.1", |
|||
"com.unity.modules.ai": "1.0.0", |
|||
"com.unity.modules.animation": "1.0.0", |
|||
"com.unity.modules.assetbundle": "1.0.0", |
|||
"com.unity.modules.audio": "1.0.0", |
|||
"com.unity.modules.cloth": "1.0.0", |
|||
"com.unity.modules.director": "1.0.0", |
|||
"com.unity.modules.imageconversion": "1.0.0", |
|||
"com.unity.modules.imgui": "1.0.0", |
|||
"com.unity.modules.jsonserialize": "1.0.0", |
|||
"com.unity.modules.particlesystem": "1.0.0", |
|||
"com.unity.modules.physics": "1.0.0", |
|||
"com.unity.modules.physics2d": "1.0.0", |
|||
"com.unity.modules.screencapture": "1.0.0", |
|||
"com.unity.modules.terrain": "1.0.0", |
|||
"com.unity.modules.terrainphysics": "1.0.0", |
|||
"com.unity.modules.tilemap": "1.0.0", |
|||
"com.unity.modules.ui": "1.0.0", |
|||
"com.unity.modules.uielements": "1.0.0", |
|||
"com.unity.modules.umbra": "1.0.0", |
|||
"com.unity.modules.unityanalytics": "1.0.0", |
|||
"com.unity.modules.unitywebrequest": "1.0.0", |
|||
"com.unity.modules.unitywebrequestassetbundle": "1.0.0", |
|||
"com.unity.modules.unitywebrequestaudio": "1.0.0", |
|||
"com.unity.modules.unitywebrequesttexture": "1.0.0", |
|||
"com.unity.modules.unitywebrequestwww": "1.0.0", |
|||
"com.unity.modules.vehicles": "1.0.0", |
|||
"com.unity.modules.video": "1.0.0", |
|||
"com.unity.modules.vr": "1.0.0", |
|||
"com.unity.modules.wind": "1.0.0", |
|||
"com.unity.modules.xr": "1.0.0" |
|||
}, |
|||
"testables": [ |
|||
"com.unity.render-pipelines.core", |
|||
"com.unity.render-pipelines.high-definition", |
|||
"com.unity.render-pipelines.lightweight" |
|||
] |
|||
} |
|
|||
{ |
|||
"dependencies": { |
|||
"com.unity.postprocessing": "file:../../../com.unity.postprocessing", |
|||
"com.unity.render-pipelines.core": "file:../../../com.unity.render-pipelines.core", |
|||
"com.unity.shadergraph": "file:../../../com.unity.shadergraph", |
|||
"com.unity.render-pipelines.lightweight": "file:../../../com.unity.render-pipelines.lightweight" |
|||
} |
|||
"dependencies": { |
|||
"com.unity.ads": "2.0.8", |
|||
"com.unity.analytics": "2.0.16", |
|||
"com.unity.collab-proxy": "1.2.4-preview", |
|||
"com.unity.package-manager-ui": "2.0.0-preview.2", |
|||
"com.unity.postprocessing": "file:../../../com.unity.postprocessing", |
|||
"com.unity.purchasing": "2.0.1", |
|||
"com.unity.render-pipelines.core": "file:../../../com.unity.render-pipelines.core", |
|||
"com.unity.render-pipelines.lightweight": "file:../../../com.unity.render-pipelines.lightweight", |
|||
"com.unity.shadergraph": "file:../../../com.unity.shadergraph", |
|||
"com.unity.standardevents": "1.0.13", |
|||
"com.unity.textmeshpro": "1.2.1", |
|||
"com.unity.modules.ai": "1.0.0", |
|||
"com.unity.modules.animation": "1.0.0", |
|||
"com.unity.modules.assetbundle": "1.0.0", |
|||
"com.unity.modules.audio": "1.0.0", |
|||
"com.unity.modules.cloth": "1.0.0", |
|||
"com.unity.modules.director": "1.0.0", |
|||
"com.unity.modules.imageconversion": "1.0.0", |
|||
"com.unity.modules.imgui": "1.0.0", |
|||
"com.unity.modules.jsonserialize": "1.0.0", |
|||
"com.unity.modules.particlesystem": "1.0.0", |
|||
"com.unity.modules.physics": "1.0.0", |
|||
"com.unity.modules.physics2d": "1.0.0", |
|||
"com.unity.modules.screencapture": "1.0.0", |
|||
"com.unity.modules.terrain": "1.0.0", |
|||
"com.unity.modules.terrainphysics": "1.0.0", |
|||
"com.unity.modules.tilemap": "1.0.0", |
|||
"com.unity.modules.ui": "1.0.0", |
|||
"com.unity.modules.uielements": "1.0.0", |
|||
"com.unity.modules.umbra": "1.0.0", |
|||
"com.unity.modules.unityanalytics": "1.0.0", |
|||
"com.unity.modules.unitywebrequest": "1.0.0", |
|||
"com.unity.modules.unitywebrequestassetbundle": "1.0.0", |
|||
"com.unity.modules.unitywebrequestaudio": "1.0.0", |
|||
"com.unity.modules.unitywebrequesttexture": "1.0.0", |
|||
"com.unity.modules.unitywebrequestwww": "1.0.0", |
|||
"com.unity.modules.vehicles": "1.0.0", |
|||
"com.unity.modules.video": "1.0.0", |
|||
"com.unity.modules.vr": "1.0.0", |
|||
"com.unity.modules.wind": "1.0.0", |
|||
"com.unity.modules.xr": "1.0.0" |
|||
} |
|||
} |
|
|||
{ |
|||
"dependencies": { |
|||
"com.unity.postprocessing": "file:../../../com.unity.postprocessing", |
|||
"com.unity.render-pipelines.core": "file:../../../com.unity.render-pipelines.core", |
|||
"com.unity.shadergraph": "file:../../../com.unity.shadergraph", |
|||
"com.unity.render-pipelines.high-definition": "file:../../../com.unity.render-pipelines.high-definition", |
|||
"com.unity.render-pipelines.lightweight": "file:../../../com.unity.render-pipelines.lightweight" |
|||
}, |
|||
"testables": [ |
|||
"com.unity.render-pipelines.shadergraph" |
|||
] |
|||
"dependencies": { |
|||
"com.unity.ads": "2.0.8", |
|||
"com.unity.analytics": "2.0.16", |
|||
"com.unity.collab-proxy": "1.2.4-preview", |
|||
"com.unity.package-manager-ui": "2.0.0-preview.2", |
|||
"com.unity.postprocessing": "file:../../../com.unity.postprocessing", |
|||
"com.unity.purchasing": "2.0.1", |
|||
"com.unity.render-pipelines.core": "file:../../../com.unity.render-pipelines.core", |
|||
"com.unity.render-pipelines.high-definition": "file:../../../com.unity.render-pipelines.high-definition", |
|||
"com.unity.render-pipelines.lightweight": "file:../../../com.unity.render-pipelines.lightweight", |
|||
"com.unity.shadergraph": "file:../../../com.unity.shadergraph", |
|||
"com.unity.standardevents": "1.0.13", |
|||
"com.unity.textmeshpro": "1.2.1", |
|||
"com.unity.modules.ai": "1.0.0", |
|||
"com.unity.modules.animation": "1.0.0", |
|||
"com.unity.modules.assetbundle": "1.0.0", |
|||
"com.unity.modules.audio": "1.0.0", |
|||
"com.unity.modules.cloth": "1.0.0", |
|||
"com.unity.modules.director": "1.0.0", |
|||
"com.unity.modules.imageconversion": "1.0.0", |
|||
"com.unity.modules.imgui": "1.0.0", |
|||
"com.unity.modules.jsonserialize": "1.0.0", |
|||
"com.unity.modules.particlesystem": "1.0.0", |
|||
"com.unity.modules.physics": "1.0.0", |
|||
"com.unity.modules.physics2d": "1.0.0", |
|||
"com.unity.modules.screencapture": "1.0.0", |
|||
"com.unity.modules.terrain": "1.0.0", |
|||
"com.unity.modules.terrainphysics": "1.0.0", |
|||
"com.unity.modules.tilemap": "1.0.0", |
|||
"com.unity.modules.ui": "1.0.0", |
|||
"com.unity.modules.uielements": "1.0.0", |
|||
"com.unity.modules.umbra": "1.0.0", |
|||
"com.unity.modules.unityanalytics": "1.0.0", |
|||
"com.unity.modules.unitywebrequest": "1.0.0", |
|||
"com.unity.modules.unitywebrequestassetbundle": "1.0.0", |
|||
"com.unity.modules.unitywebrequestaudio": "1.0.0", |
|||
"com.unity.modules.unitywebrequesttexture": "1.0.0", |
|||
"com.unity.modules.unitywebrequestwww": "1.0.0", |
|||
"com.unity.modules.vehicles": "1.0.0", |
|||
"com.unity.modules.video": "1.0.0", |
|||
"com.unity.modules.vr": "1.0.0", |
|||
"com.unity.modules.wind": "1.0.0", |
|||
"com.unity.modules.xr": "1.0.0" |
|||
}, |
|||
"testables": [ |
|||
"com.unity.render-pipelines.shadergraph" |
|||
] |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 61ef33a54404cb747aad57d04e535154 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
|
|||
# Changelog |
|||
|
|||
## [2018.3] |
|||
|
|||
### Improvements |
|||
|
|||
### Changed, Removals and deprecations |
|||
|
|||
### Bug fixes |
|||
|
|||
## [2018.2 / next ] |
|||
- Add Light -> Planar Reflection Probe command |
|||
|
|||
### Improvements |
|||
|
|||
### Changed, Removals and deprecations |
|||
- Change Render -> Planar Reflection creation to 3D Object -> Mirror |
|||
- Change "Enable Reflector" name on SpotLight to "Angle Affect Intensity" |
|||
|
|||
### Bug fixes |
|||
|
|||
## [2018.2 / 2.0.1-preview] |
|||
|
|||
### Improvements |
|||
- Add stripper of shader variant when building a player. Save shader compile time. |
|||
- Disable per-object culling that was executed in C++ in HD whereas it was not used (Optimization) |
|||
- Enable texture streaming debugging (was not working before 2018.2) |
|||
- Added Screen Space Reflection with Proxy Projection Model |
|||
- Support correctly scene selection for alpha tested object |
|||
- Add per light shadow mask mode control (i.e shadow mask distance and shadow mask). It use the option NonLightmappedOnly |
|||
- Add geometric filtering to Lit shader (allow to reduce specular aliasing) |
|||
- Allow to double click on a render pipeline asset to setup it automatically in GraphicSettings |
|||
- Add shortcut to create DensityVolume and PlanarReflection in hierarchy |
|||
- Add a DefaultHDMirrorMaterial material for PlanarReflection |
|||
- Added a script to be able to upgrade material to newer version of HDRP |
|||
<<<<<<< HEAD |
|||
- Added a false color mode in rendering debug |
|||
======= |
|||
- Removed useless duplication of ForwardError passes. |
|||
- Add option to not compile any DEBUG_DISPLAY shader in the player (Faster build) call Support Runtime Debug display |
|||
>>>>>>> master |
|||
|
|||
### Changed, Removals and deprecations |
|||
- Removed GlobalLightLoopSettings.maxPlanarReflectionProbes and instead use value of GlobalLightLoopSettings.planarReflectionProbeCacheSize |
|||
- Changed SupportForwardOnly to SupportOnlyForward in render pipeline settings |
|||
- Remove EmissiveIntensity parameter and change EmissiveColor to be HDR (Matching Builtin Unity behavior) - Data need to be updated - Launch Edit -> Single Step Upgrade Script -> Upgrade all Materials emissionColor |
|||
- Changed versioning variable name in HDAdditionalXXXData from m_version to version |
|||
- Create unique name when creating a game object in the rendering menu (i.e Density Volume(2)) |
|||
- Re-organize various files and folder location to clean the repository |
|||
- Change Debug windows name and location. Now located at: Windows -> General -> Render Pipeline Debug |
|||
|
|||
### Bug fixes |
|||
- Fix issue with LOD transition and instancing |
|||
- Fix discrepency between object motion vector and camera motion vector |
|||
- Fix issue with spot and dir light gizmo axis not highlighted correctly |
|||
- Fix potential crash while register debug windows inputs at startup |
|||
- Fix warning when creating Planar reflection |
|||
- Fix specular lighting debug mode (was rendering black) |
|||
- Allow projector decal with null material to allow to configure decal when HDRP is not set |
|||
|
|||
## [2018.1 undecided] |
|||
|
|||
### Improvements |
|||
- Configure the VolumetricLightingSystem code path to be on by default |
|||
- Trigger a build exception when trying to build an unsupported platform |
|||
- Introduce the VolumetricLightingController component, which can (and should) be placed on the camera, and allows one to control the near and the far plane of the V-Buffer (volumetric "froxel" buffer) along with the depth distribution (from logarithmic to linear) |
|||
- Add 3D texture support for DensityVolumes |
|||
- Add a better mapping of roughness to mipmap for planar reflection |
|||
- The VolumetricLightingSystem now uses RTHandles, which allows to save memory by sharing buffers between different cameras (history buffers are not shared), and reduce reallocation frequency by reallocating buffers only if the rendering resolution increases (and suballocating within existing buffers if the rendering resolution decreases) |
|||
- Add a Volumetric Dimmer slider to lights to control the intensity of the scattered volumetric lighting |
|||
- Add UV tiling and offset support for decals. |
|||
- Add mipmapping support for volume 3D mask textures |
|||
|
|||
### Changed, Removals and deprecations |
|||
- Remove Resource folder of PreIntegratedFGD and add the resource to RenderPipeline Asset |
|||
- Default number of planar reflection change from 4 to 2 |
|||
- Rename _MainDepthTexture to _CameraDepthTexture |
|||
- The VolumetricLightingController has been moved to the Interpolation Volume framework and now functions similarly to the VolumetricFog settings |
|||
- Update of UI of cookie, CubeCookie, Reflection probe and planar reflection probe to combo box |
|||
- Allow enabling/disabling shadows for area lights when they are set to baked. |
|||
- Hide applyRangeAttenuation and FadeDistance for directional shadow as they are not used |
|||
|
|||
### Bug fixes |
|||
- Fix ConvertPhysicalLightIntensityToLightIntensity() function used when creating light from script to match HDLightEditor behavior |
|||
- Fix numerical issues with the default value of mean free path of volumetric fog |
|||
- Fix the bug preventing decals from coexisting with density volumes |
|||
- Fix issue with alpha tested geometry using planar/triplanar mapping not render correctly or flickering (due to being wrongly alpha tested in depth prepass) |
|||
- Fix meta pass with triplanar (was not handling correctly the normal) |
|||
- Fix preview when a planar reflection is present |
|||
- Fix Camera preview, it is now a Preview cameraType (was a SceneView) |
|||
- Fix handling unknown GPUShadowTypes in the shadow manager. |
|||
- Fix area light shapes sent as point lights to the baking backends when they are set to baked. |
|||
- Fix unnecessary division by PI for baked area lights. |
|||
- Fix line lights sent to the lightmappers. The backends don't support this light type. |
|||
- Fix issue with shadow mask framesettings not correctly taken into account when shadow mask is enabled for lighting. |
|||
- Fix directional light and shadow mask transition, they are now matching making smooth transition |
|||
- Fix banding issues caused by high intensity volumetric lighting |
|||
- Fix the debug window being emptied on SRP asset reload |
|||
- Fix issue with debug mode not correctly clearing the GBuffer in editor after a resize |
|||
- Fix issue with ResetMaterialKeyword not resetting correctly ToggleOff/Roggle Keyword |
|||
- Fix issue with motion vector not render correctly if there is no depth prepass in deferred |
|||
|
|||
## [2018.1.0f2] |
|||
|
|||
### Improvements |
|||
- Screen Space Refraction projection model (Proxy raycasting, HiZ raymarching) |
|||
- Screen Space Refraction settings as volume component |
|||
- Added buffered frame history per camera |
|||
- Port Global Density Volumes to the Interpolation Volume System. |
|||
- Optimize ImportanceSampleLambert() to not require the tangent frame. |
|||
- Generalize SampleVBuffer() to handle different sampling and reconstruction methods. |
|||
- Improve the quality of volumetric lighting reprojection. |
|||
- Optimize Morton Order code in the Subsurface Scattering pass. |
|||
- Planar Reflection Probe support roughness (gaussian convolution of captured probe) |
|||
- Use an atlas instead of a texture array for cluster transparent decals |
|||
- Add a debug view to visualize the decal atlas |
|||
- Only store decal textures to atlas if decal is visible, debounce out of memory decal atlas warning. |
|||
- Add manipulator gizmo on decal to improve authoring workflow |
|||
- Add a minimal StackLit material (work in progress, this version can be used as template to add new material) |
|||
|
|||
### Changed, Removals and deprecations |
|||
- EnableShadowMask in FrameSettings (But shadowMaskSupport still disable by default) |
|||
- Forced Planar Probe update modes to (Realtime, Every Update, Mirror Camera) |
|||
- Removed Planar Probe mirror plane position and normal fields in inspector, always display mirror plane and normal gizmos |
|||
- Screen Space Refraction proxy model uses the proxy of the first environment light (Reflection probe/Planar probe) or the sky |
|||
- Moved RTHandle static methods to RTHandles |
|||
- Renamed RTHandle to RTHandleSystem.RTHandle |
|||
- Move code for PreIntegratedFDG (Lit.shader) into its dedicated folder to be share with other material |
|||
- Move code for LTCArea (Lit.shader) into its dedicated folder to be share with other material |
|||
|
|||
### Bug fixes |
|||
- Fix fog flags in scene view is now taken into account |
|||
- Fix sky in preview windows that were disappearing after a load of a new level |
|||
- Fix numerical issues in IntersectRayAABB(). |
|||
- Fix alpha blending of volumetric lighting with transparent objects. |
|||
- Fix the near plane of the V-Buffer causing out-of-bounds look-ups in the clustered data structure. |
|||
- Depth and color pyramid are properly computed and sampled when the camera renders inside a viewport of a RTHandle. |
|||
- Fix decal atlas debug view to work correctly when shadow atlas view is also enabled |
|||
|
|||
## [2018.1.0b13] |
|||
|
|||
... |
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using UnityEditor.Build; |
|||
using UnityEditor.Rendering; |
|||
using UnityEngine; |
|||
using UnityEngine.Rendering; |
|||
using UnityEngine.Experimental.Rendering.HDPipeline; |
|||
|
|||
namespace UnityEditor.Experimental.Rendering.HDPipeline |
|||
{ |
|||
// returns true if the variant should be stripped.
|
|||
public delegate bool VariantStrippingFunc(HDRenderPipelineAsset hdrpAsset, Shader shader, ShaderSnippetData snippet, ShaderCompilerData inputData); |
|||
|
|||
public class BaseShaderPreprocessor |
|||
{ |
|||
protected ShaderKeyword m_ShadowMask; |
|||
protected ShaderKeyword m_Transparent; |
|||
protected ShaderKeyword m_DebugDisplay; |
|||
protected ShaderKeyword m_TileLighting; |
|||
protected ShaderKeyword m_ClusterLighting; |
|||
|
|||
public BaseShaderPreprocessor() |
|||
{ |
|||
m_Transparent = new ShaderKeyword("_SURFACE_TYPE_TRANSPARENT"); |
|||
m_DebugDisplay = new ShaderKeyword("DEBUG_DISPLAY"); |
|||
m_TileLighting = new ShaderKeyword("USE_FPTL_LIGHTLIST"); |
|||
m_ClusterLighting = new ShaderKeyword("USE_CLUSTERED_LIGHTLIST"); |
|||
} |
|||
|
|||
public virtual void AddStripperFuncs(Dictionary<string, VariantStrippingFunc> stripperFuncs) {} |
|||
|
|||
// NOTE: All these keyword should be automatically stripped so there's no need to handle them ourselves.
|
|||
// LIGHTMAP_ON, DIRLIGHTMAP_COMBINED, DYNAMICLIGHTMAP_ON, LIGHTMAP_SHADOW_MIXING, SHADOWS_SHADOWMASK
|
|||
// FOG_LINEAR, FOG_EXP, FOG_EXP2
|
|||
// STEREO_INSTANCING_ON, STEREO_MULTIVIEW_ON, STEREO_CUBEMAP_RENDER_ON, UNITY_SINGLE_PASS_STEREO
|
|||
// INSTANCING_ON
|
|||
|
|||
// Several pass are common to all shader, let's share code here
|
|||
// This remove variant (return true) for:
|
|||
// - Scene Selection
|
|||
// - Motion vectors
|
|||
// - Tile pass for Transparent (not compatible)
|
|||
// -
|
|||
protected bool CommonShaderStripper(HDRenderPipelineAsset hdrpAsset, Shader shader, ShaderSnippetData snippet, ShaderCompilerData inputData) |
|||
{ |
|||
bool isSceneSelectionPass = snippet.passName == "SceneSelectionPass"; |
|||
if (isSceneSelectionPass) |
|||
return true; |
|||
|
|||
bool isMotionPass = snippet.passName == "Motion Vectors"; |
|||
if (!hdrpAsset.renderPipelineSettings.supportMotionVectors && isMotionPass) |
|||
return true; |
|||
|
|||
//bool isForwardPass = (snippet.passName == "Forward") || (snippet.passName == "ForwardOnly");
|
|||
|
|||
if (inputData.shaderKeywordSet.IsEnabled(m_Transparent)) |
|||
{ |
|||
// If we are transparent we use cluster lighting and not tile lighting
|
|||
if (inputData.shaderKeywordSet.IsEnabled(m_TileLighting)) |
|||
return true; |
|||
} |
|||
else // Opaque
|
|||
{ |
|||
// Note: we can't assume anything regarding tile/cluster for opaque as multiple view could used different settings and it depends on MSAA
|
|||
} |
|||
|
|||
// TODO: If static lighting we can remove meta pass, but how to know that?
|
|||
|
|||
// If we are in a release build, don't compile debug display variant
|
|||
// Also don't compile it if not requested by the render pipeline settings
|
|||
if ((/*!Debug.isDebugBuild || */ !hdrpAsset.renderPipelineSettings.supportRuntimeDebugDisplay) && inputData.shaderKeywordSet.IsEnabled(m_DebugDisplay)) |
|||
return true; |
|||
|
|||
return false; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: c23f3fe1f63fff240a5cf70cf0a62c93 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using UnityEditor.Build; |
|||
using UnityEditor.Rendering; |
|||
using UnityEngine; |
|||
using UnityEngine.Experimental.Rendering.HDPipeline; |
|||
|
|||
namespace UnityEditor.Experimental.Rendering.HDPipeline |
|||
{ |
|||
public class LitShaderPreprocessor : BaseShaderPreprocessor |
|||
{ |
|||
bool LitShaderStripper(HDRenderPipelineAsset hdrpAsset, Shader shader, ShaderSnippetData snippet, ShaderCompilerData inputData) |
|||
{ |
|||
if (CommonShaderStripper(hdrpAsset, shader, snippet, inputData)) |
|||
return true; |
|||
|
|||
bool isGBufferPass = snippet.passName == "GBuffer"; |
|||
bool isForwardPass = snippet.passName == "Forward"; |
|||
bool isTransparentForwardPass = snippet.passName == "TransparentDepthPostpass" || snippet.passName == "TransparentBackface" || snippet.passName == "TransparentDepthPrepass"; |
|||
|
|||
// When using forward only, we never need GBuffer pass (only Forward)
|
|||
if (hdrpAsset.renderPipelineSettings.supportOnlyForward && isGBufferPass) |
|||
return true; |
|||
|
|||
if (inputData.shaderKeywordSet.IsEnabled(m_Transparent)) |
|||
{ |
|||
// If transparent, we never need GBuffer pass.
|
|||
if (isGBufferPass) |
|||
return true; |
|||
} |
|||
else // Opaque
|
|||
{ |
|||
// If opaque, we never need transparent specific passes (even in forward only mode)
|
|||
if (isTransparentForwardPass) |
|||
return true; |
|||
|
|||
// When we are in deferred (i.e !hdrpAsset.renderPipelineSettings.supportOnlyForward), we only support tile lighting
|
|||
if (!hdrpAsset.renderPipelineSettings.supportOnlyForward && inputData.shaderKeywordSet.IsEnabled(m_ClusterLighting)) |
|||
return true; |
|||
|
|||
if (!hdrpAsset.renderPipelineSettings.supportOnlyForward) |
|||
{ |
|||
// If opaque and not forward only, then we only need the forward debug pass.
|
|||
if (isForwardPass && !inputData.shaderKeywordSet.IsEnabled(m_DebugDisplay)) |
|||
return true; |
|||
} |
|||
} |
|||
|
|||
// TODO: Tests for later
|
|||
// We need to find a way to strip useless shader features for passes/shader stages that don't need them (example, vertex shaders won't ever need SSS Feature flag)
|
|||
// This causes several problems:
|
|||
// - Runtime code that "finds" shader variants based on feature flags might not find them anymore... thus fall backing to the "let's give a score to variant" code path that may find the wrong variant.
|
|||
// - Another issue is that if a feature is declared without a "_" fall-back, if we strip the other variants, none may be left to use! This needs to be changed on our side.
|
|||
//if (snippet.shaderType == ShaderType.Vertex && inputData.shaderKeywordSet.IsEnabled(m_FeatureSSS))
|
|||
// return true;
|
|||
|
|||
return false; |
|||
} |
|||
|
|||
public override void AddStripperFuncs(Dictionary<string, VariantStrippingFunc> stripperFuncs) |
|||
{ |
|||
// Add name of the shader and corresponding delegate to call to strip variant
|
|||
stripperFuncs.Add("HDRenderPipeline/Lit", LitShaderStripper); |
|||
stripperFuncs.Add("HDRenderPipeline/LitTessellation", LitShaderStripper); |
|||
stripperFuncs.Add("HDRenderPipeline/LayeredLit", LitShaderStripper); |
|||
stripperFuncs.Add("HDRenderPipeline/LayeredLitTessellation", LitShaderStripper); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 203e4ecfbd605d54d89374ef35e914c0 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using UnityEditor.Build; |
|||
using UnityEditor.Rendering; |
|||
using UnityEngine; |
|||
using UnityEngine.Experimental.Rendering.HDPipeline; |
|||
|
|||
namespace UnityEditor.Experimental.Rendering.HDPipeline |
|||
{ |
|||
public class StackLitShaderPreprocessor : BaseShaderPreprocessor |
|||
{ |
|||
bool StackLitShaderStripper(HDRenderPipelineAsset hdrpAsset, Shader shader, ShaderSnippetData snippet, ShaderCompilerData inputData) |
|||
{ |
|||
return CommonShaderStripper(hdrpAsset, shader, snippet, inputData); |
|||
} |
|||
|
|||
public override void AddStripperFuncs(Dictionary<string, VariantStrippingFunc> stripperFuncs) |
|||
{ |
|||
// Add name of the shader and corresponding delegate to call to strip variant
|
|||
stripperFuncs.Add("HDRenderPipeline/StackLit", StackLitShaderStripper); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 238a7258cd3744f4c9d619f4355c3019 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using UnityEditor.Build; |
|||
using UnityEditor.Rendering; |
|||
using UnityEngine; |
|||
using UnityEngine.Experimental.Rendering.HDPipeline; |
|||
|
|||
namespace UnityEditor.Experimental.Rendering.HDPipeline |
|||
{ |
|||
public class UnlitShaderPreprocessor : BaseShaderPreprocessor |
|||
{ |
|||
bool UnlitShaderStripper(HDRenderPipelineAsset hdrpAsset, Shader shader, ShaderSnippetData snippet, ShaderCompilerData inputData) |
|||
{ |
|||
return CommonShaderStripper(hdrpAsset, shader, snippet, inputData); |
|||
} |
|||
|
|||
public override void AddStripperFuncs(Dictionary<string, VariantStrippingFunc> stripperFuncs) |
|||
{ |
|||
// Add name of the shader and corresponding delegate to call to strip variant
|
|||
stripperFuncs.Add("HDRenderPipeline/Unlit", UnlitShaderStripper); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: b9d6d9aeb9ea7a5449eb51aa059a75b8 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
version https://git-lfs.github.com/spec/v1 |
|||
oid sha256:056f160ee81fcdeb3f3a26a0116846de50b68bafa0c65db8731f5aca37ee74e7 |
|||
size 43759 |
|
|||
version https://git-lfs.github.com/spec/v1 |
|||
oid sha256:aff2679b3a603812e63290cea0829d6d354a94e02765513bb214faa4331adfdd |
|||
size 1516111 |
|
|||
version https://git-lfs.github.com/spec/v1 |
|||
oid sha256:b262d71d68d478f6b6c3dc3086451a764e065b8608a65104e17cb8aefefa5f76 |
|||
size 238646 |
|
|||
version https://git-lfs.github.com/spec/v1 |
|||
oid sha256:6e4d23f6b0f35ae888614f05c00c28ca5e064b03bf010159950acaf9e12366d5 |
|||
size 131836 |
|
|||
version https://git-lfs.github.com/spec/v1 |
|||
oid sha256:3ae6d830f7cff2331af0145171c3287021e8d31e64c97633b06c5155332ddbfe |
|||
size 395709 |
|
|||
using UnityEditor.Graphing; |
|||
|
|||
namespace UnityEditor.ShaderGraph |
|||
{ |
|||
public interface IMayRequireFaceSign |
|||
{ |
|||
bool RequiresFaceSign(ShaderStageCapability stageCapability = ShaderStageCapability.Fragment); |
|||
} |
|||
|
|||
public static class IMayRequireFaceSignExtensions |
|||
{ |
|||
public static bool RequiresFaceSign(this ISlot slot) |
|||
{ |
|||
var mayRequireFaceSign = slot as IMayRequireFaceSign; |
|||
return mayRequireFaceSign != null && mayRequireFaceSign.RequiresFaceSign(); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 23f5d9c2f1ec442a7b8c59e893a6724d |
|||
timeCreated: 1512469767 |
|
|||
using System.Linq; |
|||
using UnityEngine; |
|||
using UnityEditor.Graphing; |
|||
using UnityEditor.ShaderGraph.Drawing.Controls; |
|||
|
|||
namespace UnityEditor.ShaderGraph |
|||
{ |
|||
|
|||
[Title("Input", "Texture", "Sample Texture 2D LOD")] |
|||
public class SampleTexture2DLODNode : AbstractMaterialNode, IGeneratesBodyCode, IMayRequireMeshUV |
|||
{ |
|||
public const int OutputSlotRGBAId = 0; |
|||
public const int OutputSlotRId = 5; |
|||
public const int OutputSlotGId = 6; |
|||
public const int OutputSlotBId = 7; |
|||
public const int OutputSlotAId = 8; |
|||
public const int TextureInputId = 1; |
|||
public const int UVInput = 2; |
|||
public const int SamplerInput = 3; |
|||
public const int LODInput = 4; |
|||
|
|||
const string kOutputSlotRGBAName = "RGBA"; |
|||
const string kOutputSlotRName = "R"; |
|||
const string kOutputSlotGName = "G"; |
|||
const string kOutputSlotBName = "B"; |
|||
const string kOutputSlotAName = "A"; |
|||
const string kTextureInputName = "Texture"; |
|||
const string kUVInputName = "UV"; |
|||
const string kSamplerInputName = "Sampler"; |
|||
const string kLODInputName = "LOD"; |
|||
|
|||
public override bool hasPreview { get { return true; } } |
|||
|
|||
public SampleTexture2DLODNode() |
|||
{ |
|||
name = "Sample Texture 2D LOD"; |
|||
UpdateNodeAfterDeserialization(); |
|||
} |
|||
|
|||
public override string documentationURL |
|||
{ |
|||
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Sample-Texture-2D-LOD-Node"; } |
|||
} |
|||
|
|||
[SerializeField] |
|||
private TextureType m_TextureType = TextureType.Default; |
|||
|
|||
[EnumControl("Type")] |
|||
public TextureType textureType |
|||
{ |
|||
get { return m_TextureType; } |
|||
set |
|||
{ |
|||
if (m_TextureType == value) |
|||
return; |
|||
|
|||
m_TextureType = value; |
|||
Dirty(ModificationScope.Graph); |
|||
} |
|||
} |
|||
|
|||
public sealed override void UpdateNodeAfterDeserialization() |
|||
{ |
|||
AddSlot(new Vector4MaterialSlot(OutputSlotRGBAId, kOutputSlotRGBAName, kOutputSlotRGBAName, SlotType.Output, Vector4.zero, ShaderStageCapability.All)); |
|||
AddSlot(new Vector1MaterialSlot(OutputSlotRId, kOutputSlotRName, kOutputSlotRName, SlotType.Output, 0, ShaderStageCapability.All)); |
|||
AddSlot(new Vector1MaterialSlot(OutputSlotGId, kOutputSlotGName, kOutputSlotGName, SlotType.Output, 0, ShaderStageCapability.All)); |
|||
AddSlot(new Vector1MaterialSlot(OutputSlotBId, kOutputSlotBName, kOutputSlotBName, SlotType.Output, 0, ShaderStageCapability.All)); |
|||
AddSlot(new Vector1MaterialSlot(OutputSlotAId, kOutputSlotAName, kOutputSlotAName, SlotType.Output, 0, ShaderStageCapability.All)); |
|||
AddSlot(new Texture2DInputMaterialSlot(TextureInputId, kTextureInputName, kTextureInputName)); |
|||
AddSlot(new UVMaterialSlot(UVInput, kUVInputName, kUVInputName, UVChannel.UV0)); |
|||
AddSlot(new SamplerStateMaterialSlot(SamplerInput, kSamplerInputName, kSamplerInputName, SlotType.Input)); |
|||
AddSlot(new Vector1MaterialSlot(LODInput, kLODInputName, kLODInputName, SlotType.Input, 0)); |
|||
RemoveSlotsNameNotMatching(new[] { OutputSlotRGBAId, OutputSlotRId, OutputSlotGId, OutputSlotBId, OutputSlotAId, TextureInputId, UVInput, SamplerInput, LODInput }); |
|||
} |
|||
|
|||
// Node generations
|
|||
public virtual void GenerateNodeCode(ShaderGenerator visitor, GenerationMode generationMode) |
|||
{ |
|||
var uvName = GetSlotValue(UVInput, generationMode); |
|||
|
|||
//Sampler input slot
|
|||
var samplerSlot = FindInputSlot<MaterialSlot>(SamplerInput); |
|||
var edgesSampler = owner.GetEdges(samplerSlot.slotReference); |
|||
|
|||
var lodSlot = GetSlotValue(LODInput, generationMode); |
|||
|
|||
var id = GetSlotValue(TextureInputId, generationMode); |
|||
|
|||
var result = string.Format("{0}4 {1} = SAMPLE_TEXTURE2D_LOD({2}, {3}, {4}, {5});" |
|||
, precision |
|||
, GetVariableNameForSlot(OutputSlotRGBAId) |
|||
, id |
|||
, edgesSampler.Any() ? GetSlotValue(SamplerInput, generationMode) : "sampler" + id |
|||
, uvName |
|||
, lodSlot); |
|||
|
|||
visitor.AddShaderChunk(result, true); |
|||
|
|||
if (textureType == TextureType.Normal) |
|||
visitor.AddShaderChunk(string.Format("{0}.rgb = UnpackNormalmapRGorAG({0});", GetVariableNameForSlot(OutputSlotRGBAId)), true); |
|||
|
|||
visitor.AddShaderChunk(string.Format("{0} {1} = {2}.r;", precision, GetVariableNameForSlot(OutputSlotRId), GetVariableNameForSlot(OutputSlotRGBAId)), true); |
|||
visitor.AddShaderChunk(string.Format("{0} {1} = {2}.g;", precision, GetVariableNameForSlot(OutputSlotGId), GetVariableNameForSlot(OutputSlotRGBAId)), true); |
|||
visitor.AddShaderChunk(string.Format("{0} {1} = {2}.b;", precision, GetVariableNameForSlot(OutputSlotBId), GetVariableNameForSlot(OutputSlotRGBAId)), true); |
|||
visitor.AddShaderChunk(string.Format("{0} {1} = {2}.a;", precision, GetVariableNameForSlot(OutputSlotAId), GetVariableNameForSlot(OutputSlotRGBAId)), true); |
|||
} |
|||
|
|||
public bool RequiresMeshUV(UVChannel channel, ShaderStageCapability stageCapability) |
|||
{ |
|||
s_TempSlots.Clear(); |
|||
GetInputSlots(s_TempSlots); |
|||
foreach (var slot in s_TempSlots) |
|||
{ |
|||
if (slot.RequiresMeshUV(channel)) |
|||
return true; |
|||
} |
|||
return false; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 64b637768540cce4f83b9b10cdcacd23 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEngine; |
|||
using UnityEditor.Graphing; |
|||
|
|||
namespace UnityEditor.ShaderGraph |
|||
{ |
|||
[Title("Utility", "Logic", "Is Front Face")] |
|||
public class IsFrontFaceNode : AbstractMaterialNode, IGeneratesBodyCode, IMayRequireFaceSign |
|||
{ |
|||
public IsFrontFaceNode() |
|||
{ |
|||
name = "Is Front Face"; |
|||
UpdateNodeAfterDeserialization(); |
|||
} |
|||
|
|||
public override string documentationURL |
|||
{ |
|||
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Is-Front-Face-Node"; } |
|||
} |
|||
|
|||
public override bool hasPreview { get { return false; } } |
|||
|
|||
public const int OutputSlotId = 0; |
|||
private const string kOutputSlotName = "Out"; |
|||
|
|||
public override void UpdateNodeAfterDeserialization() |
|||
{ |
|||
AddSlot(new BooleanMaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, true, ShaderStageCapability.Fragment)); |
|||
RemoveSlotsNameNotMatching(new[] { OutputSlotId }); |
|||
} |
|||
|
|||
public void GenerateNodeCode(ShaderGenerator visitor, GenerationMode generationMode) |
|||
{ |
|||
visitor.AddShaderChunk(string.Format("{0} {1} = max(0, IN.{2});", precision, GetVariableNameForSlot(OutputSlotId), ShaderGeneratorNames.FaceSign), true); |
|||
} |
|||
|
|||
public bool RequiresFaceSign(ShaderStageCapability stageCapability = ShaderStageCapability.Fragment) |
|||
{ |
|||
return true; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: c7e3dd61523f54e52ade29765e299d3f |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using System.IO; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Linq.Expressions; |
|||
using System.Reflection; |
|||
using System.Text; |
|||
using UnityEngine; |
|||
|
|||
namespace UnityEditor.Experimental.Rendering |
|||
{ |
|||
static class ShadowCascadeSplitGUI |
|||
{ |
|||
private const int kSliderbarTopMargin = 2; |
|||
private const int kSliderbarHeight = 24; |
|||
private const int kSliderbarBottomMargin = 2; |
|||
private const int kPartitionHandleWidth = 2; |
|||
private const int kPartitionHandleExtraHitAreaWidth = 2; |
|||
|
|||
private static readonly Color[] kCascadeColors = |
|||
{ |
|||
new Color(0.5f, 0.5f, 0.6f, 1.0f), |
|||
new Color(0.5f, 0.6f, 0.5f, 1.0f), |
|||
new Color(0.6f, 0.6f, 0.5f, 1.0f), |
|||
new Color(0.6f, 0.5f, 0.5f, 1.0f), |
|||
}; |
|||
|
|||
// using a LODGroup skin
|
|||
private static readonly GUIStyle s_CascadeSliderBG = "LODSliderRange"; |
|||
private static readonly GUIStyle s_TextCenteredStyle = new GUIStyle(EditorStyles.whiteMiniLabel) |
|||
{ |
|||
alignment = TextAnchor.MiddleCenter |
|||
}; |
|||
|
|||
// Internal struct to bundle drag information
|
|||
private class DragCache |
|||
{ |
|||
public int m_ActivePartition; // the cascade partition that we are currently dragging/resizing
|
|||
public float m_NormalizedPartitionSize; // the normalized size of the partition (0.0f < size < 1.0f)
|
|||
public Vector2 m_LastCachedMousePosition; // mouse position the last time we registered a drag or mouse down.
|
|||
|
|||
public DragCache(int activePartition, float normalizedPartitionSize, Vector2 currentMousePos) |
|||
{ |
|||
m_ActivePartition = activePartition; |
|||
m_NormalizedPartitionSize = normalizedPartitionSize; |
|||
m_LastCachedMousePosition = currentMousePos; |
|||
} |
|||
}; |
|||
private static DragCache s_DragCache; |
|||
|
|||
private static readonly int s_CascadeSliderId = "s_CascadeSliderId".GetHashCode(); |
|||
|
|||
private static SceneView s_RestoreSceneView; |
|||
private static SceneView.CameraMode s_OldSceneDrawMode; |
|||
private static bool s_OldSceneLightingMode; |
|||
|
|||
|
|||
/** |
|||
* Static function to handle the GUI and User input related to the cascade slider. |
|||
* |
|||
* @param normalizedCascadePartition The array of partition sizes in the range 0.0f - 1.0f; expects ONE entry if cascades = 2, and THREE if cascades=4 |
|||
* The last entry will be automatically determined by summing up the array, and doing 1.0f - sum |
|||
*/ |
|||
public static void HandleCascadeSliderGUI(ref float[] normalizedCascadePartitions) |
|||
{ |
|||
EditorGUILayout.LabelField("Cascade splits"); |
|||
|
|||
// get the inspector width since we need it while drawing the partition rects.
|
|||
// Only way currently is to reserve the block in the layout using GetRect(), and then immediately drawing the empty box
|
|||
// to match the call to GetRect.
|
|||
// From this point on, we move to non-layout based code.
|
|||
var sliderRect = GUILayoutUtility.GetRect(GUIContent.none |
|||
, s_CascadeSliderBG |
|||
, GUILayout.Height(kSliderbarTopMargin + kSliderbarHeight + kSliderbarBottomMargin) |
|||
, GUILayout.ExpandWidth(true)); |
|||
GUI.Box(sliderRect, GUIContent.none); |
|||
|
|||
float currentX = sliderRect.x; |
|||
float cascadeBoxStartY = sliderRect.y + kSliderbarTopMargin; |
|||
float cascadeSliderWidth = sliderRect.width - (normalizedCascadePartitions.Length * kPartitionHandleWidth); |
|||
Color origTextColor = GUI.color; |
|||
Color origBackgroundColor = GUI.backgroundColor; |
|||
int colorIndex = -1; |
|||
|
|||
// setup the array locally with the last partition
|
|||
float[] adjustedCascadePartitions = new float[normalizedCascadePartitions.Length + 1]; |
|||
System.Array.Copy(normalizedCascadePartitions, adjustedCascadePartitions, normalizedCascadePartitions.Length); |
|||
adjustedCascadePartitions[adjustedCascadePartitions.Length - 1] = 1.0f - normalizedCascadePartitions.Sum(); |
|||
|
|||
|
|||
// check for user input on any of the partition handles
|
|||
// this mechanism gets the current event in the queue... make sure that the mouse is over our control before consuming the event
|
|||
int sliderControlId = GUIUtility.GetControlID(s_CascadeSliderId, FocusType.Passive); |
|||
Event currentEvent = Event.current; |
|||
int hotPartitionHandleIndex = -1; // the index of any partition handle that we are hovering over or dragging
|
|||
|
|||
// draw each cascade partition
|
|||
for (int i = 0; i < adjustedCascadePartitions.Length; ++i) |
|||
{ |
|||
float currentPartition = adjustedCascadePartitions[i]; |
|||
|
|||
colorIndex = (colorIndex + 1) % kCascadeColors.Length; |
|||
GUI.backgroundColor = kCascadeColors[colorIndex]; |
|||
float boxLength = (cascadeSliderWidth * currentPartition); |
|||
|
|||
// main cascade box
|
|||
Rect partitionRect = new Rect(currentX, cascadeBoxStartY, boxLength, kSliderbarHeight); |
|||
GUI.Box(partitionRect, GUIContent.none, s_CascadeSliderBG); |
|||
currentX += boxLength; |
|||
|
|||
// cascade box percentage text
|
|||
GUI.color = Color.white; |
|||
Rect textRect = partitionRect; |
|||
var cascadeText = string.Format("{0}\n{1:F1}%", i, currentPartition * 100.0f); |
|||
|
|||
GUI.Label(textRect, cascadeText, s_TextCenteredStyle); |
|||
|
|||
// no need to draw the partition handle for last box
|
|||
if (i == adjustedCascadePartitions.Length - 1) |
|||
break; |
|||
|
|||
// partition handle
|
|||
GUI.backgroundColor = Color.black; |
|||
Rect handleRect = partitionRect; |
|||
handleRect.x = currentX; |
|||
handleRect.width = kPartitionHandleWidth; |
|||
GUI.Box(handleRect, GUIContent.none, s_CascadeSliderBG); |
|||
// we want a thin handle visually (since wide black bar looks bad), but a slightly larger
|
|||
// hit area for easier manipulation
|
|||
Rect handleHitRect = handleRect; |
|||
handleHitRect.xMin -= kPartitionHandleExtraHitAreaWidth; |
|||
handleHitRect.xMax += kPartitionHandleExtraHitAreaWidth; |
|||
if (handleHitRect.Contains(currentEvent.mousePosition)) |
|||
hotPartitionHandleIndex = i; |
|||
|
|||
// add regions to slider where the cursor changes to Resize-Horizontal
|
|||
if (s_DragCache == null) |
|||
{ |
|||
EditorGUIUtility.AddCursorRect(handleHitRect, MouseCursor.ResizeHorizontal, sliderControlId); |
|||
} |
|||
|
|||
currentX += kPartitionHandleWidth; |
|||
} |
|||
|
|||
GUI.color = origTextColor; |
|||
GUI.backgroundColor = origBackgroundColor; |
|||
|
|||
EventType eventType = currentEvent.GetTypeForControl(sliderControlId); |
|||
switch (eventType) |
|||
{ |
|||
case EventType.MouseDown: |
|||
if (hotPartitionHandleIndex >= 0) |
|||
{ |
|||
s_DragCache = new DragCache(hotPartitionHandleIndex, normalizedCascadePartitions[hotPartitionHandleIndex], currentEvent.mousePosition); |
|||
if (GUIUtility.hotControl == 0) |
|||
GUIUtility.hotControl = sliderControlId; |
|||
currentEvent.Use(); |
|||
|
|||
// Switch active scene view into shadow cascades visualization mode, once we start
|
|||
// tweaking cascade splits.
|
|||
if (s_RestoreSceneView == null) |
|||
{ |
|||
s_RestoreSceneView = SceneView.lastActiveSceneView; |
|||
if (s_RestoreSceneView != null) |
|||
{ |
|||
s_OldSceneDrawMode = s_RestoreSceneView.cameraMode; |
|||
s_OldSceneLightingMode = s_RestoreSceneView.m_SceneLighting; |
|||
s_RestoreSceneView.cameraMode = SceneView.GetBuiltinCameraMode(DrawCameraMode.ShadowCascades); |
|||
} |
|||
} |
|||
} |
|||
break; |
|||
|
|||
case EventType.MouseUp: |
|||
// mouseUp event anywhere should release the hotcontrol (if it belongs to us), drags (if any)
|
|||
if (GUIUtility.hotControl == sliderControlId) |
|||
{ |
|||
GUIUtility.hotControl = 0; |
|||
currentEvent.Use(); |
|||
} |
|||
s_DragCache = null; |
|||
|
|||
// Restore previous scene view drawing mode once we stop tweaking cascade splits.
|
|||
if (s_RestoreSceneView != null) |
|||
{ |
|||
s_RestoreSceneView.cameraMode = s_OldSceneDrawMode; |
|||
s_RestoreSceneView.m_SceneLighting = s_OldSceneLightingMode; |
|||
s_RestoreSceneView = null; |
|||
} |
|||
break; |
|||
|
|||
case EventType.MouseDrag: |
|||
if (GUIUtility.hotControl != sliderControlId) |
|||
break; |
|||
|
|||
// convert the mouse movement to normalized cascade width. Make sure that we are safe to apply the delta before using it.
|
|||
float delta = (currentEvent.mousePosition - s_DragCache.m_LastCachedMousePosition).x / cascadeSliderWidth; |
|||
bool isLeftPartitionHappy = ((adjustedCascadePartitions[s_DragCache.m_ActivePartition] + delta) > 0.0f); |
|||
bool isRightPartitionHappy = ((adjustedCascadePartitions[s_DragCache.m_ActivePartition + 1] - delta) > 0.0f); |
|||
if (isLeftPartitionHappy && isRightPartitionHappy) |
|||
{ |
|||
s_DragCache.m_NormalizedPartitionSize += delta; |
|||
normalizedCascadePartitions[s_DragCache.m_ActivePartition] = s_DragCache.m_NormalizedPartitionSize; |
|||
if (s_DragCache.m_ActivePartition < normalizedCascadePartitions.Length - 1) |
|||
normalizedCascadePartitions[s_DragCache.m_ActivePartition + 1] -= delta; |
|||
GUI.changed = true; |
|||
} |
|||
s_DragCache.m_LastCachedMousePosition = currentEvent.mousePosition; |
|||
currentEvent.Use(); |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 1a130d84c83d6d24a9c62c149265bfbc |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
m_EditorVersion: 2018.2.0b4 |
|
|||
m_EditorVersion: 2018.2.0b1 |
|
|||
m_EditorVersion: 2018.3.0a1 |
撰写
预览
正在加载...
取消
保存
Reference in new issue