Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
TissueForge::shaders::Phong Class Reference
Inheritance diagram for TissueForge::shaders::Phong:
Collaboration diagram for TissueForge::shaders::Phong:

Public Types

enum  : UnsignedInt { ColorOutput = Magnum::Shaders::Generic3D::ColorOutput , ObjectIdOutput = Magnum::Shaders::Generic3D::ObjectIdOutput }
 
enum class  Flag : UnsignedShort {
  AmbientTexture = 1 << 0 , DiffuseTexture = 1 << 1 , SpecularTexture = 1 << 2 , NormalTexture = 1 << 4 ,
  AlphaMask = 1 << 3 , VertexColor = 1 << 5 , Bitangent = 1 << 11 , TextureTransformation = 1 << 6 ,
  ObjectId = 1 << 7 , InstancedObjectId = (1 << 8)|ObjectId , InstancedTransformation = 1 << 9 , InstancedTextureOffset = (1 << 10)|TextureTransformation
}
 Flag. More...
 
typedef Magnum::Shaders::Generic3D::Position Position
 Vertex position.
 
typedef Magnum::Shaders::Generic3D::Normal Normal
 Normal direction.
 
typedef Magnum::Shaders::Generic3D::Tangent Tangent
 Tangent direction.
 
typedef Magnum::Shaders::Generic3D::Tangent4 Tangent4
 Tangent direction with a bitangent sign.
 
typedef Magnum::Shaders::Generic3D::Bitangent Bitangent
 Bitangent direction.
 
typedef Magnum::Shaders::Generic3D::TextureCoordinates TextureCoordinates
 2D texture coordinates
 
typedef Magnum::Shaders::Generic3D::Color3 Color3
 Three-component vertex color.
 
typedef Magnum::Shaders::Generic3D::Color4 Color4
 Four-component vertex color.
 
typedef Magnum::Shaders::Generic3D::ObjectId ObjectId
 (Instanced) object ID
 
typedef Magnum::Shaders::Generic3D::TransformationMatrix TransformationMatrix
 (Instanced) transformation matrix
 
typedef Magnum::Shaders::Generic3D::NormalMatrix NormalMatrix
 (Instanced) normal matrix
 
typedef Magnum::Shaders::Generic3D::TextureOffset TextureOffset
 (Instanced) texture offset
 
typedef Containers::EnumSet< FlagFlags
 Flags.
 

Public Member Functions

 Phong (Flags flags={}, unsigned lightCount=1, unsigned clipPlaneCount=0)
 Constructor.
 
 Phong (NoCreateT) noexcept
 Construct without creating the underlying OpenGL object.
 
 Phong (const Phong &)=delete
 Copying is not allowed.
 
 Phong (Phong &&) noexcept=default
 Move constructor.
 
Phongoperator= (const Phong &)=delete
 Copying is not allowed.
 
Phongoperator= (Phong &&) noexcept=default
 Move assignment.
 
Flags flags () const
 Flags.
 
UnsignedInt lightCount () const
 Light count.
 
PhongsetAmbientColor (const Magnum::Color4 &color)
 Set ambient color.
 
PhongbindAmbientTexture (GL::Texture2D &texture)
 Bind an ambient texture.
 
PhongsetDiffuseColor (const Magnum::Color4 &color)
 Set diffuse color.
 
PhongbindDiffuseTexture (GL::Texture2D &texture)
 Bind a diffuse texture.
 
PhongsetNormalTextureScale (Float scale)
 Set normal texture scale.
 
PhongbindNormalTexture (GL::Texture2D &texture)
 Bind a normal texture.
 
PhongsetSpecularColor (const Magnum::Color4 &color)
 Set specular color.
 
PhongbindSpecularTexture (GL::Texture2D &texture)
 Bind a specular texture.
 
PhongbindTextures (GL::Texture2D *ambient, GL::Texture2D *diffuse, GL::Texture2D *specular, GL::Texture2D *normal)
 Bind textures.
 
PhongsetShininess (Float shininess)
 Set shininess.
 
PhongsetAlphaMask (Float mask)
 Set alpha mask value.
 
PhongsetObjectId (UnsignedInt id)
 Set object ID.
 
PhongsetTransformationMatrix (const Matrix4 &matrix)
 Set transformation matrix.
 
PhongsetNormalMatrix (const Matrix3x3 &matrix)
 Set normal matrix.
 
PhongsetProjectionMatrix (const Matrix4 &matrix)
 Set projection matrix.
 
PhongsetTextureMatrix (const Matrix3 &matrix)
 Set texture coordinate transformation matrix.
 
PhongsetLightPositions (Containers::ArrayView< const Vector4 > positions)
 Set light positions.
 
PhongsetLightPositions (std::initializer_list< Vector4 > positions)
 
PhongsetLightPosition (UnsignedInt id, const Vector4 &position)
 Set position for given light.
 
PhongsetclipPlaneEquation (UnsignedInt id, const Vector4 &position)
 Set clip plane equation for given clip plane.
 
PhongsetLightColors (Containers::ArrayView< const Magnum::Color3 > colors)
 Set light colors.
 
PhongsetLightColors (std::initializer_list< Magnum::Color3 > colors)
 
PhongsetLightColor (UnsignedInt id, const Magnum::Color3 &color)
 Set position for given light.
 
PhongsetLightSpecularColors (Containers::ArrayView< const Magnum::Color3 > colors)
 Set light specular colors.
 
PhongsetLightSpecularColors (std::initializer_list< Magnum::Color3 > colors)
 
PhongsetLightSpecularColor (UnsignedInt id, const Magnum::Color3 &color)
 Set position for given light.
 
PhongsetLightRanges (Containers::ArrayView< const Float > ranges)
 Set light attenuation ranges.
 
PhongsetLightRanges (std::initializer_list< Float > ranges)
 
PhongsetLightRange (UnsignedInt id, Float range)
 Set attenuation range for given light.
 
unsigned clipPlaneCount () const
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : UnsignedInt
Enumerator
ColorOutput 

Color shader output.

ObjectIdOutput 

Object ID shader output.

◆ Flag

enum class TissueForge::shaders::Phong::Flag : UnsignedShort
strong

Flag.

Enumerator
AmbientTexture 

Multiply ambient color with a texture.

DiffuseTexture 

Multiply diffuse color with a texture.

SpecularTexture 

Multiply specular color with a texture.

NormalTexture 

Modify normals according to a texture.

AlphaMask 

Enable alpha masking.

VertexColor 

Multiply diffuse color with a vertex color.

Bitangent 

Use the separate Bitangent attribute for retrieving vertex bitangents.

TextureTransformation 

Enable texture coordinate transformation.

ObjectId 

Enable object ID output.

InstancedObjectId 

Instanced object ID.

InstancedTransformation 

Instanced transformation.

InstancedTextureOffset 

Instanced texture offset.

Constructor & Destructor Documentation

◆ Phong()

TissueForge::shaders::Phong::Phong ( Flags flags = {},
unsigned lightCount = 1,
unsigned clipPlaneCount = 0 )
explicit

Constructor.

Parameters
flagsFlags
lightCountCount of light sources

Member Function Documentation

◆ bindAmbientTexture()

Phong & TissueForge::shaders::Phong::bindAmbientTexture ( GL::Texture2D & texture)

Bind an ambient texture.

Returns
Reference to self (for method chaining)

◆ bindDiffuseTexture()

Phong & TissueForge::shaders::Phong::bindDiffuseTexture ( GL::Texture2D & texture)

Bind a diffuse texture.

Returns
Reference to self (for method chaining)

◆ bindNormalTexture()

Phong & TissueForge::shaders::Phong::bindNormalTexture ( GL::Texture2D & texture)

Bind a normal texture.

Returns
Reference to self (for method chaining)

◆ bindSpecularTexture()

Phong & TissueForge::shaders::Phong::bindSpecularTexture ( GL::Texture2D & texture)

Bind a specular texture.

Returns
Reference to self (for method chaining)

◆ bindTextures()

Phong & TissueForge::shaders::Phong::bindTextures ( GL::Texture2D * ambient,
GL::Texture2D * diffuse,
GL::Texture2D * specular,
GL::Texture2D * normal )

Bind textures.

Returns
Reference to self (for method chaining)

◆ setAlphaMask()

Phong & TissueForge::shaders::Phong::setAlphaMask ( Float mask)

Set alpha mask value.

Returns
Reference to self (for method chaining)

◆ setAmbientColor()

Phong & TissueForge::shaders::Phong::setAmbientColor ( const Magnum::Color4 & color)

Set ambient color.

Returns
Reference to self (for method chaining)

◆ setclipPlaneEquation()

Phong & TissueForge::shaders::Phong::setclipPlaneEquation ( UnsignedInt id,
const Vector4 & position )

Set clip plane equation for given clip plane.

Returns
Reference to self (for method chaining)

◆ setDiffuseColor()

Phong & TissueForge::shaders::Phong::setDiffuseColor ( const Magnum::Color4 & color)

Set diffuse color.

Returns
Reference to self (for method chaining)

◆ setLightColor()

Phong & TissueForge::shaders::Phong::setLightColor ( UnsignedInt id,
const Magnum::Color3 & color )

Set position for given light.

Returns
Reference to self (for method chaining)

◆ setLightColors()

Phong & TissueForge::shaders::Phong::setLightColors ( Containers::ArrayView< const Magnum::Color3 > colors)

Set light colors.

Returns
Reference to self (for method chaining)

◆ setLightPosition()

Phong & TissueForge::shaders::Phong::setLightPosition ( UnsignedInt id,
const Vector4 & position )

Set position for given light.

Returns
Reference to self (for method chaining)

◆ setLightPositions()

Phong & TissueForge::shaders::Phong::setLightPositions ( Containers::ArrayView< const Vector4 > positions)

Set light positions.

Returns
Reference to self (for method chaining)

◆ setLightRange()

Phong & TissueForge::shaders::Phong::setLightRange ( UnsignedInt id,
Float range )

Set attenuation range for given light.

Returns
Reference to self (for method chaining)

◆ setLightRanges()

Phong & TissueForge::shaders::Phong::setLightRanges ( Containers::ArrayView< const Float > ranges)

Set light attenuation ranges.

Returns
Reference to self (for method chaining)

◆ setLightSpecularColor()

Phong & TissueForge::shaders::Phong::setLightSpecularColor ( UnsignedInt id,
const Magnum::Color3 & color )

Set position for given light.

Returns
Reference to self (for method chaining)

◆ setLightSpecularColors()

Phong & TissueForge::shaders::Phong::setLightSpecularColors ( Containers::ArrayView< const Magnum::Color3 > colors)

Set light specular colors.

Returns
Reference to self (for method chaining)

◆ setNormalMatrix()

Phong & TissueForge::shaders::Phong::setNormalMatrix ( const Matrix3x3 & matrix)

Set normal matrix.

Returns
Reference to self (for method chaining)

◆ setNormalTextureScale()

Phong & TissueForge::shaders::Phong::setNormalTextureScale ( Float scale)

Set normal texture scale.

Returns
Reference to self (for method chaining)

◆ setObjectId()

Phong & TissueForge::shaders::Phong::setObjectId ( UnsignedInt id)

Set object ID.

Returns
Reference to self (for method chaining)

◆ setProjectionMatrix()

Phong & TissueForge::shaders::Phong::setProjectionMatrix ( const Matrix4 & matrix)

Set projection matrix.

Returns
Reference to self (for method chaining)

◆ setShininess()

Phong & TissueForge::shaders::Phong::setShininess ( Float shininess)

Set shininess.

Returns
Reference to self (for method chaining)

◆ setSpecularColor()

Phong & TissueForge::shaders::Phong::setSpecularColor ( const Magnum::Color4 & color)

Set specular color.

Returns
Reference to self (for method chaining)

◆ setTextureMatrix()

Phong & TissueForge::shaders::Phong::setTextureMatrix ( const Matrix3 & matrix)

Set texture coordinate transformation matrix.

Returns
Reference to self (for method chaining)

◆ setTransformationMatrix()

Phong & TissueForge::shaders::Phong::setTransformationMatrix ( const Matrix4 & matrix)

Set transformation matrix.

Returns
Reference to self (for method chaining)

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