scg3  0.6
scg::BumpMapCore Class Reference

2D bump map core storing a texture (optional) and a normal map. More...

#include "BumpMapCore.h"

Inheritance diagram for scg::BumpMapCore:
[legend]
Collaboration diagram for scg::BumpMapCore:
[legend]

Public Member Functions

 BumpMapCore ()
 
virtual ~BumpMapCore ()
 
void setNormalMap (GLsizei width, GLsizei height, const unsigned char *rgbaData, GLenum wrapModeS, GLenum wrapModeT, GLenum minFilter, GLenum magFilter)
 
virtual void render (RenderState *renderState)
 
virtual void renderPost (RenderState *renderState)
 
- Public Member Functions inherited from scg::Texture2DCore
 Texture2DCore ()
 
virtual ~Texture2DCore ()
 
void setTexture (GLsizei width, GLsizei height, const unsigned char *rgbaData, GLenum wrapModeS, GLenum wrapModeT, GLenum minFilter, GLenum magFilter)
 
void rotate2D (GLfloat angleDeg)
 
void scale2D (glm::vec2 scaling)
 
- Public Member Functions inherited from scg::TextureCore
 TextureCore ()
 
virtual ~TextureCore ()=0
 
TextureCorerotate (GLfloat angleDeg, glm::vec3 axis)
 
TextureCorescale (glm::vec3 scaling)
 
TextureCoresetMatrix (glm::mat4 matrix)
 
- Public Member Functions inherited from scg::Core
 Core ()
 
virtual ~Core ()=0
 

Static Public Member Functions

static BumpMapCoreSP create ()
 
- Static Public Member Functions inherited from scg::Texture2DCore
static Texture2DCoreSP create ()
 

Protected Attributes

GLuint texNormal_
 
GLint texNormalOld_
 
- Protected Attributes inherited from scg::TextureCore
GLuint tex_
 
GLint texOld_
 
glm::mat4 matrix_
 

Detailed Description

2D bump map core storing a texture (optional) and a normal map.

Definition at line 37 of file BumpMapCore.h.

Constructor & Destructor Documentation

◆ BumpMapCore()

scg::BumpMapCore::BumpMapCore ( )

Contructor.

◆ ~BumpMapCore()

virtual scg::BumpMapCore::~BumpMapCore ( )
virtual

Destructor.

Member Function Documentation

◆ create()

static BumpMapCoreSP scg::BumpMapCore::create ( )
static

Create shared pointer.

◆ render()

virtual void scg::BumpMapCore::render ( RenderState renderState)
virtual

Render core, i.e., bind texture and normal map, and post-multiply current texture matrix by local texture matrix.

Reimplemented from scg::Texture2DCore.

◆ renderPost()

virtual void scg::BumpMapCore::renderPost ( RenderState renderState)
virtual

Render core after traversing sub-tree, i.e., restore previous texture matrix and bind previous texture and normal map.

Reimplemented from scg::Texture2DCore.

◆ setNormalMap()

void scg::BumpMapCore::setNormalMap ( GLsizei  width,
GLsizei  height,
const unsigned char *  rgbaData,
GLenum  wrapModeS,
GLenum  wrapModeT,
GLenum  minFilter,
GLenum  magFilter 
)

Create normal map from RGBA image with given parameters. If minFilter is GL_*_MIPMAP_* (see below), a mipmap is created from the given image.

Parameters
widthnormal map width
heightnormal map height
rgbaDataarray of RGBA values
wrapModeSGL_CLAMP, GL_CLAMP_TO_BORDER, GL_CLAMP_TO_EDGE, GL_MIRRORED_REPEAT, or GL_REPEAT
wrapModeTsee wrapModeS
minFilterGL_NEAREST, GL_LINEAR,
GL_NEAREST_MIPMAP_NEAREST, GL_LINEAR_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_LINEAR, or GL_LINEAR_MIPMAP_LINEAR
magFilterGL_NEAREST or GL_LINEAR

Member Data Documentation

◆ texNormal_

GLuint scg::BumpMapCore::texNormal_
protected

Definition at line 89 of file BumpMapCore.h.

◆ texNormalOld_

GLint scg::BumpMapCore::texNormalOld_
protected

Definition at line 90 of file BumpMapCore.h.


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