本文整理汇总了C#中WebGLUniformLocation类的典型用法代码示例。如果您正苦于以下问题:C# WebGLUniformLocation类的具体用法?C# WebGLUniformLocation怎么用?C# WebGLUniformLocation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WebGLUniformLocation类属于命名空间,在下文中一共展示了WebGLUniformLocation类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: draw
public void draw(f tilt, f spin, bool twinkle, Action mvPushMatrix, Action mvPopMatrix, Float32Array mvMatrix, Action drawStar, WebGLUniformLocation shaderProgram_colorUniform, WebGLRenderingContext gl)
{
#region degToRad
Func<float, float> degToRad = (degrees) =>
{
return degrees * (f)Math.PI / 180f;
};
#endregion
mvPushMatrix();
// Move to the star's position
glMatrix.mat4.rotate(mvMatrix, degToRad(this.angle), new f[] { 0.0f, 1.0f, 0.0f });
glMatrix.mat4.translate(mvMatrix, new f[] { this.dist, 0.0f, 0.0f });
// Rotate back so that the star is facing the viewer
glMatrix.mat4.rotate(mvMatrix, degToRad(-this.angle), new f[] { 0.0f, 1.0f, 0.0f });
glMatrix.mat4.rotate(mvMatrix, degToRad(-tilt), new f[] { 1.0f, 0.0f, 0.0f });
//if (twinkle) {
// // Draw a non-rotating star in the alternate "twinkling" color
// gl.uniform3f(shaderProgram_colorUniform, this.twinkleR, this.twinkleG, this.twinkleB);
// drawStar();
//}
// All stars spin around the Z axis at the same rate
glMatrix.mat4.rotate(mvMatrix, degToRad(spin), new f[] { 0.0f, 0.0f, 1.0f });
// Draw the star in its main color
gl.uniform3f(shaderProgram_colorUniform, this.r, this.g, this.b);
drawStar();
mvPopMatrix();
}
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:34,代码来源:Application.cs
示例2: uniform4iv
public void uniform4iv(WebGLUniformLocation location, WebGLIntArray v) { }
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:1,代码来源:WebGLRenderingContext.cs
示例3: uniformMatrix4fv
public void uniformMatrix4fv(WebGLUniformLocation location, bool transpose, WebGLFloatArray value) { }
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:1,代码来源:WebGLRenderingContext.cs
示例4: uniform4f
public void uniform4f(WebGLUniformLocation location, float x, float y, float z, float w) { }
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:1,代码来源:WebGLRenderingContext.cs
示例5: uniform4fv
public void uniform4fv(WebGLUniformLocation location, float[] v) { }
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:1,代码来源:WebGLRenderingContext.cs
示例6: uniform2f
public void uniform2f(WebGLUniformLocation location, float x, float y) { }
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:1,代码来源:WebGLRenderingContext.cs
示例7: uniform3f
public void uniform3f(WebGLUniformLocation location, float x, float y, float z) { }
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:1,代码来源:WebGLRenderingContext.cs
示例8: Uniform1i
/// <summary>
/// Assigns a boolean value to a uniform variable for the current program object.
/// Uniform1i can be used to set texture samplers. If location is a texture sampler, then value refers to an offset into the array of active textures.
///
/// Errors:
/// gl.INVALID_OPERATION The location doesn't belong to the current program.
/// There is no current program object.
/// If location is an invalid location for the current program object and location isn't equal to -1.
/// </summary>
/// <param name="location">Specifies the location of the uniform to modify.</param>
/// <param name="value">The new value for the uniform variable. </param>
public virtual void Uniform1i(WebGLUniformLocation location, bool value) { }
开发者ID:configit-open-source,项目名称:Frameworks,代码行数:12,代码来源:RenderingContextMethods.cs
示例9: Uniform2f
/// <summary>
/// Assigns two dimensional floating point values to a uniform variable for the current program object.
///
/// Errors:
/// gl.INVALID_OPERATION The location doesn't belong to the current program.
/// There is no current program object.
/// If location is an invalid location for the current program object and location isn't equal to -1.
/// </summary>
/// <param name="location">The location of the uniform variable to be updated. </param>
/// <param name="x">Horizontal value to assign.</param>
/// <param name="y">Vertical value to assign.</param>
public virtual void Uniform2f(WebGLUniformLocation location, double x, double y) { }
开发者ID:configit-open-source,项目名称:Frameworks,代码行数:12,代码来源:RenderingContextMethods.cs
示例10: GetUniform
/// <summary>
/// Gets the uniform value for a specific location in a program.
///
/// Errors:
/// gl.INVALID_VALUE If program is not generated by WebGL.
///
/// gl.INVALID_OPERATION If location isn't a valid uniform variable location for program
/// If program is not a program object.
/// if program isn't successfully linked.
/// </summary>
/// <param name="program">The program to query.</param>
/// <param name="location">The location of the uniform variable.</param>
/// <returns>The uniform value or null if a WebGL error is generated.</returns>
public virtual object GetUniform(WebGLProgram program, WebGLUniformLocation location)
{
return null;
}
开发者ID:configit-open-source,项目名称:Frameworks,代码行数:17,代码来源:RenderingContextMethods.cs
示例11: Uniform1f
/// <summary>
/// Assigns a floating point value to a uniform variable for the current program object.
///
/// Errors:
/// gl.INVALID_OPERATION There's no active program object.
/// The size and type of the uniform variable doesn't match the size and type of the value loaded.
/// </summary>
/// <param name="location">The location:
/// null Data passed will fail silently, no uniform variables will be changed.
/// location Specifies the location of the uniform to modify. WebGLUniformLocation instance returned by getUniformLocation.
/// </param>
/// <param name="x">The new floating point value for the uniform variable. </param>
public virtual void Uniform1f(WebGLUniformLocation location, double x) { }
开发者ID:configit-open-source,项目名称:Frameworks,代码行数:13,代码来源:RenderingContextMethods.cs
示例12: uniform1f
public void uniform1f(WebGLUniformLocation location, float x) { }
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:1,代码来源:WebGLRenderingContext.cs
示例13: Uniform2i
/// <summary>
/// Assigns two dimensional integer value to a uniform variable for the current program object.
/// If the location is null, no uniforms are updated and no error code is generated.
///
/// Errors:
/// gl.INVALID_OPERATION The location doesn't belong to the current program.
/// There is no current program object.
/// If location is an invalid location for the current program object and location isn't equal to -1.
/// </summary>
/// <param name="location">The location of the uniform variable to be updated.</param>
/// <param name="x">Horizontal value to assign.</param>
/// <param name="y">Vertical value to assign.</param>
public virtual void Uniform2i(WebGLUniformLocation location, int x, int y) { }
开发者ID:configit-open-source,项目名称:Frameworks,代码行数:13,代码来源:RenderingContextMethods.cs
示例14: uniform1i
public void uniform1i(WebGLUniformLocation location, int x) { }
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:1,代码来源:WebGLRenderingContext.cs
示例15: Uniform4f
/// <summary>
/// Assigns four dimensional floating point values to a uniform variable for the current program object.
/// If the location is null, no uniforms are updated and no error code is generated.
///
/// Errors:
/// gl.INVALID_OPERATION The location doesn't belong to the current program.
/// There is no active program.
/// Uniform specified by location isn't a float type.
/// </summary>
/// <param name="location">The location of the uniform variable to be updated.</param>
/// <param name="x">Horizontal value to assign.</param>
/// <param name="y">Vertical value to assign.</param>
/// <param name="z">Depth value to assign.</param>
/// <param name="w">Scaling value to assign.</param>
public virtual void Uniform4f(WebGLUniformLocation location, double x, double y, double z, double w) { }
开发者ID:configit-open-source,项目名称:Frameworks,代码行数:15,代码来源:RenderingContextMethods.cs
示例16: uniform2i
public void uniform2i(WebGLUniformLocation location, int x, int y) { }
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:1,代码来源:WebGLRenderingContext.cs
示例17: Uniform4fv
/// <summary>
/// Assigns four dimensional floating point vector array values to a uniform variable for the current program object.
/// If the location is null, no uniforms are updated and no error code is generated.
///
/// Errors:
/// gl.INVALID_OPERATION The location doesn't belong to the current program.
/// There is no active program.
/// value references a typed array instance other than Float32Array.
/// Uniform specified by location isn't a float type.
///
/// gl.INVALID_VALUE The length of value array isn't a multiple of the number of required components.
/// </summary>
/// <param name="location">The location of the uniform variable to be updated.</param>
/// <param name="value">Four dimensional floating point array to assign.</param>
public virtual void Uniform4fv(WebGLUniformLocation location, double[][][][] value) { }
开发者ID:configit-open-source,项目名称:Frameworks,代码行数:15,代码来源:RenderingContextMethods.cs
示例18: uniform3i
public void uniform3i(WebGLUniformLocation location, int x, int y, int z) { }
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:1,代码来源:WebGLRenderingContext.cs
示例19: Uniform4i
/// <summary>
/// Assigns four dimensional integer values to a uniform variable for the current program object.
/// If the location is null, no uniforms are updated and no error code is generated.
///
/// Errors:
/// gl.INVALID_OPERATION The location doesn't belong to the current program.
/// There is no active program.
/// Uniform specified by location isn't an integer type.
/// </summary>
/// <param name="location">The location of the uniform variable to be updated.</param>
/// <param name="x">Horizontal value to assign.</param>
/// <param name="y">Vertical value to assign.</param>
/// <param name="z">Depth value to assign.</param>
/// <param name="w">Scaling value to assign.</param>
public virtual void Uniform4i(WebGLUniformLocation location, int x, int y, int z, int w) { }
开发者ID:configit-open-source,项目名称:Frameworks,代码行数:15,代码来源:RenderingContextMethods.cs
示例20: Uniform4iv
/// <summary>
/// Assigns four dimensional integer vector array values to a uniform variable for the current program object.
/// If the location is null, no uniforms are updated and no error code is generated.
///
/// Errors:
/// gl.INVALID_OPERATION The location doesn't belong to the current program.
/// There is no active program.
/// value references a typed array instance other than Int32Array.
/// Uniform specified by location isn't an integer type.
///
/// gl.INVALID_VALUE The length of value array isn't a multiple of the number of required components.
/// </summary>
/// <param name="location">The location of the uniform variable to be updated.</param>
/// <param name="value">Four dimensional integer array to assign.</param>
public virtual void Uniform4iv(WebGLUniformLocation location, int[][][][] value) { }
开发者ID:configit-open-source,项目名称:Frameworks,代码行数:15,代码来源:RenderingContextMethods.cs
注:本文中的WebGLUniformLocation类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论