# 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::CVertexProgram Class Reference

This class is a vertex program. More...

#include <vertex_program.h>

Inheritance diagram for NL3D::CVertexProgram:

NLMISC::CRefCount List of all members.

Public Methods

 CVertexProgram (const char *program)
 Constructor. More...

virtual ~CVertexProgram ()
 Destructor. More...

const std::string & getProgram () const
 Get the program. More...


Public Attributes

NLMISC::CRefPtr< IVertexProgramDrvInfos_DrvInfo
 The driver informations. For the driver implementation only. More...


Private Attributes

std::string _Program
 The progam. More...


Detailed Description

This class is a vertex program.

D3D / OPENGL compatibility notes: ---------------------------------

To make your program compatible with D3D and OPENGL nel drivers, please follow thoses directives to write your vertex programs

  • Use only v[0], v[1] etc.. syntax for input registers. Don't use v0, v1 or v[OPOS] etc..
  • Use only c[0], c[1] etc.. syntax for constant registers. Don't use c0, c1 etc..
  • Use only o[HPOS], o[COL0] etc.. syntax for output registers. Don't use oPos, oD0 etc..
  • Use only uppercase for registers R1, R2 etc.. Don't use lowercase r1, r2 etc..
  • Use a semicolon to delineate instructions.
  • Use ARL instruction to load the adress register and not MOV.
  • Don't use the NOP instruction.
  • Don't use macros.
-> Thoses programs work without any change under OpenGL. -> Direct3D driver implementation will have to modify the syntax on the fly before the setup like this:
  • "v[0]" must be changed in "v0" etc..
  • "o[HPOS]" must be changed in oPos etc..
  • Semicolon must be changed in line return character.
  • ARL instruction must be changed in MOV.
Behaviour of LOG may change depending on implementation: You can only expect to have dest.z = log2(abs(src.w)). LIT may or may not clamp the specular exponent to [-128, 128] (not done when EXT_vertex_shader is used for example ..)

Depending on the implementation, some optimizations can be achieved by masking the unused output values of instructions as LIT, EXPP ..

Author:
Cyril 'Hulud' Corvazier , Nevrax France
Date:
2001

Definition at line 92 of file vertex_program.h.


Constructor & Destructor Documentation

NL3D::CVertexProgram::CVertexProgram const char *    program
 

Constructor.

Definition at line 53 of file vertex_program.cpp.

References _Program, and program.

NL3D::CVertexProgram::~CVertexProgram   [virtual]
 

Destructor.

Definition at line 60 of file vertex_program.cpp.

References _DrvInfo, and NLMISC::CRefPtr< IVertexProgramDrvInfos >::kill.


Member Function Documentation

const std::string& NL3D::CVertexProgram::getProgram   const [inline]
 

Get the program.

Definition at line 103 of file vertex_program.h.

References _Program.


Member Data Documentation

NLMISC::CRefPtr<IVertexProgramDrvInfos> NL3D::CVertexProgram::_DrvInfo
 

The driver informations. For the driver implementation only.

Definition at line 111 of file vertex_program.h.

Referenced by ~CVertexProgram.

std::string NL3D::CVertexProgram::_Program [private]
 

The progam.

Definition at line 107 of file vertex_program.h.

Referenced by CVertexProgram, and getProgram.


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