当前位置: 首页>>代码示例>>C#>>正文


C# RenderContext.CreateShader方法代码示例

本文整理汇总了C#中RenderContext.CreateShader方法的典型用法代码示例。如果您正苦于以下问题:C# RenderContext.CreateShader方法的具体用法?C# RenderContext.CreateShader怎么用?C# RenderContext.CreateShader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RenderContext的用法示例。


在下文中一共展示了RenderContext.CreateShader方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Renderer

        public Renderer(RenderContext rc)
        {
            RC = rc;
            // Initialize the shader(s)
            var vertsh = AssetStorage.Get<string>("VertexShader.vert");
            var pixsh = AssetStorage.Get<string>("PixelShader.frag");
            _shader = RC.CreateShader(vertsh, pixsh);
            RC.SetShader(_shader);

            AlbedoParam = RC.GetShaderParam(_shader, "albedo");
            ShininessParam = RC.GetShaderParam(_shader, "shininess");
            SpecFactorParam = RC.GetShaderParam(_shader, "specfactor");
            SpecColorParam = RC.GetShaderParam(_shader, "speccolor");
            AmbientColorParam = RC.GetShaderParam(_shader, "ambientcolor");

            LookUpImage("justBlack.jpg");
            LookUpImage("pflasterstein.jpg");
            LookUpImage("blue_poly.jpg");

            TextureParam = RC.GetShaderParam(_shader, "texture");
            TexMixParam = RC.GetShaderParam(_shader, "texmix");
        }
开发者ID:xKiwii,项目名称:CubyTower,代码行数:22,代码来源:Renderer.cs

示例2: GetTextureShader

 /// <summary>
 /// Creates a simple unlit texture shader in RenderContext.
 /// </summary>
 /// <param name="rc">RenderContext.</param>
 /// <returns>An instance of <see cref="ShaderProgram"/> to render a Texture without any lighting.</returns>
 public static ShaderProgram GetTextureShader(RenderContext rc)
 {
     var spSimple = rc.CreateShader(VsSimpleTexture, PsSimpleTexture);
     return spSimple;
 }
开发者ID:GameProduction,项目名称:ScharfschiessenGame,代码行数:10,代码来源:MoreShaders.cs

示例3: GetDiffuseColorShader

 /// <summary>
 /// Creates a diffuse color shader in RenderContext.
 /// </summary>
 /// <param name="rc">RenderContext.</param>
 /// <returns>An instance of <see cref="ShaderProgram"/> to render a color with diffuse lighting.</returns>
 public static ShaderProgram GetDiffuseColorShader(RenderContext rc)
 {
     var spSimple = rc.CreateShader(VsSimpleColor, PsSimpleColor);
     return spSimple;
 }
开发者ID:GameProduction,项目名称:ScharfschiessenGame,代码行数:10,代码来源:MoreShaders.cs

示例4: GetSpecularShader

 /// <summary>
 /// Creates a specular texture shader in RenderContext.
 /// </summary>
 /// <param name="rc">RenderContext.</param>
 /// <returns>An instance of <see cref="ShaderProgram"/> to render a Texture with specular lighting.</returns>
 public static ShaderProgram GetSpecularShader(RenderContext rc)
 {
     var spSimple = rc.CreateShader(VsSpecular, PsSpecular);
     return spSimple;
 }
开发者ID:GameProduction,项目名称:ScharfschiessenGame,代码行数:10,代码来源:MoreShaders.cs

示例5: GetBumpDiffuseShader

 /// <summary>
 /// Creates a bumpmap and diffuse texture shader in RenderContext.
 /// </summary>
 /// <param name="rc">RenderContext.</param>
 /// <returns>An instance of <see cref="ShaderProgram"/> to render an object with diffuse lighting and a texture for the surface and another for the bump effect.</returns>
 public static ShaderProgram GetBumpDiffuseShader(RenderContext rc)
 {
     var spSimple = rc.CreateShader(VsBump, PsBump);
     return spSimple;
 }
开发者ID:GameProduction,项目名称:ScharfschiessenGame,代码行数:10,代码来源:MoreShaders.cs


注:本文中的RenderContext.CreateShader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。