Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

vertexprog.h File Reference

#include <celmath/vecmath.h>
#include <celutil/color.h>
#include <celengine/gl.h>

Include dependency graph for vertexprog.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  arbvp
namespace  vp

Enumerations

enum  Parameter {
  LightDirection0 = 0, EyePosition = 1, DiffuseColor0 = 2, SpecularColor0 = 3,
  SpecularExponent = 4, AmbientColor = 5, HazeColor = 6, TextureTranslation = 7,
  Constant0 = 8, TexGen_S = 10, TexGen_T = 11, TexGen_S2 = 12,
  TexGen_T2 = 13, TexGen_S3 = 14, TexGen_T3 = 15, TexGen_S4 = 16,
  TexGen_T4 = 17, LightDirection1 = 18, DiffuseColor1 = 19, SpecularColor1 = 20,
  Scale = 21, InverseScale = 22
}

Functions

void disable ()
void enable ()
VertexProcessorinitARB ()
VertexProcessorinitNV ()
void parameter (unsigned int, const float *)
void parameter (unsigned int, float, float, float, float)
void parameter (unsigned int, const Color &)
void parameter (unsigned int, const Point3f &)
void parameter (unsigned int, const Vec3f &)
void parameter (unsigned int, float, float, float, float)
void parameter (unsigned int, const Color &)
void parameter (unsigned int, const Point3f &)
void parameter (unsigned int, const Vec3f &)
void use (unsigned int)

Variables

unsigned int cometTail = 0
unsigned int diffuse = 0
unsigned int diffuse_2light = 0
unsigned int diffuseBump = 0
unsigned int diffuseBumpHaze = 0
unsigned int diffuseHaze = 0
unsigned int diffuseHaze_2light = 0
unsigned int diffuseTexOffset = 0
unsigned int diffuseTexOffset_2light = 0
unsigned int ellipticalGalaxy = 0
unsigned int everything = 0
unsigned int glossMap = 0
unsigned int multiShadow = 0
unsigned int nightLights = 0
unsigned int nightLights_2light = 0
unsigned int perFragmentSpecular = 0
unsigned int perFragmentSpecularAlpha = 0
unsigned int ringIllum = 0
unsigned int ringShadow = 0
unsigned int shadowTexture = 0
unsigned int specular = 0
unsigned int specular_2light = 0


Enumeration Type Documentation

enum vp::Parameter
 

Enumeration values:
LightDirection0 
EyePosition 
DiffuseColor0 
SpecularColor0 
SpecularExponent 
AmbientColor 
HazeColor 
TextureTranslation 
Constant0 
TexGen_S 
TexGen_T 
TexGen_S2 
TexGen_T2 
TexGen_S3 
TexGen_T3 
TexGen_S4 
TexGen_T4 
LightDirection1 
DiffuseColor1 
SpecularColor1 
Scale 
InverseScale 

Definition at line 32 of file vertexprog.h.

00032                    {
00033         LightDirection0    = 0,
00034         EyePosition        = 1,
00035         DiffuseColor0      = 2,
00036         SpecularColor0     = 3,
00037         SpecularExponent   = 4,
00038         AmbientColor       = 5,
00039         HazeColor          = 6,
00040         TextureTranslation = 7,
00041         Constant0          = 8,
00042         TexGen_S           = 10,
00043         TexGen_T           = 11,
00044         TexGen_S2          = 12,
00045         TexGen_T2          = 13,
00046         TexGen_S3          = 14,
00047         TexGen_T3          = 15,
00048         TexGen_S4          = 16,
00049         TexGen_T4          = 17,
00050         LightDirection1    = 18,
00051         DiffuseColor1      = 19,
00052         SpecularColor1     = 20,
00053         Scale              = 21,
00054         InverseScale       = 22
00055     };


Function Documentation

void vp::disable  ) 
 

Definition at line 301 of file vertexprog.cpp.

References GL_VERTEX_PROGRAM_NV.

00302 {
00303     glDisable(GL_VERTEX_PROGRAM_NV);
00304 }

void vp::enable  ) 
 

Definition at line 307 of file vertexprog.cpp.

References GL_VERTEX_PROGRAM_NV.

00308 {
00309     glEnable(GL_VERTEX_PROGRAM_NV);
00310 }

VertexProcessor * vp::initARB  ) 
 

Definition at line 244 of file vertexprog.cpp.

References _, vp::diffuse, vp::diffuse_2light, vp::diffuseBump, vp::diffuseBumpHaze, vp::diffuseHaze, vp::diffuseHaze_2light, vp::diffuseTexOffset, vp::diffuseTexOffset_2light, vp::ellipticalGalaxy, ExtensionSupported(), vp::glossMap, LoadARBVertexProgram(), vp::multiShadow, vp::nightLights, vp::nightLights_2light, vp::perFragmentSpecular, vp::perFragmentSpecularAlpha, vp::ringIllum, vp::ringShadow, vp::shadowTexture, vp::specular, and vp::specular_2light.

Referenced by GLContext::init().

00245 {
00246     cout << _("Initializing ARB vertex programs . . .\n");
00247     if (!LoadARBVertexProgram("shaders/diffuse_arb.vp", diffuse))
00248         return NULL;
00249     if (!LoadARBVertexProgram("shaders/specular_arb.vp", specular))
00250         return NULL;
00251     if (!LoadARBVertexProgram("shaders/haze_arb.vp", diffuseHaze))
00252         return NULL;
00253     if (!LoadARBVertexProgram("shaders/bumpdiffuse_arb.vp", diffuseBump))
00254         return NULL;
00255     if (!LoadARBVertexProgram("shaders/bumphaze_arb.vp", diffuseBumpHaze))
00256         return NULL;
00257     if (!LoadARBVertexProgram("shaders/shadowtex_arb.vp", shadowTexture))
00258         return NULL;
00259     if (!LoadARBVertexProgram("shaders/diffuse_texoff_arb.vp", diffuseTexOffset))
00260         return NULL;
00261     if (!LoadARBVertexProgram("shaders/rings_arb.vp", ringIllum))
00262         return NULL;
00263     if (!LoadARBVertexProgram("shaders/ringshadow_arb.vp", ringShadow))
00264         return NULL;
00265     if (!LoadARBVertexProgram("shaders/night_arb.vp", nightLights))
00266         return NULL;
00267     if (!LoadARBVertexProgram("shaders/glossmap_arb.vp", glossMap))
00268         return NULL;
00269     if (!LoadARBVertexProgram("shaders/diffuse2_arb.vp", diffuse_2light))
00270         return NULL;
00271     if (!LoadARBVertexProgram("shaders/haze2_arb.vp", diffuseHaze_2light))
00272         return NULL;
00273     if (!LoadARBVertexProgram("shaders/diffuse_texoff2_arb.vp", diffuseTexOffset_2light))
00274         return NULL;
00275     if (!LoadARBVertexProgram("shaders/specular2_arb.vp", specular_2light))
00276         return NULL;
00277     if (!LoadARBVertexProgram("shaders/night2_arb.vp", nightLights_2light))
00278         return NULL;
00279 
00280     // Load vertex programs that are only required with fragment programs
00281     if (ExtensionSupported("GL_NV_fragment_program") ||
00282         ExtensionSupported("GL_ARB_fragment_program"))
00283     {
00284         if (!LoadARBVertexProgram("shaders/multishadow_arb.vp", multiShadow))
00285             return NULL;
00286         if (!LoadARBVertexProgram("shaders/texphong_arb.vp", perFragmentSpecular))
00287             return NULL;
00288         if (!LoadARBVertexProgram("shaders/texphong_alpha_arb.vp", perFragmentSpecularAlpha))
00289             return NULL;
00290     }
00291 
00292     if (!LoadARBVertexProgram("shaders/ell_galaxy_arb.vp", ellipticalGalaxy))
00293         return NULL;
00294 
00295     cout << _("All ARB vertex programs loaded successfully.\n");
00296 
00297     return new VertexProcessorARB();
00298 }

VertexProcessor * vp::initNV  ) 
 

Definition at line 199 of file vertexprog.cpp.

References _, vp::diffuse, vp::diffuse_2light, vp::diffuseBump, vp::diffuseBumpHaze, vp::diffuseHaze, vp::diffuseHaze_2light, vp::diffuseTexOffset, vp::diffuseTexOffset_2light, vp::everything, GL_IDENTITY_NV, GL_INVERSE_TRANSPOSE_NV, GL_MODELVIEW_PROJECTION_NV, GL_VERTEX_PROGRAM_NV, glx::glTrackMatrixNV, LoadNvVertexProgram(), vp::nightLights, vp::ringIllum, vp::ringShadow, vp::shadowTexture, vp::specular, and vp::specular_2light.

Referenced by GLContext::init().

00200 {
00201     cout << _("Initializing NV vertex programs . . .\n");
00202     if (!LoadNvVertexProgram("shaders/diffuse.vp", diffuse))
00203         return NULL;
00204     if (!LoadNvVertexProgram("shaders/specular.vp", specular))
00205         return NULL;
00206     if (!LoadNvVertexProgram("shaders/haze.vp", diffuseHaze))
00207         return NULL;
00208     if (!LoadNvVertexProgram("shaders/bumpdiffuse.vp", diffuseBump))
00209         return NULL;
00210     if (!LoadNvVertexProgram("shaders/bumphaze.vp", diffuseBumpHaze))
00211         return NULL;
00212     if (!LoadNvVertexProgram("shaders/shadowtex.vp", shadowTexture))
00213         return NULL;
00214     if (!LoadNvVertexProgram("shaders/diffuse_texoff.vp", diffuseTexOffset))
00215         return NULL;
00216     if (!LoadNvVertexProgram("shaders/rings.vp", ringIllum))
00217         return NULL;
00218     if (!LoadNvVertexProgram("shaders/ringshadow.vp", ringShadow))
00219         return NULL;
00220     if (!LoadNvVertexProgram("shaders/night.vp", nightLights))
00221         return NULL;
00222     // if (!LoadNvVertexProgram("shaders/comet.vp", cometTail))
00223     //    return false;
00224 
00225     // Two light shaders have only been written for the ARB vertex program path
00226     // Fall back to the the one light versions.
00227     diffuse_2light = diffuse;
00228     diffuseHaze_2light = diffuseHaze;
00229     diffuseTexOffset_2light = diffuseTexOffset;
00230     specular_2light = specular;
00231 
00232     everything = 0;
00233     cout << _("All NV vertex programs loaded successfully.\n");
00234 
00235     glx::glTrackMatrixNV(GL_VERTEX_PROGRAM_NV,
00236                          0, GL_MODELVIEW_PROJECTION_NV, GL_IDENTITY_NV);
00237     glx::glTrackMatrixNV(GL_VERTEX_PROGRAM_NV,
00238                          4, GL_MODELVIEW_PROJECTION_NV, GL_INVERSE_TRANSPOSE_NV);
00239 
00240     return new VertexProcessorNV();
00241 }

void arbvp::parameter unsigned  int,
const float * 
 

Definition at line 365 of file vertexprog.cpp.

References GL_VERTEX_PROGRAM_ARB, and glx::glProgramEnvParameter4fvARB.

00366 {
00367     glx::glProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB, param, fv);
00368 }

void arbvp::parameter unsigned  int,
float  ,
float  ,
float  ,
float 
 

Definition at line 360 of file vertexprog.cpp.

References GL_VERTEX_PROGRAM_ARB, and glx::glProgramEnvParameter4fARB.

00361 {
00362     glx::glProgramEnvParameter4fARB(GL_VERTEX_PROGRAM_ARB, param, x, y, z, w);
00363 }

void arbvp::parameter unsigned  int,
const Color
 

Definition at line 354 of file vertexprog.cpp.

References GL_VERTEX_PROGRAM_ARB, and glx::glProgramEnvParameter4fARB.

00355 {
00356     glx::glProgramEnvParameter4fARB(GL_VERTEX_PROGRAM_ARB, param,
00357                                    c.red(), c.green(), c.blue(), c.alpha());
00358 }

void arbvp::parameter unsigned  int,
const Point3f
 

Definition at line 348 of file vertexprog.cpp.

References GL_VERTEX_PROGRAM_ARB, and glx::glProgramEnvParameter4fARB.

00349 {
00350     glx::glProgramEnvParameter4fARB(GL_VERTEX_PROGRAM_ARB, param,
00351                                     p.x, p.y, p.z, 0.0f);
00352 }

void arbvp::parameter unsigned  int,
const Vec3f
 

Definition at line 342 of file vertexprog.cpp.

References GL_VERTEX_PROGRAM_ARB, and glx::glProgramEnvParameter4fARB.

00343 {
00344     glx::glProgramEnvParameter4fARB(GL_VERTEX_PROGRAM_ARB, param,
00345                                     v.x, v.y, v.z, 0.0f);
00346 }

void vp::parameter unsigned  int,
float  ,
float  ,
float  ,
float 
 

Definition at line 335 of file vertexprog.cpp.

References GL_VERTEX_PROGRAM_NV, and glx::glProgramParameter4fNV.

00336 {
00337     glx::glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, param, x, y, z, w);
00338 }

void vp::parameter unsigned  int,
const Color
 

Definition at line 329 of file vertexprog.cpp.

References GL_VERTEX_PROGRAM_NV, and glx::glProgramParameter4fNV.

00330 {
00331     glx::glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, param,
00332                                 c.red(), c.green(), c.blue(), c.alpha());
00333 }

void vp::parameter unsigned  int,
const Point3f
 

Definition at line 324 of file vertexprog.cpp.

References GL_VERTEX_PROGRAM_NV, and glx::glProgramParameter4fNV.

00325 {
00326     glx::glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, param, p.x, p.y, p.z, 0.0f);
00327 }

void vp::parameter unsigned  int,
const Vec3f
 

Definition at line 319 of file vertexprog.cpp.

References GL_VERTEX_PROGRAM_NV, and glx::glProgramParameter4fNV.

Referenced by Mesh3DS::render().

00320 {
00321     glx::glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, param, v.x, v.y, v.z, 0.0f);
00322 }

void vp::use unsigned  int  ) 
 

Definition at line 313 of file vertexprog.cpp.

References GL_VERTEX_PROGRAM_NV, and glx::glBindProgramNV.

00314 {
00315     glx::glBindProgramNV(GL_VERTEX_PROGRAM_NV, prog);
00316 }


Variable Documentation

unsigned int vp::cometTail = 0
 

Definition at line 32 of file vertexprog.cpp.

unsigned int vp::diffuse = 0
 

Definition at line 21 of file vertexprog.cpp.

Referenced by vp::initARB(), vp::initNV(), and setLightParameters_VP().

unsigned int vp::diffuse_2light = 0
 

Definition at line 37 of file vertexprog.cpp.

Referenced by vp::initARB(), and vp::initNV().

unsigned int vp::diffuseBump = 0
 

Definition at line 24 of file vertexprog.cpp.

Referenced by vp::initARB(), and vp::initNV().

unsigned int vp::diffuseBumpHaze = 0
 

Definition at line 25 of file vertexprog.cpp.

Referenced by vp::initARB(), and vp::initNV().

unsigned int vp::diffuseHaze = 0
 

Definition at line 23 of file vertexprog.cpp.

Referenced by vp::initARB(), and vp::initNV().

unsigned int vp::diffuseHaze_2light = 0
 

Definition at line 38 of file vertexprog.cpp.

Referenced by vp::initARB(), and vp::initNV().

unsigned int vp::diffuseTexOffset = 0
 

Definition at line 29 of file vertexprog.cpp.

Referenced by vp::initARB(), and vp::initNV().

unsigned int vp::diffuseTexOffset_2light = 0
 

Definition at line 39 of file vertexprog.cpp.

Referenced by vp::initARB(), and vp::initNV().

unsigned int vp::ellipticalGalaxy = 0
 

Definition at line 42 of file vertexprog.cpp.

Referenced by vp::initARB().

unsigned int vp::everything = 0
 

Definition at line 28 of file vertexprog.cpp.

Referenced by vp::initNV().

unsigned int vp::glossMap = 0
 

Definition at line 34 of file vertexprog.cpp.

Referenced by vp::initARB().

unsigned int vp::multiShadow = 0
 

Definition at line 27 of file vertexprog.cpp.

Referenced by vp::initARB().

unsigned int vp::nightLights = 0
 

Definition at line 33 of file vertexprog.cpp.

Referenced by vp::initARB(), and vp::initNV().

unsigned int vp::nightLights_2light = 0
 

Definition at line 41 of file vertexprog.cpp.

Referenced by vp::initARB().

unsigned int vp::perFragmentSpecular = 0
 

Definition at line 35 of file vertexprog.cpp.

Referenced by vp::initARB().

unsigned int vp::perFragmentSpecularAlpha = 0
 

Definition at line 36 of file vertexprog.cpp.

Referenced by vp::initARB().

unsigned int vp::ringIllum = 0
 

Definition at line 30 of file vertexprog.cpp.

Referenced by vp::initARB(), and vp::initNV().

unsigned int vp::ringShadow = 0
 

Definition at line 31 of file vertexprog.cpp.

Referenced by vp::initARB(), and vp::initNV().

unsigned int vp::shadowTexture = 0
 

Definition at line 26 of file vertexprog.cpp.

Referenced by vp::initARB(), and vp::initNV().

unsigned int vp::specular = 0
 

Definition at line 22 of file vertexprog.cpp.

Referenced by vp::initARB(), vp::initNV(), and setLightParameters_VP().

unsigned int vp::specular_2light = 0
 

Definition at line 40 of file vertexprog.cpp.

Referenced by vp::initARB(), and vp::initNV().


Generated on Sat Jan 14 22:31:30 2006 for Celestia by  doxygen 1.4.1