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

ShaderProperties Class Reference

#include <shadermanager.h>

List of all members.

Public Types

enum  {
  DiffuseTexture = 0x01, SpecularTexture = 0x02, NormalTexture = 0x04, NightTexture = 0x08,
  SpecularInDiffuseAlpha = 0x10, RingShadowTexture = 0x20
}
enum  { DiffuseModel = 0, SpecularModel = 1, RingIllumModel = 2 }

Public Member Functions

unsigned int getShadowCountForLight (unsigned int) const
bool hasShadowsForLight (unsigned int) const
void setShadowCountForLight (unsigned int, unsigned int)
 ShaderProperties ()
bool usesFragmentLighting () const
bool usesShadows () const

Public Attributes

unsigned short lightModel
unsigned short nLights
unsigned short shadowCounts
unsigned short texUsage


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
DiffuseTexture 
SpecularTexture 
NormalTexture 
NightTexture 
SpecularInDiffuseAlpha 
RingShadowTexture 

Definition at line 27 of file shadermanager.h.

00028  {
00029      DiffuseTexture         = 0x01,
00030      SpecularTexture        = 0x02,
00031      NormalTexture          = 0x04,
00032      NightTexture           = 0x08,
00033      SpecularInDiffuseAlpha = 0x10,
00034      RingShadowTexture      = 0x20,
00035  };

anonymous enum
 

Enumeration values:
DiffuseModel 
SpecularModel 
RingIllumModel 

Definition at line 37 of file shadermanager.h.

00038  {
00039      DiffuseModel     = 0,
00040      SpecularModel    = 1,
00041      RingIllumModel   = 2,
00042  };


Constructor & Destructor Documentation

ShaderProperties::ShaderProperties  ) 
 

Definition at line 44 of file shadermanager.cpp.

00044                                    :
00045     nLights(0),
00046     texUsage(0),
00047     lightModel(DiffuseModel),
00048     shadowCounts(0)
00049 {
00050 }


Member Function Documentation

unsigned int ShaderProperties::getShadowCountForLight unsigned  int  )  const
 

Definition at line 74 of file shadermanager.cpp.

References shadowCounts.

Referenced by hasShadowsForLight().

00075 {
00076     return (shadowCounts >> i * 2) & 3;
00077 }

bool ShaderProperties::hasShadowsForLight unsigned  int  )  const
 

Definition at line 94 of file shadermanager.cpp.

References getShadowCountForLight(), RingShadowTexture, and texUsage.

00095 {
00096     assert(light < MaxShaderLights);
00097     return ((getShadowCountForLight(light) != 0) ||
00098             (texUsage & RingShadowTexture));
00099 }

void ShaderProperties::setShadowCountForLight unsigned  int,
unsigned  int
 

Definition at line 81 of file shadermanager.cpp.

References shadowCounts.

Referenced by GLSL_RenderContext::makeCurrent(), renderClouds_GLSL(), renderRings_GLSL(), and renderSphere_GLSL().

00082 {
00083     assert(n < MaxShaderShadows);
00084     assert(light < MaxShaderLights);
00085     if (n <= MaxShaderShadows && light < MaxShaderLights)
00086     {
00087         shadowCounts &= ~(3 << light * 2);
00088         shadowCounts |= n << light * 2;
00089     }
00090 }

bool ShaderProperties::usesFragmentLighting  )  const
 

Definition at line 64 of file shadermanager.cpp.

References NormalTexture, and texUsage.

00065 {
00066     if ((texUsage & NormalTexture) != 0)
00067         return true;
00068     else
00069         return false;
00070 }

bool ShaderProperties::usesShadows  )  const
 

Definition at line 54 of file shadermanager.cpp.

References RingShadowTexture, shadowCounts, and texUsage.

00055 {
00056     if ((texUsage & RingShadowTexture) != 0 || shadowCounts != 0)
00057         return true;
00058     else
00059         return false;
00060 }


Member Data Documentation

unsigned short ShaderProperties::lightModel
 

Definition at line 47 of file shadermanager.h.

Referenced by GLSL_RenderContext::makeCurrent(), renderRings_GLSL(), and renderSphere_GLSL().

unsigned short ShaderProperties::nLights
 

Definition at line 45 of file shadermanager.h.

Referenced by GLSL_RenderContext::makeCurrent(), renderClouds_GLSL(), renderRings_GLSL(), and renderSphere_GLSL().

unsigned short ShaderProperties::shadowCounts
 

Definition at line 50 of file shadermanager.h.

Referenced by getShadowCountForLight(), GLSL_RenderContext::makeCurrent(), renderClouds_GLSL(), renderSphere_GLSL(), setShadowCountForLight(), and usesShadows().

unsigned short ShaderProperties::texUsage
 

Definition at line 46 of file shadermanager.h.

Referenced by hasShadowsForLight(), GLSL_RenderContext::makeCurrent(), renderClouds_GLSL(), renderRings_GLSL(), renderSphere_GLSL(), usesFragmentLighting(), and usesShadows().


The documentation for this class was generated from the following files:
Generated on Sat Jan 14 22:33:35 2006 for Celestia by  doxygen 1.4.1