45#ifndef _SOURCE_SHADERS_TFFLAT3D_H_
46#define _SOURCE_SHADERS_TFFLAT3D_H_
48#include <Magnum/DimensionTraits.h>
49#include <Magnum/GL/AbstractShaderProgram.h>
50#include <Magnum/Shaders/Generic.h>
51#include <Magnum/Shaders/visibility.h>
54using namespace Magnum;
60 class Flat3D:
public GL::AbstractShaderProgram {
65 typedef typename Magnum::Shaders::Generic3D::Position
Position;
75 typedef typename Magnum::Shaders::Generic3D::Color3
Color3;
80 typedef typename Magnum::Shaders::Generic3D::Color4
Color4;
82 #ifndef MAGNUM_TARGET_GLES2
86 typedef typename Magnum::Shaders::Generic3D::ObjectId
ObjectId;
97 typedef typename Magnum::Shaders::Generic3D::TextureOffset
TextureOffset;
105 #ifndef MAGNUM_TARGET_GLES2
113 enum class Flag: UnsignedByte {
116 VertexColor = 1 << 2,
117 TextureTransformation = 1 << 3,
118 #ifndef MAGNUM_TARGET_GLES2
120 InstancedObjectId = (1 << 5)|
ObjectId,
122 InstancedTransformation = 1 << 6,
123 InstancedTextureOffset = (1 << 7)|TextureTransformation
126 typedef Containers::EnumSet<Flag> Flags;
137 explicit Flat3D(NoCreateT)
noexcept: GL::AbstractShaderProgram{NoCreate} {}
152 Flags
flags()
const {
return _flags; }
192 #ifndef MAGNUM_TARGET_GLES2
200 unsigned clipPlaneCount()
const {
201 return _clipPlaneCount;
206 #ifndef MAGNUM_TARGET_GLES
207 using GL::AbstractShaderProgram::drawTransformFeedback;
209 #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
210 using GL::AbstractShaderProgram::dispatchCompute;
214 Int _transformationProjectionMatrixUniform{0},
215 _textureMatrixUniform{1},
217 _alphaMaskUniform{3};
218 #ifndef MAGNUM_TARGET_GLES2
219 Int _objectIdUniform{4};
221 Int _clipPlanesUniform{5};
223 UnsignedInt _clipPlaneCount{0};
226 MAGNUM_SHADERS_EXPORT Debug& operator<<(Debug& debug, Flat3D::Flag value);
227 MAGNUM_SHADERS_EXPORT Debug& operator<<(Debug& debug, Flat3D::Flags value);
228 CORRADE_ENUMSET_OPERATORS(Flat3D::Flags)
Magnum::Shaders::Generic3D::Color3 Color3
Three-component vertex color.
Definition tfFlat3D.h:75
Flat3D(Flat3D &&) noexcept=default
Move constructor.
Magnum::Shaders::Generic3D::ObjectId ObjectId
(Instanced) object ID
Definition tfFlat3D.h:86
Flat3D & setclipPlaneEquation(UnsignedInt id, const Vector4 &position)
Set clip plane equation for given clip plane.
Flat3D(const Flat3D &)=delete
Copying is not allowed.
Magnum::Shaders::Generic3D::TextureCoordinates TextureCoordinates
2D texture coordinates
Definition tfFlat3D.h:70
Flat3D(Flags flags={}, unsigned clipPlaneCount=0)
Constructor.
Flat3D & setTextureMatrix(const Matrix3 &matrix)
Set texture coordinate transformation matrix.
Magnum::Shaders::Generic3D::Color4 Color4
Four-component vertex color.
Definition tfFlat3D.h:80
Flags flags() const
Flags.
Definition tfFlat3D.h:152
Magnum::Shaders::Generic3D::TransformationMatrix TransformationMatrix
(Instanced) transformation matrix
Definition tfFlat3D.h:92
@ ColorOutput
Definition tfFlat3D.h:103
@ ObjectIdOutput
Definition tfFlat3D.h:109
Flat3D(NoCreateT) noexcept
Construct without creating the underlying OpenGL object.
Definition tfFlat3D.h:137
Magnum::Shaders::Generic3D::Position Position
Vertex position.
Definition tfFlat3D.h:65
Flat3D & bindTexture(GL::Texture2D &texture)
Bind a color texture.
Magnum::Shaders::Generic3D::TextureOffset TextureOffset
(Instanced) texture offset
Definition tfFlat3D.h:97
Flat3D & setAlphaMask(Float mask)
Set alpha mask value.
Flat3D & setColor(const Magnum::Color4 &color)
Set color.
Flat3D & setObjectId(UnsignedInt id)
Set object ID.
Flat3D & setTransformationProjectionMatrix(const MatrixTypeFor< 3, Float > &matrix)
Set transformation and projection matrix.
Tissue Forge shaders.
Definition tfFlat3D.h:57