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

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

                if (target.mayWriteDepth)
                {
                    result.passes.Add(CorePasses.DepthOnly(target));
                }

                result.passes.Add(CorePasses.ShadowCaster(target));
                result.passes.Add(CorePasses.SceneSelection(target));
                result.passes.Add(CorePasses.ScenePicking(target));

                return(result);
            }
Beispiel #2
0
            public static KeywordCollection Unlit(BuiltInTarget target)
            {
                var result = new KeywordCollection
                {
                    { CoreKeywordDescriptors.Lightmap },
                    { CoreKeywordDescriptors.DirectionalLightmapCombined },
                    { CoreKeywordDescriptors.SampleGI },
                };

                return(result);
            }
Beispiel #3
0
            public static PassDescriptor Unlit(BuiltInTarget target)
            {
                var result = new PassDescriptor
                {
                    // Definition
                    displayName   = "Pass",
                    referenceName = "SHADERPASS_UNLIT",
                    lightMode     = "ForwardBase",
                    useInPreview  = true,

                    // Template
                    passTemplatePath          = BuiltInTarget.kTemplatePath,
                    sharedTemplateDirectories = BuiltInTarget.kSharedTemplateDirectories,

                    // Port Mask
                    validVertexBlocks = CoreBlockMasks.Vertex,
                    validPixelBlocks  = CoreBlockMasks.FragmentColorAlpha,

                    // Fields
                    structs           = CoreStructCollections.Default,
                    fieldDependencies = CoreFieldDependencies.Default,

                    // Conditional State
                    renderStates = CoreRenderStates.Default(target),
                    pragmas      = CorePragmas.Forward,
                    defines      = new DefineCollection()
                    {
                        CoreDefines.BuiltInTargetAPI
                    },
                    keywords = new KeywordCollection(),
                    includes = UnlitIncludes.Unlit,

                    // Custom Interpolator Support
                    customInterpolators = CoreCustomInterpDescriptors.Common
                };

                CorePasses.AddTargetSurfaceControlsToPass(ref result, target);
                return(result);
            }