|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CMeshVPPerPixelLight Class ReferenceThis vertex program is used to perform perpixel lighting with meshs.
More...
#include <meshvp_per_pixel_light.h>
Inheritance diagram for NL3D::CMeshVPPerPixelLight:
List of all members.
Public Methods |
| CMeshVPPerPixelLight () |
|
virtual void | initInstance (CMeshBaseInstance *mbi) |
| Called at creation of an instance, to setup some information directly in the CMeshBaseInstance. More...
|
virtual bool | begin (IDriver *drv, CScene *scene, CMeshBaseInstance *mbi, const NLMISC::CMatrix &invertedModelMat, const NLMISC::CVector &viewerPos) |
| Called to setup constant / activate VertexProgram. More...
|
virtual void | end (IDriver *drv) |
| Typically disable the VertexProgram, or do some uninit. More...
|
virtual void | serial (NLMISC::IStream &f) throw (NLMISC::EStream) |
virtual void | setupForMaterial (const CMaterial &mat, IDriver *drv, CScene *scene, CVertexBuffer *vb) |
| Setup this shader for the given material. More...
|
virtual void | setupForMaterial (const CMaterial &mat, IDriver *drv, CScene *scene, IVertexBufferHard *vb) |
| The same as setupForMaterial, but with a hard vb. More...
|
virtual bool | needTangentSpace () const |
| NLMISC_DECLARE_CLASS (CMeshVPPerPixelLight) |
Public Attributes |
bool | SpecularLighting |
| true if want Specular Lighting. More...
|
Private Types |
enum | { NumVp = 8
} |
Private Methods |
void | enable (bool enabled, IDriver *drv) |
virtual bool | setupForMaterial (const CMaterial &mat, IDriver *drv, CScene *scene) |
Private Attributes |
bool | _Enabled |
bool | _IsPointLight |
Static Private Attributes |
std::auto_ptr< CVertexProgram > | _VertexProgram [NumVp] |
Detailed Description
This vertex program is used to perform perpixel lighting with meshs.
Its ouputs are :
Coord Tex 0 : duplicate the tex Coord 0 set from the v.b. Coord Tex 1 : The light vector in tangent space. Coord Tex 2 : The half-angle vector in tangent space.
This is designed to work with material that got a 'PerPixelLighting' shader. Note that no bump is used with this shader.
It requires that the input mesh has its tangent space first column vector encoded in the 2nd texture coordinate. Other stages are not supported for now.
Note that this can be mixed with gouraud rendered light (the gouraud diffuse and specular component are still computed)
-
Author:
-
Nicolas Vizerie , Nevrax France
-
Date:
-
2002
Definition at line 58 of file meshvp_per_pixel_light.h.
Member Enumeration Documentation
Constructor & Destructor Documentation
NL3D::CMeshVPPerPixelLight::CMeshVPPerPixelLight |
( |
|
) |
[inline] |
|
Member Function Documentation
|
Called to setup constant / activate VertexProgram.
(called before activate of the VB). The result tells wether the vertex program will be used in the given context. If this is the case, a call to setupMaterial must be done for each material being rendered with this V.P. After all primitive have been rendered, end() must be called. -
Parameters:
-
drv |
driver where to setup VP. |
scene |
retrieve some useFull scene info (windPower, time ...) |
mbi |
the mesh instance to retrieve some instance setup. |
mat |
the matrix to use (may not be the one of mbi) |
viewerPos |
position of the viewer in world space. |
Implements NL3D::IMeshVertexProgram.
Definition at line 433 of file meshvp_per_pixel_light.cpp.
References _IsPointLight, enable, NLMISC::CMatrix::mulVector, and SpecularLighting. |
void NL3D::CMeshVPPerPixelLight::enable |
( |
bool |
enabled, |
|
|
IDriver * |
drv |
|
) |
[private] |
|
void NL3D::CMeshVPPerPixelLight::end |
( |
IDriver * |
drv |
) |
[virtual] |
|
|
Called at creation of an instance, to setup some information directly in the CMeshBaseInstance.
Implements NL3D::IMeshVertexProgram.
Definition at line 371 of file meshvp_per_pixel_light.cpp.
References _VertexProgram, nlassert, nlwarning, NumVp, CVPParser::parse, NL3D::PPLightingDirectionnalNoSpecVPCodeBegin, NL3D::PPLightingDirectionnalNoSpecVPNormalizeCodeBegin, NL3D::PPLightingDirectionnalVPCodeBegin, NL3D::PPLightingDirectionnalVPNormalizeCodeBegin, NL3D::PPLightingNoSpecVPCodeBegin, NL3D::PPLightingVPCodeBegin, NL3D::PPLightingVPCodeEnd, NL3D::PPLightingVPNormalizeCodeBegin, NL3D::PPLightingVPNormalizeNoSpecCodeBegin, and CVPParser::TProgram. |
virtual bool NL3D::CMeshVPPerPixelLight::needTangentSpace |
( |
|
) |
const [inline, virtual] |
|
NL3D::CMeshVPPerPixelLight::NLMISC_DECLARE_CLASS |
( |
CMeshVPPerPixelLight |
|
) |
|
|
bool NL3D::CMeshVPPerPixelLight::setupForMaterial |
( |
const CMaterial & |
mat, |
|
|
IDriver * |
drv, |
|
|
CScene * |
scene |
|
) |
[private, virtual] |
|
Member Data Documentation
bool NL3D::CMeshVPPerPixelLight::_Enabled [private]
|
|
bool NL3D::CMeshVPPerPixelLight::_IsPointLight [private]
|
|
std::auto_ptr< CVertexProgram > NL3D::CMeshVPPerPixelLight::_VertexProgram [static, private]
|
|
bool NL3D::CMeshVPPerPixelLight::SpecularLighting
|
|
The documentation for this class was generated from the following files:
|
|