本文整理汇总了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");
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}