示例#1
0
 public void Generate(ShaderMixinSourceTree mixin, ShaderMixinContext context)
 {
     if (context.GetParam(MaterialParameters.HasSkinningPosition))
     {
         if (context.GetParam(MaterialParameters.SkinningBones) > context.GetParam(MaterialParameters.SkinningMaxBones))
         {
             context.SetParam(MaterialParameters.SkinningMaxBones, context.GetParam(MaterialParameters.SkinningBones));
         }
         mixin.Mixin.AddMacro("SkinningMaxBones", context.GetParam(MaterialParameters.SkinningMaxBones));
         context.Mixin(mixin, "TransformationSkinning");
         if (context.GetParam(MaterialParameters.HasSkinningNormal))
         {
             if (context.GetParam(MaterialParameters.NormalMap) != null)
             {
                 context.Mixin(mixin, "TangentToViewSkinning");
             }
             else
             {
                 context.Mixin(mixin, "NormalVSSkinning");
             }
             context.Mixin(mixin, "NormalSkinning");
         }
         if (context.GetParam(MaterialParameters.HasSkinningTangent))
         {
             context.Mixin(mixin, "TangentSkinning");
         }
     }
 }
 public void Generate(ShaderMixinSource mixin, ShaderMixinContext context)
 {
     context.SetParam(TestParameters.TestCount, 1);
     if (context.GetParam(TestParameters.TestCount) == 1)
     {
         context.Mixin(mixin, "C1");
     }
 }
示例#3
0
            public void Generate(ShaderMixinSourceTree mixin, ShaderMixinContext context)
            {
                #line 25
                context.SetParam(PostEffectsParameters.verticalBlur, false);

                #line 27
                context.Mixin(mixin, "PostEffectVsmBlur", context.GetParam(PostEffectsParameters.verticalBlur));
            }
示例#4
0
 public void Generate(ShaderMixinSourceTree mixin, ShaderMixinContext context)
 {
     context.CloneParentMixinToCurrent();
     context.SetParam(TestParameters.TestCount, 1);
     if (context.GetParam(TestParameters.TestCount) == 1)
     {
         context.Mixin(mixin, "C1");
     }
 }
示例#5
0
            public void Generate(ShaderMixinSourceTree mixin, ShaderMixinContext context)
            {
                #line 35
                if (context.GetParam(MaterialParameters.HasSkinningPosition))
                {
                    #line 37
                    if (context.GetParam(MaterialParameters.SkinningBones) > context.GetParam(MaterialParameters.SkinningMaxBones))
                    {
                        #line 40
                        context.SetParam(MaterialParameters.SkinningMaxBones, context.GetParam(MaterialParameters.SkinningBones));
                    }

                    #line 42
                    mixin.Mixin.AddMacro("SkinningMaxBones", context.GetParam(MaterialParameters.SkinningMaxBones));

                    #line 43
                    context.Mixin(mixin, "TransformationSkinning");

                    #line 45
                    if (context.GetParam(MaterialParameters.HasSkinningNormal))
                    {
                        #line 47
                        if (context.GetParam(BasicShadersParameters.UsedNormalMap))

                            #line 48
                        {
                            context.Mixin(mixin, "TangentToViewSkinning");
                        }

                        #line 50
                        else

                            #line 50
                        {
                            context.Mixin(mixin, "NormalVSSkinning");
                        }

                        #line 52
                        context.Mixin(mixin, "NormalSkinning");
                    }

                    #line 55
                    if (context.GetParam(MaterialParameters.HasSkinningTangent))

                        #line 56
                    {
                        context.Mixin(mixin, "TangentSkinning");
                    }
                }
            }
示例#6
0
            public void Generate(ShaderMixinSourceTree mixin, ShaderMixinContext context)
            {
                #line 14
                context.CloneProperties();

                #line 14
                mixin.Mixin.CloneFrom(mixin.Parent.Mixin);

                #line 15
                context.SetParam(TestParameters.TestCount, 1);

                #line 16
                if (context.GetParam(TestParameters.TestCount) == 1)

                    #line 17
                {
                    context.Mixin(mixin, "C1");
                }
            }
示例#7
0
            public void Generate(ShaderMixinSourceTree mixin, ShaderMixinContext context)
            {
                #line 80
                context.Mixin(mixin, "ShaderBase");

                #line 81
                context.Mixin(mixin, "ShadingBase");

                #line 82
                context.Mixin(mixin, "TransformationWAndVP");

                #line 84
                context.Mixin(mixin, "PositionVSStream");

                #line 86
                if (context.GetParam(MaterialParameters.NormalMap) != null)
                {
                    #line 88
                    context.Mixin(mixin, "NormalMapTexture");

                    {
                        #line 89
                        var __subMixin = new ShaderMixinSourceTree()
                        {
                            Parent = mixin
                        };

                        #line 89
                        context.Mixin(__subMixin, context.GetParam(MaterialParameters.NormalMap));
                        mixin.Mixin.AddComposition("normalMap", __subMixin.Mixin);
                    }

                    #line 90
                    context.SetParam(BasicShadersParameters.UsedNormalMap, true);
                }

                #line 93
                else
                {
                    #line 94
                    context.Mixin(mixin, "NormalVSStream");
                }
            }
示例#8
0
            public void Generate(ShaderMixinSourceTree mixin, ShaderMixinContext context)
            {
                #line 15
                context.Mixin(mixin, "ShaderBase");

                #line 16
                context.Mixin(mixin, "TransformationWAndVP");

                #line 18
                context.Mixin(mixin, "PositionVSStream");

                #line 20

                #line 20
                var hasNormals = context.GetParam(MaterialParameters.NormalMap) != null;

                #line 21
                if (hasNormals)
                {
                    #line 23
                    context.Mixin(mixin, "NormalMapTexture");

                    {
                        #line 24
                        var __subMixin = new ShaderMixinSourceTree()
                        {
                            Parent = mixin
                        };

                        #line 24
                        context.Mixin(__subMixin, context.GetParam(MaterialParameters.NormalMap));
                        mixin.Mixin.AddComposition("normalMap", __subMixin.Mixin);
                    }
                }

                #line 27
                else
                {
                    #line 28
                    context.Mixin(mixin, "NormalVSStream");
                }

                #line 31
                context.Mixin(mixin, "BRDFDiffuseBase");

                #line 32
                context.Mixin(mixin, "BRDFSpecularBase");

                #line 33
                context.Mixin(mixin, "LightMultiDirectionalShadingPerPixel", 2);

                #line 34
                context.Mixin(mixin, "TransparentShading");

                #line 35
                context.Mixin(mixin, "DiscardTransparent");

                #line 37
                if (context.GetParam(MaterialParameters.AlbedoDiffuse) != null)
                {
                    {
                        #line 39
                        var __subMixin = new ShaderMixinSourceTree()
                        {
                            Parent = mixin
                        };

                        #line 39
                        context.Mixin(__subMixin, "ComputeBRDFDiffuseLambert");
                        mixin.Mixin.AddComposition("DiffuseLighting", __subMixin.Mixin);
                    }

                    {
                        #line 40
                        var __subMixin = new ShaderMixinSourceTree()
                        {
                            Parent = mixin
                        };

                        #line 40
                        context.Mixin(__subMixin, context.GetParam(MaterialParameters.AlbedoDiffuse));
                        mixin.Mixin.AddComposition("albedoDiffuse", __subMixin.Mixin);
                    }
                }

                #line 43
                if (context.GetParam(MaterialParameters.AlbedoSpecular) != null)
                {
                    {
                        #line 45
                        var __subMixin = new ShaderMixinSourceTree()
                        {
                            Parent = mixin
                        };

                        #line 45
                        context.Mixin(__subMixin, "ComputeBRDFColorSpecularBlinnPhong");
                        mixin.Mixin.AddComposition("SpecularLighting", __subMixin.Mixin);
                    }

                    {
                        #line 46
                        var __subMixin = new ShaderMixinSourceTree()
                        {
                            Parent = mixin
                        };

                        #line 46
                        context.Mixin(__subMixin, context.GetParam(MaterialParameters.AlbedoSpecular));
                        mixin.Mixin.AddComposition("albedoSpecular", __subMixin.Mixin);
                    }

                    #line 48
                    if (context.GetParam(MaterialParameters.SpecularPowerMap) != null)
                    {
                        #line 50
                        context.Mixin(mixin, "SpecularPower");

                        {
                            #line 51
                            var __subMixin = new ShaderMixinSourceTree()
                            {
                                Parent = mixin
                            };

                            #line 51
                            context.Mixin(__subMixin, context.GetParam(MaterialParameters.SpecularPowerMap));
                            mixin.Mixin.AddComposition("SpecularPowerMap", __subMixin.Mixin);
                        }
                    }

                    #line 54
                    if (context.GetParam(MaterialParameters.SpecularIntensityMap) != null)
                    {
                        {
                            #line 56
                            var __subMixin = new ShaderMixinSourceTree()
                            {
                                Parent = mixin
                            };

                            #line 56
                            context.Mixin(__subMixin, context.GetParam(MaterialParameters.SpecularIntensityMap));
                            mixin.Mixin.AddComposition("SpecularIntensityMap", __subMixin.Mixin);
                        }
                    }
                }

                #line 60
                if (context.GetParam(MaterialParameters.HasSkinningPosition))
                {
                    #line 62
                    if (context.GetParam(MaterialParameters.SkinningBones) > context.GetParam(MaterialParameters.SkinningMaxBones))
                    {
                        #line 65
                        context.SetParam(MaterialParameters.SkinningMaxBones, context.GetParam(MaterialParameters.SkinningBones));
                    }

                    #line 67
                    mixin.Mixin.AddMacro("SkinningMaxBones", context.GetParam(MaterialParameters.SkinningMaxBones));

                    #line 68
                    context.Mixin(mixin, "TransformationSkinning");

                    #line 70
                    if (context.GetParam(MaterialParameters.HasSkinningNormal))
                    {
                        #line 72
                        if (hasNormals)

                            #line 73
                        {
                            context.Mixin(mixin, "TangentToViewSkinning");
                        }

                        #line 75
                        else

                            #line 75
                        {
                            context.Mixin(mixin, "NormalVSSkinning");
                        }

                        #line 77
                        context.Mixin(mixin, "NormalSkinning");
                    }

                    #line 80
                    if (context.GetParam(MaterialParameters.HasSkinningTangent))

                        #line 81
                    {
                        context.Mixin(mixin, "TangentSkinning");
                    }
                }
            }
示例#9
0
            public void Generate(ShaderMixinSource mixin, ShaderMixinContext context)
            {
                context.Mixin(mixin, "ShaderBase");
                context.Mixin(mixin, "ShadingBase");
                var extensionPreVertexStageSurfaceShaders = context.GetParam(MaterialKeys.VertexStageSurfaceShaders);

                if (extensionPreVertexStageSurfaceShaders != null)
                {
                    context.Mixin(mixin, "MaterialSurfaceVertexStageCompositor");

                    {
                        var __mixinToCompose__ = (extensionPreVertexStageSurfaceShaders);
                        var __subMixin         = new ShaderMixinSource();
                        context.PushComposition(mixin, "materialVertexStage", __subMixin);
                        context.Mixin(__subMixin, __mixinToCompose__);
                        context.PopComposition();
                    }

                    {
                        var __mixinToCompose__ = context.GetParam(MaterialKeys.VertexStageStreamInitializer);
                        var __subMixin         = new ShaderMixinSource();
                        context.PushComposition(mixin, "streamInitializerVertexStage", __subMixin);
                        context.Mixin(__subMixin, __mixinToCompose__);
                        context.PopComposition();
                    }
                }
                context.Mixin(mixin, "TransformationBase");
                context.Mixin(mixin, "NormalStream");
                context.Mixin(mixin, "TransformationWAndVP");
                if (context.GetParam(MaterialKeys.HasNormalMap))
                {
                    context.Mixin(mixin, "NormalFromNormalMapping");
                }
                else
                {
                    context.Mixin(mixin, "NormalFromMesh");
                }
                if (context.GetParam(MaterialKeys.HasSkinningPosition))
                {
                    if (context.GetParam(MaterialKeys.SkinningBones) > context.GetParam(MaterialKeys.SkinningMaxBones))
                    {
                        context.SetParam(MaterialKeys.SkinningMaxBones, context.GetParam(MaterialKeys.SkinningBones));
                    }
                    mixin.AddMacro("SkinningMaxBones", context.GetParam(MaterialKeys.SkinningMaxBones));
                    context.Mixin(mixin, "TransformationSkinning");
                    if (context.GetParam(MaterialKeys.HasSkinningNormal))
                    {
                        context.Mixin(mixin, "NormalMeshSkinning");
                    }
                    if (context.GetParam(MaterialKeys.HasSkinningTangent))
                    {
                        context.Mixin(mixin, "TangentMeshSkinning");
                    }
                    if (context.GetParam(MaterialKeys.HasSkinningNormal))
                    {
                        if (context.GetParam(MaterialKeys.HasNormalMap))
                        {
                            context.Mixin(mixin, "NormalVSSkinningNormalMapping");
                        }
                        else
                        {
                            context.Mixin(mixin, "NormalVSSkinningFromMesh");
                        }
                    }
                }
                var extensionTessellationShader = context.GetParam(MaterialKeys.TessellationShader);

                if (extensionTessellationShader != null)
                {
                    context.Mixin(mixin, (extensionTessellationShader));
                    var extensionDomainStageSurfaceShaders = context.GetParam(MaterialKeys.DomainStageSurfaceShaders);
                    if (extensionDomainStageSurfaceShaders != null)
                    {
                        context.Mixin(mixin, "MaterialSurfaceDomainStageCompositor");

                        {
                            var __mixinToCompose__ = (extensionDomainStageSurfaceShaders);
                            var __subMixin         = new ShaderMixinSource();
                            context.PushComposition(mixin, "materialDomainStage", __subMixin);
                            context.Mixin(__subMixin, __mixinToCompose__);
                            context.PopComposition();
                        }

                        {
                            var __mixinToCompose__ = context.GetParam(MaterialKeys.DomainStageStreamInitializer);
                            var __subMixin         = new ShaderMixinSource();
                            context.PushComposition(mixin, "streamInitializerDomainStage", __subMixin);
                            context.Mixin(__subMixin, __mixinToCompose__);
                            context.PopComposition();
                        }
                    }
                }
                var extensionPostVertexStage = context.GetParam(XenkoEffectBaseKeys.ExtensionPostVertexStageShader);

                if (extensionPostVertexStage != null)
                {
                    context.Mixin(mixin, (extensionPostVertexStage));
                }
            }
 public void Generate(ShaderMixinSource mixin, ShaderMixinContext context)
 {
     context.SetParam(TestParameters.TestCount, 1);
     if (context.GetParam(TestParameters.TestCount) == 1)
         context.Mixin(mixin, "C1");
 }
示例#11
0
            public void Generate(ShaderMixinSource mixin, ShaderMixinContext context)
            {
                context.Mixin(mixin, "ShaderBase");
                context.Mixin(mixin, "ShadingBase");
                var extensionPreVertexStageSurfaceShaders = context.GetParam(MaterialKeys.VertexStageSurfaceShaders);
                if (extensionPreVertexStageSurfaceShaders != null)
                {
                    context.Mixin(mixin, "MaterialSurfaceVertexStageCompositor");

                    {
                        var __mixinToCompose__ = (extensionPreVertexStageSurfaceShaders);
                        var __subMixin = new ShaderMixinSource();
                        context.PushComposition(mixin, "materialVertexStage", __subMixin);
                        context.Mixin(__subMixin, __mixinToCompose__);
                        context.PopComposition();
                    }

                    {
                        var __mixinToCompose__ = context.GetParam(MaterialKeys.VertexStageStreamInitializer);
                        var __subMixin = new ShaderMixinSource();
                        context.PushComposition(mixin, "streamInitializerVertexStage", __subMixin);
                        context.Mixin(__subMixin, __mixinToCompose__);
                        context.PopComposition();
                    }
                }
                context.Mixin(mixin, "TransformationBase");
                context.Mixin(mixin, "NormalStream");
                context.Mixin(mixin, "TransformationWAndVP");
                if (context.GetParam(MaterialKeys.HasNormalMap))
                {
                    context.Mixin(mixin, "NormalFromNormalMapping");
                }
                else
                {
                    context.Mixin(mixin, "NormalFromMesh");
                }
                if (context.GetParam(MaterialKeys.HasSkinningPosition))
                {
                    if (context.GetParam(MaterialKeys.SkinningBones) > context.GetParam(MaterialKeys.SkinningMaxBones))
                    {
                        context.SetParam(MaterialKeys.SkinningMaxBones, context.GetParam(MaterialKeys.SkinningBones));
                    }
                    mixin.AddMacro("SkinningMaxBones", context.GetParam(MaterialKeys.SkinningMaxBones));
                    context.Mixin(mixin, "TransformationSkinning");
                    if (context.GetParam(MaterialKeys.HasSkinningNormal))
                    {
                        context.Mixin(mixin, "NormalMeshSkinning");
                    }
                    if (context.GetParam(MaterialKeys.HasSkinningTangent))
                    {
                        context.Mixin(mixin, "TangentMeshSkinning");
                    }
                    if (context.GetParam(MaterialKeys.HasSkinningNormal))
                    {
                        if (context.GetParam(MaterialKeys.HasNormalMap))
                        {
                            context.Mixin(mixin, "NormalVSSkinningNormalMapping");
                        }
                        else
                        {
                            context.Mixin(mixin, "NormalVSSkinningFromMesh");
                        }
                    }
                }
                var extensionTessellationShader = context.GetParam(MaterialKeys.TessellationShader);
                if (extensionTessellationShader != null)
                {
                    context.Mixin(mixin, (extensionTessellationShader));
                    var extensionDomainStageSurfaceShaders = context.GetParam(MaterialKeys.DomainStageSurfaceShaders);
                    if (extensionDomainStageSurfaceShaders != null)
                    {
                        context.Mixin(mixin, "MaterialSurfaceDomainStageCompositor");

                        {
                            var __mixinToCompose__ = (extensionDomainStageSurfaceShaders);
                            var __subMixin = new ShaderMixinSource();
                            context.PushComposition(mixin, "materialDomainStage", __subMixin);
                            context.Mixin(__subMixin, __mixinToCompose__);
                            context.PopComposition();
                        }

                        {
                            var __mixinToCompose__ = context.GetParam(MaterialKeys.DomainStageStreamInitializer);
                            var __subMixin = new ShaderMixinSource();
                            context.PushComposition(mixin, "streamInitializerDomainStage", __subMixin);
                            context.Mixin(__subMixin, __mixinToCompose__);
                            context.PopComposition();
                        }
                    }
                }
                var extensionPostVertexStage = context.GetParam(ParadoxEffectBaseKeys.ExtensionPostVertexStageShader);
                if (extensionPostVertexStage != null)
                {
                    context.Mixin(mixin, (extensionPostVertexStage));
                }
            }
示例#12
0
            public void Generate(ShaderMixinSourceTree mixin, ShaderMixinContext context)
            {
                context.Mixin(mixin, "ShaderBase");
                context.Mixin(mixin, "TransformationWAndVP");
                context.Mixin(mixin, "BRDFDiffuseBase");
                context.Mixin(mixin, "BRDFSpecularBase");
                context.Mixin(mixin, "AlbedoFlatShading");
                if (context.GetParam(MaterialParameters.AlbedoDiffuse) != null)
                {
                    {
                        var __subMixin = new ShaderMixinSourceTree()
                        {
                            Parent = mixin
                        };
                        context.PushComposition(mixin, "DiffuseColor", __subMixin);
                        context.Mixin(__subMixin, "ComputeBRDFDiffuseLambert");
                        context.PopComposition();
                    }

                    {
                        var __subMixin = new ShaderMixinSourceTree()
                        {
                            Parent = mixin
                        };
                        context.PushComposition(mixin, "albedoDiffuse", __subMixin);
                        context.Mixin(__subMixin, context.GetParam(MaterialParameters.AlbedoDiffuse));
                        context.PopComposition();
                    }
                }
                if (context.GetParam(MaterialParameters.AlbedoSpecular) != null)
                {
                    {
                        var __subMixin = new ShaderMixinSourceTree()
                        {
                            Parent = mixin
                        };
                        context.PushComposition(mixin, "SpecularColor", __subMixin);
                        context.Mixin(__subMixin, "ComputeBRDFColorSpecularBlinnPhong");
                        context.PopComposition();
                    }

                    {
                        var __subMixin = new ShaderMixinSourceTree()
                        {
                            Parent = mixin
                        };
                        context.PushComposition(mixin, "albedoSpecular", __subMixin);
                        context.Mixin(__subMixin, context.GetParam(MaterialParameters.AlbedoSpecular));
                        context.PopComposition();
                    }
                }
                if (context.GetParam(MaterialParameters.HasSkinningPosition))
                {
                    if (context.GetParam(MaterialParameters.SkinningBones) > context.GetParam(MaterialParameters.SkinningMaxBones))
                    {
                        context.SetParam(MaterialParameters.SkinningMaxBones, context.GetParam(MaterialParameters.SkinningBones));
                    }
                    mixin.Mixin.AddMacro("SkinningMaxBones", context.GetParam(MaterialParameters.SkinningMaxBones));
                    context.Mixin(mixin, "TransformationSkinning");
                }
                if (context.GetParam(RenderingParameters.UseDeferred) && !context.GetParam(RenderingParameters.UseTransparent))
                {
                    context.Mixin(mixin, "GBufferPlugin");
                    context.Mixin(mixin, "LightDeferredShading");
                }
            }
示例#13
0
            public void Generate(ShaderMixinSourceTree mixin, ShaderMixinContext context)
            {
                context.Mixin(mixin, "ShaderBase");
                context.Mixin(mixin, "TransformationWAndVP");
                context.Mixin(mixin, "PositionVSStream");
                var hasNormals = context.GetParam(MaterialParameters.NormalMap) != null;

                if (hasNormals)
                {
                    context.Mixin(mixin, "NormalMapTexture");

                    {
                        var __subMixin = new ShaderMixinSourceTree()
                        {
                            Parent = mixin
                        };
                        context.PushComposition(mixin, "normalMap", __subMixin);
                        context.Mixin(__subMixin, context.GetParam(MaterialParameters.NormalMap));
                        context.PopComposition();
                    }
                }
                else
                {
                    context.Mixin(mixin, "NormalVSStream");
                }
                context.Mixin(mixin, "BRDFDiffuseBase");
                context.Mixin(mixin, "BRDFSpecularBase");
                context.Mixin(mixin, "LightMultiDirectionalShadingPerPixel", 2);
                context.Mixin(mixin, "TransparentShading");
                context.Mixin(mixin, "DiscardTransparent");
                if (context.GetParam(MaterialParameters.AlbedoDiffuse) != null)
                {
                    {
                        var __subMixin = new ShaderMixinSourceTree()
                        {
                            Parent = mixin
                        };
                        context.PushComposition(mixin, "DiffuseLighting", __subMixin);
                        context.Mixin(__subMixin, "ComputeBRDFDiffuseLambert");
                        context.PopComposition();
                    }

                    {
                        var __subMixin = new ShaderMixinSourceTree()
                        {
                            Parent = mixin
                        };
                        context.PushComposition(mixin, "albedoDiffuse", __subMixin);
                        context.Mixin(__subMixin, context.GetParam(MaterialParameters.AlbedoDiffuse));
                        context.PopComposition();
                    }
                }
                if (context.GetParam(MaterialParameters.AlbedoSpecular) != null)
                {
                    {
                        var __subMixin = new ShaderMixinSourceTree()
                        {
                            Parent = mixin
                        };
                        context.PushComposition(mixin, "SpecularLighting", __subMixin);
                        context.Mixin(__subMixin, "ComputeBRDFColorSpecularBlinnPhong");
                        context.PopComposition();
                    }

                    {
                        var __subMixin = new ShaderMixinSourceTree()
                        {
                            Parent = mixin
                        };
                        context.PushComposition(mixin, "albedoSpecular", __subMixin);
                        context.Mixin(__subMixin, context.GetParam(MaterialParameters.AlbedoSpecular));
                        context.PopComposition();
                    }
                    if (context.GetParam(MaterialParameters.SpecularPowerMap) != null)
                    {
                        context.Mixin(mixin, "SpecularPower");

                        {
                            var __subMixin = new ShaderMixinSourceTree()
                            {
                                Parent = mixin
                            };
                            context.PushComposition(mixin, "SpecularPowerMap", __subMixin);
                            context.Mixin(__subMixin, context.GetParam(MaterialParameters.SpecularPowerMap));
                            context.PopComposition();
                        }
                    }
                    if (context.GetParam(MaterialParameters.SpecularIntensityMap) != null)
                    {
                        {
                            var __subMixin = new ShaderMixinSourceTree()
                            {
                                Parent = mixin
                            };
                            context.PushComposition(mixin, "SpecularIntensityMap", __subMixin);
                            context.Mixin(__subMixin, context.GetParam(MaterialParameters.SpecularIntensityMap));
                            context.PopComposition();
                        }
                    }
                }
                if (context.GetParam(MaterialParameters.HasSkinningPosition))
                {
                    if (context.GetParam(MaterialParameters.SkinningBones) > context.GetParam(MaterialParameters.SkinningMaxBones))
                    {
                        context.SetParam(MaterialParameters.SkinningMaxBones, context.GetParam(MaterialParameters.SkinningBones));
                    }
                    mixin.Mixin.AddMacro("SkinningMaxBones", context.GetParam(MaterialParameters.SkinningMaxBones));
                    context.Mixin(mixin, "TransformationSkinning");
                    if (context.GetParam(MaterialParameters.HasSkinningNormal))
                    {
                        if (hasNormals)
                        {
                            context.Mixin(mixin, "TangentToViewSkinning");
                        }
                        else
                        {
                            context.Mixin(mixin, "NormalVSSkinning");
                        }
                        context.Mixin(mixin, "NormalSkinning");
                    }
                    if (context.GetParam(MaterialParameters.HasSkinningTangent))
                    {
                        context.Mixin(mixin, "TangentSkinning");
                    }
                }
            }
示例#14
0
            public void Generate(ShaderMixinSourceTree mixin, ShaderMixinContext context)
            {
                #line 50
                context.Mixin(mixin, "ShaderBase");

                #line 51
                context.Mixin(mixin, "TransformationWAndVP");

                #line 52
                context.Mixin(mixin, "BRDFDiffuseBase");

                #line 53
                context.Mixin(mixin, "BRDFSpecularBase");

                #line 54
                context.Mixin(mixin, "AlbedoFlatShading");

                #line 56
                if (context.GetParam(MaterialParameters.AlbedoDiffuse) != null)
                {
                    {
                        #line 58
                        var __subMixin = new ShaderMixinSourceTree()
                        {
                            Parent = mixin
                        };

                        #line 58
                        context.Mixin(__subMixin, "ComputeBRDFDiffuseLambert");
                        mixin.Mixin.AddComposition("DiffuseColor", __subMixin.Mixin);
                    }

                    {
                        #line 59
                        var __subMixin = new ShaderMixinSourceTree()
                        {
                            Parent = mixin
                        };

                        #line 59
                        context.Mixin(__subMixin, context.GetParam(MaterialParameters.AlbedoDiffuse));
                        mixin.Mixin.AddComposition("albedoDiffuse", __subMixin.Mixin);
                    }
                }

                #line 62
                if (context.GetParam(MaterialParameters.AlbedoSpecular) != null)
                {
                    {
                        #line 64
                        var __subMixin = new ShaderMixinSourceTree()
                        {
                            Parent = mixin
                        };

                        #line 64
                        context.Mixin(__subMixin, "ComputeBRDFColorSpecularBlinnPhong");
                        mixin.Mixin.AddComposition("SpecularColor", __subMixin.Mixin);
                    }

                    {
                        #line 65
                        var __subMixin = new ShaderMixinSourceTree()
                        {
                            Parent = mixin
                        };

                        #line 65
                        context.Mixin(__subMixin, context.GetParam(MaterialParameters.AlbedoSpecular));
                        mixin.Mixin.AddComposition("albedoSpecular", __subMixin.Mixin);
                    }
                }

                #line 68
                if (context.GetParam(MaterialParameters.HasSkinningPosition))
                {
                    #line 70
                    if (context.GetParam(MaterialParameters.SkinningBones) > context.GetParam(MaterialParameters.SkinningMaxBones))
                    {
                        #line 73
                        context.SetParam(MaterialParameters.SkinningMaxBones, context.GetParam(MaterialParameters.SkinningBones));
                    }

                    #line 75
                    mixin.Mixin.AddMacro("SkinningMaxBones", context.GetParam(MaterialParameters.SkinningMaxBones));

                    #line 76
                    context.Mixin(mixin, "TransformationSkinning");
                }

                #line 81
                if (context.GetParam(RenderingParameters.UseDeferred) && !context.GetParam(RenderingParameters.UseTransparent))
                {
                    #line 83
                    context.Mixin(mixin, "GBufferPlugin");

                    #line 84
                    context.Mixin(mixin, "LightDeferredShading");
                }
            }