Ejemplo n.º 1
0
            public static PassDescriptor Forward(UniversalTarget target)
            {
                var result = new PassDescriptor
                {
                    // Definition
                    displayName   = "Universal Forward",
                    referenceName = "SHADERPASS_UNLIT",
                    useInPreview  = true,

                    // Template
                    passTemplatePath          = UniversalTarget.kUberTemplatePath,
                    sharedTemplateDirectories = UniversalTarget.kSharedTemplateDirectories,

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

                    // Fields
                    structs           = CoreStructCollections.Default,
                    requiredFields    = UnlitRequiredFields.Unlit,
                    fieldDependencies = CoreFieldDependencies.Default,

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

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

                CorePasses.AddTargetSurfaceControlsToPass(ref result, target);

                return(result);
            }
Ejemplo n.º 2
0
            public static PassDescriptor DepthNormalOnly(UniversalTarget target)
            {
                var result = new PassDescriptor
                {
                    // Definition
                    displayName   = "DepthNormals",
                    referenceName = "SHADERPASS_DEPTHNORMALSONLY",
                    lightMode     = "DepthNormalsOnly",
                    useInPreview  = false,

                    // Template
                    passTemplatePath          = UniversalTarget.kUberTemplatePath,
                    sharedTemplateDirectories = UniversalTarget.kSharedTemplateDirectories,

                    // Port Mask
                    validVertexBlocks = CoreBlockMasks.Vertex,
                    validPixelBlocks  = UnlitBlockMasks.FragmentDepthNormals,

                    // Fields
                    structs           = CoreStructCollections.Default,
                    requiredFields    = UnlitRequiredFields.DepthNormalsOnly,
                    fieldDependencies = CoreFieldDependencies.Default,

                    // Conditional State
                    renderStates = CoreRenderStates.DepthNormalsOnly(target),
                    pragmas      = CorePragmas.Forward,
                    defines      = new DefineCollection(),
                    keywords     = new KeywordCollection(),
                    includes     = CoreIncludes.DepthNormalsOnly,

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

                CorePasses.AddTargetSurfaceControlsToPass(ref result, target);

                return(result);
            }