Module: Mittsu

Defined in:
lib/mittsu/materials/shader_material.rb,
lib/mittsu.rb,
lib/mittsu/math.rb,
lib/mittsu/version.rb,
lib/mittsu/math/ray.rb,
lib/mittsu/constants.rb,
lib/mittsu/math/box2.rb,
lib/mittsu/math/box3.rb,
lib/mittsu/core/clock.rb,
lib/mittsu/core/face3.rb,
lib/mittsu/math/color.rb,
lib/mittsu/math/euler.rb,
lib/mittsu/math/line3.rb,
lib/mittsu/math/plane.rb,
lib/mittsu/math/sphere.rb,
lib/mittsu/math/spline.rb,
lib/mittsu/math/vector.rb,
lib/mittsu/extras/image.rb,
lib/mittsu/lights/light.rb,
lib/mittsu/math/frustum.rb,
lib/mittsu/math/matrix3.rb,
lib/mittsu/math/matrix4.rb,
lib/mittsu/math/vector2.rb,
lib/mittsu/math/vector3.rb,
lib/mittsu/math/vector4.rb,
lib/mittsu/objects/line.rb,
lib/mittsu/objects/mesh.rb,
lib/mittsu/scenes/scene.rb,
lib/mittsu/core/geometry.rb,
lib/mittsu/loaders/cache.rb,
lib/mittsu/math/triangle.rb,
lib/mittsu/objects/group.rb,
lib/mittsu/cameras/camera.rb,
lib/mittsu/core/object_3d.rb,
lib/mittsu/core/raycaster.rb,
lib/mittsu/loaders/loader.rb,
lib/mittsu/objects/sprite.rb,
lib/mittsu/core/hash_array.rb,
lib/mittsu/math/quaternion.rb,
lib/mittsu/textures/texture.rb,
lib/mittsu/lights/area_light.rb,
lib/mittsu/lights/spot_light.rb,
lib/mittsu/extras/image_utils.rb,
lib/mittsu/lights/point_light.rb,
lib/mittsu/loaders/mtl_loader.rb,
lib/mittsu/loaders/obj_loader.rb,
lib/mittsu/materials/material.rb,
lib/mittsu/renderers/glfw_lib.rb,
lib/mittsu/cameras/cube_camera.rb,
lib/mittsu/loaders/file_loader.rb,
lib/mittsu/math/color_keywords.rb,
lib/mittsu/objects/point_cloud.rb,
lib/mittsu/core/buffer_geometry.rb,
lib/mittsu/lights/ambient_light.rb,
lib/mittsu/loaders/image_loader.rb,
lib/mittsu/core/buffer_attribute.rb,
lib/mittsu/core/event_dispatcher.rb,
lib/mittsu/renderers/generic_lib.rb,
lib/mittsu/renderers/glfw_window.rb,
lib/mittsu/textures/cube_texture.rb,
lib/mittsu/textures/data_texture.rb,
lib/mittsu/loaders/obj_mtl_loader.rb,
lib/mittsu/textures/video_texture.rb,
lib/mittsu/lights/hemisphere_light.rb,
lib/mittsu/loaders/loading_manager.rb,
lib/mittsu/lights/directional_light.rb,
lib/mittsu/materials/sprite_material.rb,
lib/mittsu/renderers/opengl_renderer.rb,
lib/mittsu/cameras/perspective_camera.rb,
lib/mittsu/cameras/orthographic_camera.rb,
lib/mittsu/renderers/opengl/opengl_lib.rb,
lib/mittsu/textures/compressed_texture.rb,
lib/mittsu/extras/helpers/camera_helper.rb,
lib/mittsu/materials/mesh_face_material.rb,
lib/mittsu/renderers/shaders/shader_lib.rb,
lib/mittsu/core/dynamic_buffer_attribute.rb,
lib/mittsu/materials/line_basic_material.rb,
lib/mittsu/materials/mesh_basic_material.rb,
lib/mittsu/materials/mesh_phong_material.rb,
lib/mittsu/renderers/opengl/lights/light.rb,
lib/mittsu/renderers/opengl/objects/line.rb,
lib/mittsu/renderers/opengl/objects/mesh.rb,
lib/mittsu/renderers/opengl/opengl_state.rb,
lib/mittsu/renderers/opengl/scenes/scene.rb,
lib/mittsu/renderers/shaders/rbsl_loader.rb,
lib/mittsu/extras/geometries/box_geometry.rb,
lib/mittsu/materials/point_cloud_material.rb,
lib/mittsu/renderers/opengl/core/geometry.rb,
lib/mittsu/renderers/opengl/objects/group.rb,
lib/mittsu/renderers/opengl/opengl_buffer.rb,
lib/mittsu/renderers/opengl/opengl_helper.rb,
lib/mittsu/renderers/opengl/opengl_shader.rb,
lib/mittsu/renderers/opengl_render_target.rb,
lib/mittsu/renderers/shaders/shader_chunk.rb,
lib/mittsu/renderers/shaders/uniforms_lib.rb,
lib/mittsu/materials/mesh_lambert_material.rb,
lib/mittsu/renderers/opengl/core/object_3d.rb,
lib/mittsu/renderers/opengl/objects/sprite.rb,
lib/mittsu/renderers/opengl/opengl_program.rb,
lib/mittsu/renderers/shaders/uniforms_utils.rb,
lib/mittsu/extras/geometries/sphere_geometry.rb,
lib/mittsu/renderers/opengl/textures/texture.rb,
lib/mittsu/renderers/opengl/lights/spot_light.rb,
lib/mittsu/renderers/opengl/lights/point_light.rb,
lib/mittsu/renderers/opengl/materials/material.rb,
lib/mittsu/renderers/opengl/objects/point_cloud.rb,
lib/mittsu/renderers/opengl/core/buffer_geometry.rb,
lib/mittsu/renderers/opengl/lights/ambient_light.rb,
lib/mittsu/renderers/opengl/opengl_geometry_like.rb,
lib/mittsu/renderers/opengl/opengl_mittsu_params.rb,
lib/mittsu/renderers/opengl/opengl_default_target.rb,
lib/mittsu/renderers/opengl/opengl_geometry_group.rb,
lib/mittsu/renderers/opengl/opengl_light_renderer.rb,
lib/mittsu/renderers/opengl/plugins/sprite_plugin.rb,
lib/mittsu/renderers/opengl/textures/cube_texture.rb,
lib/mittsu/renderers/opengl/textures/data_texture.rb,
lib/mittsu/renderers/opengl/lights/hemisphere_light.rb,
lib/mittsu/renderers/opengl/lights/directional_light.rb,
lib/mittsu/renderers/opengl/materials/shader_material.rb,
lib/mittsu/renderers/opengl/plugins/shadow_map_plugin.rb,
lib/mittsu/renderers/opengl/textures/compressed_texture.rb,
lib/mittsu/renderers/opengl/materials/line_basic_material.rb,
lib/mittsu/renderers/opengl/materials/mesh_basic_material.rb,
lib/mittsu/renderers/opengl/materials/mesh_phong_material.rb,
lib/mittsu/renderers/opengl/materials/point_cloud_material.rb,
lib/mittsu/renderers/opengl/materials/mesh_lambert_material.rb,
lib/mittsu/renderers/opengl/materials/opengl_material_basics.rb

Overview

parameters =

color: <hex>,
opacity: <float>,
map: new THREE.Texture( <Image> ),

size: <float>,
sizeAttenuation: <bool>,

blending: THREE.NormalBlending,
depthTest: <bool>,
depthWrite: <bool>,

vertexColors: <bool>,

fog: <bool>

Defined Under Namespace

Modules: Cache, EventDispatcher, GLFW, GLFWLib, GenericLib, ImageUtils, Math, OpenGLGeometryLike, OpenGLHelper, OpenGLLib, OpenGLMaterialBasics, RBSLLoader, UniformsUtils Classes: AmbientLight, AreaLight, Box2, Box3, BoxGeometry, BufferAttribute, BufferGeometry, Camera, CameraHelper, Clock, Color, CompressedTexture, CubeCamera, CubeTexture, DataTexture, DirectionalLight, DynamicBufferAttribute, Euler, Face3, FileLoader, Frustum, Geometry, Group, HashArray, HemisphereLight, Image, ImageLoader, Light, Line, Line3, LineBasicMaterial, Loader, LoadingManager, MTLLoader, Material, Matrix3, Matrix4, Mesh, MeshBasicMaterial, MeshFaceMaterial, MeshLambertMaterial, MeshPhongMaterial, OBJLoader, OBJMTLLoader, Object3D, OpenGLBuffer, OpenGLDefaultTarget, OpenGLGeometryGroup, OpenGLLightRenderer, OpenGLProgram, OpenGLRenderTarget, OpenGLRenderer, OpenGLShader, OpenGLState, OrthographicCamera, PerspectiveCamera, Plane, PointCloud, PointCloudMaterial, PointLight, Quaternion, Ray, Raycaster, Scene, ShaderLib, ShaderMaterial, ShadowMapPlugin, Sphere, SphereGeometry, Spline, SpotLight, Sprite, SpriteMaterial, SpritePlugin, Texture, Triangle, Uniform, Vector, Vector2, Vector3, Vector4, VideoTexture

Constant Summary collapse

DEBUG =
ENV["DEBUG"] == "true"
VERSION =
"0.2.1"
REVISION =
"71"
MOUSE_LEFT =
0
MOUSE_MIDDLE =
1
MOUSE_RIGHT =
2
CullFaceNone =

GL STATE CONSTANTS

0
CullFaceBack =
1
CullFaceFront =
2
CullFaceFrontBack =
3
FrontFaceDirectionCW =
0
FrontFaceDirectionCCW =
1
BasicShadowMap =

SHADOWING TYPES

0
PCFShadowMap =
1
PCFSoftShadowMap =
2
FrontSide =

side

0
BackSide =
1
DoubleSide =
2
NoShading =

shading

false
FlatShading =
1
SmoothShading =
2
NoColors =

colors

false
FaceColors =
1
VertexColors =
2
NoBlending =

blending modes

false
NormalBlending =
1
AdditiveBlending =
2
SubtractiveBlending =
3
MultiplyBlending =
4
CustomBlending =
5
AddEquation =

custom blending equations (numbers start from 100 not to clash with other

mappings to OpenGL constants defined in texture.rb)
100
SubtractEquation =
101
ReverseSubtractEquation =
102
MinEquation =
103
MaxEquation =
104
ZeroFactor =

custom blending destination factors

200
OneFactor =
201
SrcColorFactor =
202
OneMinusSrcColorFactor =
203
SrcAlphaFactor =
204
OneMinusSrcAlphaFactor =
205
DstAlphaFactor =
206
OneMinusDstAlphaFactor =
207
DstColorFactor =

ZeroFactor = 200 OneFactor = 201 SrcAlphaFactor = 204 OneMinusSrcAlphaFactor = 205 DstAlphaFactor = 206 OneMinusDstAlphaFactor = 207

208
OneMinusDstColorFactor =
209
SrcAlphaSaturateFactor =
210
MultiplyOperation =

TEXTURE CONSTANTS

0
MixOperation =
1
AddOperation =
2
UVMapping =

Mapping modes

300
CubeReflectionMapping =
301
CubeRefractionMapping =
302
EquirectangularReflectionMapping =
303
EquirectangularRefractionMapping =
304
SphericalReflectionMapping =
305
RepeatWrapping =

Wrapping modes

1000
ClampToEdgeWrapping =
1001
MirroredRepeatWrapping =
1002
NearestFilter =

Filters

1003
NearestMipMapNearestFilter =
1004
NearestMipMapLinearFilter =
1005
LinearFilter =
1006
LinearMipMapNearestFilter =
1007
LinearMipMapLinearFilter =
1008
UnsignedByteType =

Data types

1009
ByteType =
1010
ShortType =
1011
UnsignedShortType =
1012
IntType =
1013
UnsignedIntType =
1014
FloatType =
1015
HalfFloatType =
1025
UnsignedShort4444Type =

UnsignedByteType = 1009

1016
UnsignedShort5551Type =
1017
UnsignedShort565Type =
1018
AlphaFormat =

Pixel formats

1019
RGBFormat =
1020
RGBAFormat =
1021
LuminanceFormat =
1022
LuminanceAlphaFormat =
1023
RGBEFormat =

RGBEFormat handled as RGBAFormat in shaders

RGBAFormat
RGB_S3TC_DXT1_Format =

DDS / ST3C Compressed texture formats

2001
RGBA_S3TC_DXT1_Format =
2002
RGBA_S3TC_DXT3_Format =
2003
RGBA_S3TC_DXT5_Format =
2004
RGB_PVRTC_4BPPV1_Format =

PVRTC compressed texture formats

2100
RGB_PVRTC_2BPPV1_Format =
2101
RGBA_PVRTC_4BPPV1_Format =
2102
RGBA_PVRTC_2BPPV1_Format =
2103
LineStrip =
0
LinePieces =
1
ColorKeywords =
{
  'aliceblue' => 0xF0F8FF,
  'antiquewhite' => 0xFAEBD7,
  'aqua' => 0x00FFFF,
  'aquamarine' => 0x7FFFD4,
  'azure' => 0xF0FFFF,
  'beige' => 0xF5F5DC,
  'bisque' => 0xFFE4C4,
  'black' => 0x000000,
  'blanchedalmond' => 0xFFEBCD,
  'blue' => 0x0000FF,
  'blueviolet' => 0x8A2BE2,
  'brown' => 0xA52A2A,
  'burlywood' => 0xDEB887,
  'cadetblue' => 0x5F9EA0,
  'chartreuse' => 0x7FFF00,
  'chocolate' => 0xD2691E,
  'coral' => 0xFF7F50,
  'cornflowerblue' => 0x6495ED,
  'cornsilk' => 0xFFF8DC,
  'crimson' => 0xDC143C,
  'cyan' => 0x00FFFF,
  'darkblue' => 0x00008B,
  'darkcyan' => 0x008B8B,
  'darkgoldenrod' => 0xB8860B,
  'darkgray' => 0xA9A9A9,
  'darkgreen' => 0x006400,
  'darkgrey' => 0xA9A9A9,
  'darkkhaki' => 0xBDB76B,
  'darkmagenta' => 0x8B008B,
  'darkolivegreen' => 0x556B2F,
  'darkorange' => 0xFF8C00,
  'darkorchid' => 0x9932CC,
  'darkred' => 0x8B0000,
  'darksalmon' => 0xE9967A,
  'darkseagreen' => 0x8FBC8F,
  'darkslateblue' => 0x483D8B,
  'darkslategray' => 0x2F4F4F,
  'darkslategrey' => 0x2F4F4F,
  'darkturquoise' => 0x00CED1,
  'darkviolet' => 0x9400D3,
  'deeppink' => 0xFF1493,
  'deepskyblue' => 0x00BFFF,
  'dimgray' => 0x696969,
  'dimgrey' => 0x696969,
  'dodgerblue' => 0x1E90FF,
  'firebrick' => 0xB22222,
  'floralwhite' => 0xFFFAF0,
  'forestgreen' => 0x228B22,
  'fuchsia' => 0xFF00FF,
  'gainsboro' => 0xDCDCDC,
  'ghostwhite' => 0xF8F8FF,
  'gold' => 0xFFD700,
  'goldenrod' => 0xDAA520,
  'gray' => 0x808080,
  'green' => 0x008000,
  'greenyellow' => 0xADFF2F,
  'grey' => 0x808080,
  'honeydew' => 0xF0FFF0,
  'hotpink' => 0xFF69B4,
  'indianred' => 0xCD5C5C,
  'indigo' => 0x4B0082,
  'ivory' => 0xFFFFF0,
  'khaki' => 0xF0E68C,
  'lavender' => 0xE6E6FA,
  'lavenderblush' => 0xFFF0F5,
  'lawngreen' => 0x7CFC00,
  'lemonchiffon' => 0xFFFACD,
  'lightblue' => 0xADD8E6,
  'lightcoral' => 0xF08080,
  'lightcyan' => 0xE0FFFF,
  'lightgoldenrodyellow' => 0xFAFAD2,
  'lightgray' => 0xD3D3D3,
  'lightgreen' => 0x90EE90,
  'lightgrey' => 0xD3D3D3,
  'lightpink' => 0xFFB6C1,
  'lightsalmon' => 0xFFA07A,
  'lightseagreen' => 0x20B2AA,
  'lightskyblue' => 0x87CEFA,
  'lightslategray' => 0x778899,
  'lightslategrey' => 0x778899,
  'lightsteelblue' => 0xB0C4DE,
  'lightyellow' => 0xFFFFE0,
  'lime' => 0x00FF00,
  'limegreen' => 0x32CD32,
  'linen' => 0xFAF0E6,
  'magenta' => 0xFF00FF,
  'maroon' => 0x800000,
  'mediumaquamarine' => 0x66CDAA,
  'mediumblue' => 0x0000CD,
  'mediumorchid' => 0xBA55D3,
  'mediumpurple' => 0x9370DB,
  'mediumseagreen' => 0x3CB371,
  'mediumslateblue' => 0x7B68EE,
  'mediumspringgreen' => 0x00FA9A,
  'mediumturquoise' => 0x48D1CC,
  'mediumvioletred' => 0xC71585,
  'midnightblue' => 0x191970,
  'mintcream' => 0xF5FFFA,
  'mistyrose' => 0xFFE4E1,
  'moccasin' => 0xFFE4B5,
  'navajowhite' => 0xFFDEAD,
  'navy' => 0x000080,
  'oldlace' => 0xFDF5E6,
  'olive' => 0x808000,
  'olivedrab' => 0x6B8E23,
  'orange' => 0xFFA500,
  'orangered' => 0xFF4500,
  'orchid' => 0xDA70D6,
  'palegoldenrod' => 0xEEE8AA,
  'palegreen' => 0x98FB98,
  'paleturquoise' => 0xAFEEEE,
  'palevioletred' => 0xDB7093,
  'papayawhip' => 0xFFEFD5,
  'peachpuff' => 0xFFDAB9,
  'peru' => 0xCD853F,
  'pink' => 0xFFC0CB,
  'plum' => 0xDDA0DD,
  'powderblue' => 0xB0E0E6,
  'purple' => 0x800080,
  'red' => 0xFF0000,
  'rosybrown' => 0xBC8F8F,
  'royalblue' => 0x4169E1,
  'saddlebrown' => 0x8B4513,
  'salmon' => 0xFA8072,
  'sandybrown' => 0xF4A460,
  'seagreen' => 0x2E8B57,
  'seashell' => 0xFFF5EE,
  'sienna' => 0xA0522D,
  'silver' => 0xC0C0C0,
  'skyblue' => 0x87CEEB,
  'slateblue' => 0x6A5ACD,
  'slategray' => 0x708090,
  'slategrey' => 0x708090,
  'snow' => 0xFFFAFA,
  'springgreen' => 0x00FF7F,
  'steelblue' => 0x4682B4,
  'tan' => 0xD2B48C,
  'teal' => 0x008080,
  'thistle' => 0xD8BFD8,
  'tomato' => 0xFF6347,
  'turquoise' => 0x40E0D0,
  'violet' => 0xEE82EE,
  'wheat' => 0xF5DEB3,
  'white' => 0xFFFFFF,
  'whitesmoke' => 0xF5F5F5,
  'yellow' => 0xFFFF00,
  'yellowgreen' => 0x9ACD32
}
DefaultLoadingManager =
LoadingManager.new
SHADER_LIB_HASH =
Hash.new { |h, k|
  h[k] = ShaderLib_Instance.load_from_file(k.to_s)
}
ShaderChunk =
Hash.new do |chunks, key|
  file_name = "#{key.to_s}.glsl"
  file_path = File.join(__dir__, 'shader_chunk', file_name)
  chunk = File.read(file_path)
  # chunk = "// #{chunk_name}\n#{chunk}"
  chunks[key] = chunk
end
UniformsLib =
{
  common: {
    'diffuse' => Uniform.new(:color, Color.new(0xeeeeee)),
    'opacity' => Uniform.new(:float, 1.0),

    'map' => Uniform.new(:texture, nil),
    'offsetRepeat' => Uniform.new(:vec4, Vector4.new(0.0, 0.0, 1.0, 1.0)),

    'lightMap' => Uniform.new(:texture, nil),
    'specularMap' => Uniform.new(:texture, nil),
    'alphaMap' => Uniform.new(:texture, nil),

    'envMap' => Uniform.new(:texture, nil),
    'flipEnvMap' => Uniform.new(:float, -1.0),
    'reflectivity' => Uniform.new(:float, 1.0),
    'refractionRatio' => Uniform.new(:float, 0.98),

    'morphTargetInfluences' => Uniform.new(:float, 0.0)
  },

  bump: {
    'bumpMap' => Uniform.new(:texture, nil),
    'bumpScale' => Uniform.new(:float, 1.0)
  },

	normal_map: {
		'normalMap' => Uniform.new(:texture, nil),
		'normalScale' => Uniform.new(:vec2, Vector2.new(1.0, 1.0))
	},

  fog: {
    'fogDensity' => Uniform.new(:float, 0.00025),
    'fogNear' => Uniform.new(:float, 1.0),
    'fogFar' => Uniform.new(:float, 2000.0),
    'fogColor' => Uniform.new(:color, Color.new(0xffffff))
  },

  lights: {
    'ambientLightColor' => Uniform.new(:color, Color.new(0xffffff)),

    'directionalLightDirection' => Uniform.new(:'vec3[]', []),
    'directionalLightColor' => Uniform.new(:'color[]', []),

    'hemisphereLightDirection' => Uniform.new(:'vec3[]', []),
    'hemisphereLightSkyColor' => Uniform.new(:'color[]', []),
    'hemisphereLightGroundColor' => Uniform.new(:'color[]', []),

    'pointLightColor' => Uniform.new(:'color[]', []),
    'pointLightPosition' => Uniform.new(:'vec3[]', []),
    'pointLightDistance' => Uniform.new(:'float[]', []),
    'pointLightDecay' => Uniform.new(:'float[]', []),

    'spotLightColor' => Uniform.new(:'color[]', []),
    'spotLightPosition' => Uniform.new(:'vec3[]', []),
    'spotLightDirection' => Uniform.new(:'vec3[]', []),
    'spotLightDistance' => Uniform.new(:'float[]', []),
    'spotLightAngleCos' => Uniform.new(:'float[]', []),
    'spotLightExponent' => Uniform.new(:'float[]', []),
    'spotLightDecay' => Uniform.new(:'float[]', [])
  },

  particle: {
    'psColor' => Uniform.new(:color, Color.new(0xeeeeee)),
    'opacity' => Uniform.new(:float, 1.0),
    'size' => Uniform.new(:float, 1.0),
    'scale' => Uniform.new(:float, 1.0),
    'map' => Uniform.new(:texture, nil),
    'offsetRepeat' => Uniform.new(:vec4, Vector4.new(0.0, 0.0, 1.0, 1.0))
  },

  shadow_map: {
    'shadowMap' => Uniform.new(:'texture[]', []),
    'shadowMapSize' => Uniform.new(:'vec2[]', []),

    'shadowBias' => Uniform.new(:'float[]', []),
    'shadowDarkness' => Uniform.new(:'float[]', []),

    'shadowMatrix' => Uniform.new(:'mat4[]', [])
  }
}
GL_MITTSU_PARAMS =
{
  RepeatWrapping => GL_REPEAT,
  ClampToEdgeWrapping => GL_CLAMP_TO_EDGE,
  MirroredRepeatWrapping => GL_MIRRORED_REPEAT,

  NearestFilter => GL_NEAREST,
  NearestMipMapNearestFilter => GL_NEAREST_MIPMAP_NEAREST,
  NearestMipMapLinearFilter => GL_NEAREST_MIPMAP_LINEAR,

  LinearFilter => GL_LINEAR,
  LinearMipMapNearestFilter => GL_LINEAR_MIPMAP_NEAREST,
  LinearMipMapLinearFilter => GL_LINEAR_MIPMAP_LINEAR,

  UnsignedByteType => GL_UNSIGNED_BYTE,
  UnsignedShort4444Type => GL_UNSIGNED_SHORT_4_4_4_4,
  UnsignedShort5551Type => GL_UNSIGNED_SHORT_5_5_5_1,
  UnsignedShort565Type => GL_UNSIGNED_SHORT_5_6_5,

  ByteType => GL_BYTE,
  ShortType => GL_SHORT,
  UnsignedShortType => GL_UNSIGNED_SHORT,
  IntType => GL_INT,
  UnsignedIntType => GL_UNSIGNED_INT,
  FloatType => GL_FLOAT,

  AlphaFormat => GL_ALPHA,
  RGBFormat => GL_RGB,
  RGBAFormat => GL_RGBA,
  LuminanceFormat => GL_LUMINANCE,
  LuminanceAlphaFormat => GL_LUMINANCE_ALPHA,

  AddEquation => GL_FUNC_ADD,
  SubtractEquation => GL_FUNC_SUBTRACT,
  ReverseSubtractEquation => GL_FUNC_REVERSE_SUBTRACT,

  ZeroFactor => GL_ZERO,
  OneFactor => GL_ONE,
  SrcColorFactor => GL_SRC_COLOR,
  OneMinusSrcColorFactor => GL_ONE_MINUS_SRC_COLOR,
  SrcAlphaFactor => GL_SRC_ALPHA,
  OneMinusSrcAlphaFactor => GL_ONE_MINUS_SRC_ALPHA,
  DstAlphaFactor => GL_DST_ALPHA,
  OneMinusDstAlphaFactor => GL_ONE_MINUS_DST_ALPHA,

  DstColorFactor => GL_DST_COLOR,
  OneMinusDstColorFactor => GL_ONE_MINUS_DST_COLOR,
  SrcAlphaSaturateFactor => GL_SRC_ALPHA_SATURATE

  # TODO: populate with extension parameters?
}

Class Method Summary collapse

Class Method Details

.debug?Boolean

Returns:

  • (Boolean)

4
5
6
# File 'lib/mittsu.rb', line 4

def self.debug?
  DEBUG
end