Shader Methods

SFML.Net

Shader Methods

The Shader type exposes the following members.

Methods
  Name Description
Public method Static member Bind
Bind a shader for rendering
Protected method Destroy
Handle the destruction of the object
(Overrides ObjectBaseDestroy(Boolean).)
Public method Dispose
Explicitely dispose the object
(Inherited from ObjectBase.)
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected method Finalize
Dispose the object
(Inherited from ObjectBase.)
Public method Static member FromString
Load both the vertex and fragment shaders from source codes in memory This function can load both the vertex and the fragment shaders, or only one of them: pass NULL if you don't want to load either the vertex shader or the fragment shader. The sources must be valid shaders in GLSL language. GLSL is a C-like language dedicated to OpenGL shaders; you'll probably need to read a good documentation for it before writing your own shaders.
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected method MemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public method SetParameter(String, Color)
Change a color parameter of the shader "name" is the name of the variable to change in the shader. The corresponding parameter in the shader must be a 4x1 vector (vec4 GLSL type).
Public method SetParameter(String, ShaderCurrentTextureType)
Change a texture parameter of the shader This overload maps a shader texture variable to the texture of the object being drawn, which cannot be known in advance. The second argument must be sf::Shader::CurrentTexture. The corresponding parameter in the shader must be a 2D texture (sampler2D GLSL type).
Public method SetParameter(String, Texture)
Change a texture parameter of the shader "name" is the name of the variable to change in the shader. The corresponding parameter in the shader must be a 2D texture (sampler2D GLSL type). It is important to note that \a texture must remain alive as long as the shader uses it, no copy is made internally. To use the texture of the object being draw, which cannot be known in advance, you can pass the special value Shader.CurrentTexture.
Public method SetParameter(String, Transform)
Change a matrix parameter of the shader "name" is the name of the variable to change in the shader. The corresponding parameter in the shader must be a 4x4 matrix (mat4 GLSL type).
Public method SetParameter(String, Vector2f)
Change a 2-components vector parameter of the shader "name" is the name of the variable to change in the shader. The corresponding parameter in the shader must be a 2x1 vector (vec2 GLSL type).
Public method SetParameter(String, Single)
Change a float parameter of the shader "name" is the name of the variable to change in the shader. The corresponding parameter in the shader must be a float (float GLSL type).
Public method SetParameter(String, Single, Single)
Change a 2-components vector parameter of the shader "name" is the name of the variable to change in the shader. The corresponding parameter in the shader must be a 2x1 vector (vec2 GLSL type).
Public method SetParameter(String, Single, Single, Single)
Change a 3-components vector parameter of the shader "name" is the name of the variable to change in the shader. The corresponding parameter in the shader must be a 3x1 vector (vec3 GLSL type).
Public method SetParameter(String, Single, Single, Single, Single)
Change a 4-components vector parameter of the shader "name" is the name of the variable to change in the shader. The corresponding parameter in the shader must be a 4x1 vector (vec4 GLSL type).
Public method ToString
Provide a string describing the object
(Overrides ObjectToString.)
Top
See Also