Class: LiteRGSS::Shader

Inherits:
Object
  • Object
show all
Defined in:
LiteRGSS.rb

Overview

Shader loaded applicable to a ShaderedSprite

Constant Summary

Fragment =

Define a Fragment shader

sf::Shader::Type::Fragment
Vertex =

Define a Vertex shader

sf::Shader::Type::Vertex
Geometry =

Define a Geometry shader

sf::Shader::Type::Geometry

Instance Method Summary collapse

Instance Method Details

#load(fragment_code) #load(code, type) #load(vertex_code, fragment_code) #load(vertex_code, geometry_code, fragment_code) Also known as: initialize

Overloads:

  • #load(fragment_code)

    Load a fragment shader from memory

    Parameters:

    • framgment_code (String)

      shader code of the fragment shader

  • #load(code, type)

    Load a shader from memory

    Parameters:

    • code (String)

      the code of the shader

    • type (Integer)

      the type of shader (Fragment, Vertex, Geometry)

  • #load(vertex_code, fragment_code)

    Load a vertex and fragment shader from memory

    Parameters:

    • vertex_code (String)
    • fragment_code (String)
  • #load(vertex_code, geometry_code, fragment_code)

    Load a full shader from memory

    Parameters:

    • vertex_code (String)
    • geometry_code (String)
    • fragment_code (String)

#set_bool_uniform(name, uniform)

Set a Boolean type uniform

Parameters:

  • name (String)

    name of the uniform

  • uniform (Boolean, Array<Boolean>)

    Array must have 2, 3 or 4 Booleans

#set_float_array_uniform(name, uniform)

Set a Float Array type uniform

Parameters:

  • name (String)

    name of the uniform

  • uniform (Array<Float>)

#set_float_uniform(name, uniform)

Set a Float type uniform

Parameters:

  • name (String)

    name of the uniform

  • uniform (Float, Array<Float>)

    Array must have 2, 3 or 4 Floats

#set_int_uniform(name, uniform)

Set a Integer type uniform

Parameters:

  • name (String)

    name of the uniform

  • uniform (Integer, Array<Integer>)

    Array must have 2, 3 or 4 Integers

#set_matrix_uniform(name, uniform)

Set a Matrix type uniform (3x3 or 4x4)

Parameters:

  • name (String)

    name of the uniform

  • uniform (Array<Float>)

    Array must be 9 for 3x3 matrix or 16 for 4x4 matrix

#set_texture_uniform(name, uniform)

Set a Texture type uniform

Parameters:

  • name (String)

    name of the uniform

  • uniform (LiteRGSS::Bitmap, nil)

    nil means sf::Shader::CurrentTexture