예제 #1
0
            public static SubShaderDescriptor UnlitDOTS(UniversalTarget target, string renderType, string renderQueue)
            {
                var result = new SubShaderDescriptor()
                {
                    pipelineTag      = UniversalTarget.kPipelineTag,
                    customTags       = UniversalTarget.kUnlitMaterialTypeTag,
                    renderType       = renderType,
                    renderQueue      = renderQueue,
                    generatesPreview = true,
                    passes           = new PassCollection()
                };

                result.passes.Add(PassVariant(UnlitPasses.Forward(target), CorePragmas.DOTSForward));

                if (target.mayWriteDepth)
                {
                    result.passes.Add(PassVariant(CorePasses.DepthOnly(target), CorePragmas.DOTSInstanced));
                }

                result.passes.Add(PassVariant(CorePasses.DepthNormalOnly(target), CorePragmas.DOTSInstanced));

                if (target.castShadows || target.allowMaterialOverride)
                {
                    result.passes.Add(PassVariant(CorePasses.ShadowCaster(target), CorePragmas.DOTSInstanced));
                }

                result.passes.Add(UnlitPasses.DepthNormalOnly(target));
                result.passes.Add(CorePasses.SceneSelection(target));
                result.passes.Add(CorePasses.ScenePicking(target));

                return(result);
            }
예제 #2
0
            public static SubShaderDescriptor UnlitDOTS(UniversalTarget target, string renderType, string renderQueue)
            {
                var result = new SubShaderDescriptor()
                {
                    pipelineTag      = UniversalTarget.kPipelineTag,
                    customTags       = UniversalTarget.kUnlitMaterialTypeTag,
                    renderType       = renderType,
                    renderQueue      = renderQueue,
                    generatesPreview = true,
                    passes           = new PassCollection()
                };

                result.passes.Add(PassVariant(UnlitPasses.Forward(target), CorePragmas.DOTSForward));

                if (target.mayWriteDepth)
                {
                    result.passes.Add(PassVariant(CorePasses.DepthOnly(target), CorePragmas.DOTSInstanced));
                }

                result.passes.Add(PassVariant(CorePasses.DepthNormalOnly(target), CorePragmas.DOTSInstanced));

                if (target.castShadows || target.allowMaterialOverride)
                {
                    result.passes.Add(PassVariant(CorePasses.ShadowCaster(target), CorePragmas.DOTSInstanced));
                }

                // Currently neither of these passes (selection/picking) can be last for the game view for
                // UI shaders to render correctly. Verify [1352225] before changing this order.
                result.passes.Add(CorePasses.SceneSelection(target));
                result.passes.Add(CorePasses.ScenePicking(target));

                result.passes.Add(UnlitPasses.DepthNormalOnly(target));

                return(result);
            }