# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NL3D::CTextureBump Class Reference

This texture is a helper to build a DsDt texture from a height map (provided it is supported by hardware) The height map should be convertible to a RGBA bitmap. More...

#include <texture_bump.h>

Inheritance diagram for NL3D::CTextureBump:

NL3D::ITexture NLMISC::CBitmap NLMISC::CRefCount NLMISC::IStreamable NLMISC::IClassable List of all members.

Public Methods

 NLMISC_DECLARE_CLASS (CTextureBump)
 CTextureBump ()
 ctor. More...

void setHeightMap (ITexture *heightMap)
 set the height map used to generate this bump map. More...

ITexturegetHeightMap ()
 get the height map used to generate this bumpmap. More...

const ITexturegetHeightMap () const
 get the height map used to generate this bumpmap (const version). More...

virtual void serial (NLMISC::IStream &f) throw (NLMISC::EStream)
 ==============================================================================================. More...

virtual bool supportSharing () const
 ==============================================================================================. More...

virtual std::string getShareName () const
 ==============================================================================================. More...

void enableSharing (bool enabled=true)
bool isSharingEnabled () const
void setAbsoluteOffsets (bool use=true)
 absolute offsets are taken from the gradient of the height map. More...

bool getAbsoluteOffsets () const
void forceNormalize (bool force=true)
 Force normalization of this texture when it is generated, so that the deltas reach their maximum amplitude. More...

bool isNormalizationForced () const
 Test wether normalization is forced with that texture. More...

float getNormalizationFactor ()
 Get the normalization factor. This is valid only if the texture has been generated. More...

virtual void release ()
 ==============================================================================================. More...


Protected Methods

virtual void doGenerate ()
 ==============================================================================================. More...


Protected Attributes

NLMISC::CSmartPtr< ITexture_HeightMap
float _NormalizationFactor
bool _DisableSharing
bool _UseAbsoluteOffsets
bool _ForceNormalize

Private Methods

virtual void setFilterMode (TMagFilter magf, TMinFilter minf)
 ==============================================================================================. More...


Detailed Description

This texture is a helper to build a DsDt texture from a height map (provided it is supported by hardware) The height map should be convertible to a RGBA bitmap.

Author:
Nicolas Vizerie , Nevrax France
Date:
2001

Definition at line 42 of file texture_bump.h.


Constructor & Destructor Documentation

NL3D::CTextureBump::CTextureBump  
 

ctor.

Definition at line 121 of file texture_bump.cpp.


Member Function Documentation

void NL3D::CTextureBump::doGenerate   [protected, virtual]
 

==============================================================================================.

Implements NL3D::ITexture.

Definition at line 176 of file texture_bump.cpp.

References _HeightMap, _NormalizationFactor, _UseAbsoluteOffsets, NL3D::BuildDsDt, NLMISC::CBitmap::getPixels, height, NLMISC::CBitmap::makeDummy, NL3D::NormalizeDsDt, NLMISC::CBitmap::releaseMipMaps, and width.

void NL3D::CTextureBump::enableSharing bool    enabled = true [inline]
 

Definition at line 63 of file texture_bump.h.

References _DisableSharing.

void NL3D::CTextureBump::forceNormalize bool    force = true [inline]
 

Force normalization of this texture when it is generated, so that the deltas reach their maximum amplitude.

After the texture generation, the factor needed to normalize can be obtained

Definition at line 74 of file texture_bump.h.

References _ForceNormalize.

bool NL3D::CTextureBump::getAbsoluteOffsets   const [inline]
 

Definition at line 69 of file texture_bump.h.

References _UseAbsoluteOffsets.

const ITexture* NL3D::CTextureBump::getHeightMap   const [inline]
 

get the height map used to generate this bumpmap (const version).

Definition at line 54 of file texture_bump.h.

References _HeightMap, and NL3D::ITexture::ITexture.

ITexture* NL3D::CTextureBump::getHeightMap   [inline]
 

get the height map used to generate this bumpmap.

Definition at line 52 of file texture_bump.h.

References _HeightMap, and NL3D::ITexture::ITexture.

float NL3D::CTextureBump::getNormalizationFactor   [inline]
 

Get the normalization factor. This is valid only if the texture has been generated.

Definition at line 80 of file texture_bump.h.

References _ForceNormalize, _NormalizationFactor, and nlassert.

std::string NL3D::CTextureBump::getShareName   const [virtual]
 

==============================================================================================.

Reimplemented from NL3D::ITexture.

Definition at line 231 of file texture_bump.cpp.

References _HeightMap, nlassert, and supportSharing.

bool NL3D::CTextureBump::isNormalizationForced   const [inline]
 

Test wether normalization is forced with that texture.

Definition at line 77 of file texture_bump.h.

References _ForceNormalize.

bool NL3D::CTextureBump::isSharingEnabled   const [inline]
 

Definition at line 65 of file texture_bump.h.

References _DisableSharing.

NL3D::CTextureBump::NLMISC_DECLARE_CLASS CTextureBump   
 

void NL3D::CTextureBump::release   [virtual]
 

==============================================================================================.

Reimplemented from NL3D::ITexture.

Definition at line 210 of file texture_bump.cpp.

References _HeightMap.

void NL3D::CTextureBump::serial NLMISC::IStream   f throw (NLMISC::EStream) [virtual]
 

==============================================================================================.

Reimplemented from NL3D::ITexture.

Definition at line 147 of file texture_bump.cpp.

void NL3D::CTextureBump::setAbsoluteOffsets bool    use = true [inline]
 

absolute offsets are taken from the gradient of the height map.

Definition at line 68 of file texture_bump.h.

References _UseAbsoluteOffsets.

void NL3D::CTextureBump::setFilterMode TMagFilter    magf,
TMinFilter    minf
[private, virtual]
 

==============================================================================================.

Reimplemented from NL3D::ITexture.

Definition at line 131 of file texture_bump.cpp.

References nlstop.

void NL3D::CTextureBump::setHeightMap ITexture   heightMap
 

set the height map used to generate this bump map.

Definition at line 136 of file texture_bump.cpp.

References _HeightMap, and NL3D::ITexture::touch.

bool NL3D::CTextureBump::supportSharing   const [virtual]
 

==============================================================================================.

Reimplemented from NL3D::ITexture.

Definition at line 224 of file texture_bump.cpp.

References _DisableSharing, and _HeightMap.

Referenced by getShareName.


Member Data Documentation

bool NL3D::CTextureBump::_DisableSharing [protected]
 

Definition at line 94 of file texture_bump.h.

Referenced by enableSharing, isSharingEnabled, and supportSharing.

bool NL3D::CTextureBump::_ForceNormalize [protected]
 

Definition at line 96 of file texture_bump.h.

Referenced by forceNormalize, getNormalizationFactor, and isNormalizationForced.

NLMISC::CSmartPtr<ITexture> NL3D::CTextureBump::_HeightMap [protected]
 

Definition at line 92 of file texture_bump.h.

Referenced by doGenerate, getHeightMap, getShareName, release, setHeightMap, and supportSharing.

float NL3D::CTextureBump::_NormalizationFactor [protected]
 

Definition at line 93 of file texture_bump.h.

Referenced by doGenerate, and getNormalizationFactor.

bool NL3D::CTextureBump::_UseAbsoluteOffsets [protected]
 

Definition at line 95 of file texture_bump.h.

Referenced by doGenerate, getAbsoluteOffsets, and setAbsoluteOffsets.


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