本文整理汇总了C#中IProgram.AttachShader方法的典型用法代码示例。如果您正苦于以下问题:C# IProgram.AttachShader方法的具体用法?C# IProgram.AttachShader怎么用?C# IProgram.AttachShader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IProgram
的用法示例。
在下文中一共展示了IProgram.AttachShader方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public void Create()
{
var openGlResourceFactory = new OpenGlResourceFactory();
var vertexShader = openGlResourceFactory.CreateShader(ShaderType.VertexShader);
vertexShader.SetSource(VertexShaderSource);
vertexShader.Compile();
var fragmentShader = openGlResourceFactory.CreateShader(ShaderType.FragmentShader);
fragmentShader.SetSource(FragmentShaderSource);
fragmentShader.Compile();
_program = openGlResourceFactory.CreateProgram();
_program.Create();
_program.AttachShader(vertexShader);
_program.AttachShader(fragmentShader);
_program.Link();
}
示例2: Create
public void Create()
{
_vertexShader = _openGlResourceFactory.CreateShader(ShaderType.VertexShader);
_vertexShader.SetSource(VertexShaderSource);
_vertexShader.Compile();
_fragmentShader = _openGlResourceFactory.CreateShader(ShaderType.FragmentShader);
_fragmentShader.SetSource(FragmentShaderSource);
_fragmentShader.Compile();
_geometryShader = _openGlResourceFactory.CreateShader(ShaderType.GeometryShader);
_geometryShader.SetSource(GeometryShaderSource);
_geometryShader.Compile();
Program = _openGlResourceFactory.CreateProgram();
Program.Create();
Program.AttachShader(_vertexShader);
Program.AttachShader(_geometryShader);
Program.AttachShader(_fragmentShader);
Program.Link();
ProjectionMatrix = Program.GetUniform<Matrix4>("ProjectionMatrix");
ViewMatrix = Program.GetUniform<Matrix4>("ViewMatrix");
ModelMatrix = Program.GetUniform<Matrix4>("ModelMatrix");
Color = Program.GetUniform<Vector4>("Color");
WindowScale = Program.GetUniform<Vector2>("WindowScale");
}
示例3: Create
public void Create()
{
_vertexShader = _openGlResourceFactory.CreateShader(ShaderType.VertexShader);
_vertexShader.SetSource(VertexShaderSource);
_vertexShader.Compile();
_fragmentShader = _openGlResourceFactory.CreateShader(ShaderType.FragmentShader);
_fragmentShader.SetSource(FragmentShaderSource);
_fragmentShader.Compile();
Program = _openGlResourceFactory.CreateProgram();
Program.Create();
Program.AttachShader(_vertexShader);
Program.AttachShader(_fragmentShader);
Program.Link();
ProjectionMatrix = Program.GetUniform<Matrix4>("ProjectionMatrix");
ViewMatrix = Program.GetUniform<Matrix4>("ViewMatrix");
ModelMatrix = Program.GetUniform<Matrix4>("ModelMatrix");
Color = Program.GetUniform<Vector4>("Color");
LightPosition = Program.GetUniform<Vector3>("ModelSpaceLightPosition");
NormalToWorld3x3 = Program.GetUniform<Matrix3>("NormalToWorld3x3");
LightDirection = Program.GetUniform<Vector3>("LightDirection");
}