GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::graphics::ImageInstance2D Struct Reference

Configuration of a 2D image instance to draw. More...

#include <GREM/graphics_2d/Instances2D.hpp>

Public Attributes

vec2 position {0.0f, 0.0f}
 Position, in world coordinates, to draw the image at, with respect to its ImageInstance2D::origin.
float angle = 0.0f
 Angle, in radians, to rotate the image counter-clockwise by, around its ImageInstance2D::origin.
vec2 scale {1.0f, 1.0f}
 Coefficients to scale the size of the image by.
vec2 origin {0.0f, 0.0f}
 Offset, in local vertex coordinates, specifying the origin relative to the bottom left of the image.
vec2 textureOffset {0.0f, 0.0f}
 Offset, in texture coordinates, to apply to the texture coordinates before sampling the texture.
float textureAngle = 0.0f
 Angle, in radians, to rotate the texture coordinates by before sampling the texture.
vec2 textureScale {1.0f, 1.0f}
 Coefficients to scale the texture coordinates by before sampling the texture.
Color color = Color::WHITE
 Tint color to use in the shader.
Color emissiveColor = Color::INVISIBLE
 Emissive color to use in the shader.

Detailed Description

Configuration of a 2D image instance to draw.

Member Data Documentation

◆ position

vec2 grem::graphics::ImageInstance2D::position {0.0f, 0.0f}

Position, in world coordinates, to draw the image at, with respect to its ImageInstance2D::origin.

◆ angle

float grem::graphics::ImageInstance2D::angle = 0.0f

Angle, in radians, to rotate the image counter-clockwise by, around its ImageInstance2D::origin.

◆ scale

vec2 grem::graphics::ImageInstance2D::scale {1.0f, 1.0f}

Coefficients to scale the size of the image by.

The resulting textured quad will have the size of the original texture, multiplied by this value.

◆ origin

vec2 grem::graphics::ImageInstance2D::origin {0.0f, 0.0f}

Offset, in local vertex coordinates, specifying the origin relative to the bottom left of the image.

For example, a value of (0.5, 0.5) corresponds to the middle of the image.

◆ textureOffset

vec2 grem::graphics::ImageInstance2D::textureOffset {0.0f, 0.0f}

Offset, in texture coordinates, to apply to the texture coordinates before sampling the texture.

Note
The texture coordinates are transformed in the following order:
  1. Scale by ImageInstance2D::textureScale.
  2. Rotate by ImageInstance2D::textureAngle.
  3. Translate by ImageInstance2D::textureOffset.

◆ textureAngle

float grem::graphics::ImageInstance2D::textureAngle = 0.0f

Angle, in radians, to rotate the texture coordinates by before sampling the texture.

Note
The texture coordinates are transformed in the following order:
  1. Scale by ImageInstance2D::textureScale.
  2. Rotate by ImageInstance2D::textureAngle.
  3. Translate by ImageInstance2D::textureOffset.

◆ textureScale

vec2 grem::graphics::ImageInstance2D::textureScale {1.0f, 1.0f}

Coefficients to scale the texture coordinates by before sampling the texture.

Note
The texture coordinates are transformed in the following order:
  1. Scale by ImageInstance2D::textureScale.
  2. Rotate by ImageInstance2D::textureAngle.
  3. Translate by ImageInstance2D::textureOffset.

◆ color

Color grem::graphics::ImageInstance2D::color = Color::WHITE

Tint color to use in the shader.

Note
In the default shader, the output color is multiplied by this value, meaning that a value of Color::WHITE, i.e. RGBA(1, 1, 1, 1) in linear color, represents no modification to the original texture color.

◆ emissiveColor

Color grem::graphics::ImageInstance2D::emissiveColor = Color::INVISIBLE

Emissive color to use in the shader.

Note
In the default shader, the output color has this value added to it, meaning that a value of Color::INVISIBLE, i.e. RGBA(0, 0, 0, 0) in linear color, represents no modification to the original texture color.

The documentation for this struct was generated from the following file: