Remy
7 年前
当前提交
7bf53f3c
共有 62 个文件被更改,包括 780 次插入 和 301 次删除
-
61TestProjects/GraphicsTests/Packages/manifest.json
-
49TestProjects/LWGraphicsTest/Packages/manifest.json
-
57TestProjects/ShaderGraph/Packages/manifest.json
-
13com.unity.render-pipelines.core/CoreRP/Debugging/MousePositionDebug.cs
-
3com.unity.render-pipelines.core/CoreRP/Editor/CoreEditorUtils.cs
-
1com.unity.render-pipelines.high-definition/CHANGELOG.md
-
103com.unity.render-pipelines.high-definition/HDRP/Editor/BuildProcessors/HDRPreprocessShaders.cs
-
14com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/HDEditorUtils.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
-
2com.unity.render-pipelines.high-definition/HDRP/Editor/ShaderGraph/HDPBRPass.template
-
18com.unity.render-pipelines.high-definition/HDRP/Editor/ShaderGraph/HDPBRSubShader.cs
-
21com.unity.render-pipelines.high-definition/HDRP/Editor/ShaderGraph/HDSubShaderUtilities.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Editor/ShaderGraph/HDUnlitPassForward.template
-
18com.unity.render-pipelines.high-definition/HDRP/Editor/ShaderGraph/HDUnlitSubShader.cs
-
4com.unity.render-pipelines.high-definition/HDRP/Editor/Upgraders/HDRPVersion.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Material/LayeredLit/LayeredLit.shader
-
2com.unity.render-pipelines.high-definition/HDRP/Material/LayeredLit/LayeredLitTessellation.shader
-
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
-
1com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/Settings/RenderPipelineSettings.cs
-
58com.unity.render-pipelines.lightweight/LWRP/Editor/LightweightLightEditor.cs
-
12com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGraph/LightWeightPBRSubShader.cs
-
12com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGraph/LightWeightUnlitSubShader.cs
-
2com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGraph/lightweightPBRForwardPass.template
-
2com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGraph/lightweightUnlitPass.template
-
38com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderPreprocessor.cs
-
22com.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
-
7com.unity.shadergraph/CHANGELOG.md
-
4com.unity.shadergraph/Editor/Data/Graphs/ShaderGraphRequirements.cs
-
5com.unity.shadergraph/Editor/Data/Util/GraphUtil.cs
-
14com.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
-
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
-
18com.unity.shadergraph/Editor/Data/Interfaces/IMayRequireFaceSign.cs
-
3com.unity.shadergraph/Editor/Data/Interfaces/IMayRequireFaceSign.cs.meta
-
41com.unity.shadergraph/Editor/Data/Nodes/Utility/Logic/IsFrontFaceNode.cs
-
11com.unity.shadergraph/Editor/Data/Nodes/Utility/Logic/IsFrontFaceNode.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" |
|||
] |
|||
} |
|
|||
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 |
|
|||
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 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: |
|
|||
m_EditorVersion: 2018.2.0b4 |
|
|||
m_EditorVersion: 2018.2.0b1 |
|
|||
m_EditorVersion: 2018.3.0a1 |
撰写
预览
正在加载...
取消
保存
Reference in new issue