# osgFX::AnisotropicLighting Class Reference

This single-pass effect implements a sort of anisotropic lighting that replaces the standard OpenGL lighting model. More...

Inheritance diagram for osgFX::AnisotropicLighting:

[legend]
List of all members.

## Public Member Functions

| AnisotropicLighting ()
| AnisotropicLighting (const AnisotropicLighting &copy, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)

META_Effect (osgFX, AnisotropicLighting,"Anisotropic Lighting","This single-pass effect implements a sort of anisotropic ""lighting that replaces the standard OpenGL lighting model.\n""The final color of vertices is not computed directly, it is ""the result of a texture lookup on a user-supplied lighting ""image map. A vertex program is used to compute the s and t ""texture coordinates as follows: s = (N dot H) ; t = (N dot L) ""where N is the vertex normal, L is the light-to-vertex vector, ""H is the half-way vector. This is a good example of how you ""can use the State::getInitialViewMatrix() method to retrieve ""the view matrix and perform view-dependant effects without ""fakes of any kind.\n""This effect requires the ARB_vertex_program extension.","Marco Jez")

osg::Image * | getLightingMap ()
| get the lighting map
const osg::Image * | getLightingMap () const
| get the const lighting map
void | setLightingMap (osg::Image *image)
| set the lighting map
int | getLightNumber () const
| get the OpenGL light number
void | setLightNumber (int n)
| set the OpenGL light number that will be used in lighting computations

## Protected Member Functions

virtual | ~AnisotropicLighting ()
AnisotropicLighting & | operator= (const AnisotropicLighting &)
bool | define_techniques ()
| abstract method to be implemented in derived classes; its purpose if to create the techniques that can be used for obtaining the desired effect.

## Detailed Description

This single-pass effect implements a sort of anisotropic lighting that replaces the standard OpenGL lighting model.

The final color of vertices is not computed directly, it is the result of a texture lookup on a user-supplied lighting image map. A vertex program is used to compute the s and t texture coordinates as follows: s = (N dot H) ; t = (N dot L) where N is the vertex normal, L is the light-to-vertex vector, H is the half-way vector. This is a good example of how you can use the State::getInitialViewMatrix() method to retrieve the view matrix and perform view-dependant effects without fakes of any kind. This effect requires the ARB_vertex_program extension.

## Constructor & Destructor Documentation

AnisotropicLighting::AnisotropicLighting | ( |  | ) |

AnisotropicLighting::AnisotropicLighting | ( | const AnisotropicLighting & | copy,
|  | const osg::CopyOp & | copyop = `osg::CopyOp::SHALLOW_COPY`
| ) |

virtual osgFX::AnisotropicLighting::~AnisotropicLighting | ( |  | ) | `[inline, protected, virtual]`

## Member Function Documentation

bool AnisotropicLighting::define_techniques | ( |  | ) | `[protected, virtual]`

| abstract method to be implemented in derived classes; its purpose if to create the techniques that can be used for obtaining the desired effect. You will usually call addTechnique() inside this method. Implements osgFX::Effect.

const osg::Image * osgFX::AnisotropicLighting::getLightingMap | ( |  | ) | const`[inline]`

| get the const lighting map

osg::Image * osgFX::AnisotropicLighting::getLightingMap | ( |  | ) | `[inline]`

| get the lighting map

int osgFX::AnisotropicLighting::getLightNumber | ( |  | ) | const`[inline]`

| get the OpenGL light number

osgFX::AnisotropicLighting::META_Effect | ( | osgFX | ,
|  | AnisotropicLighting | ,
|  | "Anisotropic Lighting" | ,
|  | "This single-pass effect implements a sort of anisotropic ""lighting that replaces the standard OpenGL lighting model.\n""The final color of vertices is not computed | directly,
|  | it is""the result of a texture lookup on a user-supplied lighting""image map.A vertex program is used to compute the s and t""texture coordinates as follows:s | = `(N dot H) ; t = (N dot L) ""where N is the vertex normal`,
|  | L is the light-to-vertex | vector,
|  | ""H is the half-way vector.This is a good example of how you""can use the State::getInitialViewMatrix() method to retrieve""the view matrix and perform view-dependant effects without""fakes of any kind.\n""This effect requires the ARB_vertex_program extension." | ,
|  | "Marco Jez" |
| ) |

AnisotropicLighting& osgFX::AnisotropicLighting::operator= | ( | const AnisotropicLighting & |  | ) | `[inline, protected]`

void osgFX::AnisotropicLighting::setLightingMap | ( | osg::Image * | image | ) | `[inline]`

| set the lighting map

void osgFX::AnisotropicLighting::setLightNumber | ( | int | n | ) | `[inline]`

| set the OpenGL light number that will be used in lighting computations

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

- AnisotropicLighting
- AnisotropicLighting.cpp