DD::Image::IllumShader Class Reference

This subclass of Material provides some convienence functions so that it is easier to write a lighting surface shader. More...

Inherits DD::Image::Material.

List of all members.

Public Member Functions

 IllumShader (Node *)
int minimum_inputs () const
int maximum_inputs () const
Opdefault_input (int input) const
const char * input_label (int input, char *buffer) const
void knobs (Knob_Callback f)
bool shade_GL (ViewerContext *, GeoInfo &)
void unset_texturemap (ViewerContext *)
void vertex_shader (VertexContext &)
void fragment_shader (const VertexContext &, Pixel &out)

Protected Member Functions

virtual void surface_shader (Vector3 &P, Vector3 &V, Vector3 &N, const VertexContext &, Pixel &surface)=0
void _validate (bool)
void _request (int x, int y, int r, int t, ChannelMask, int count)

Protected Attributes

Channel channel [4]
 Layer to apply shading to.
ChannelSet surface_channels
 ChannelMask built from channel[].

Detailed Description

This subclass of Material provides some convienence functions so that it is easier to write a lighting surface shader.

Base class of illumination shaders that adds convenience functions and a map input for typical lighting shaders.


Constructor & Destructor Documentation

IllumShader::IllumShader ( Node *  node)

Default the shader channels to RGB.

References channel.


Member Function Documentation

Op * IllumShader::default_input ( int  input) const [virtual]

For input 0 it uses the default Material input0. Input 1 is allowed to be NULL so we can test whether it's connected.

Reimplemented from DD::Image::Iop.

const char * IllumShader::input_label ( int  input,
char *  buffer 
) const [virtual]

Input 0 has no label, input 1 is 'map'.

Reimplemented from DD::Image::Op.

void IllumShader::knobs ( Knob_Callback  f) [virtual]

Set up a channel knob for the shader.

Reimplemented from DD::Image::Material.

References channel, and DD::Image::Input_Channel_knob().

bool IllumShader::shade_GL ( ViewerContext ctx,
GeoInfo geo 
) [virtual]

Pass call to input0.

Reimplemented from DD::Image::Material.

References DD::Image::Iop::input0().

void IllumShader::unset_texturemap ( ViewerContext ctx) [virtual]

Pass call to input0.

Reimplemented from DD::Image::Material.

References DD::Image::Iop::input0(), and DD::Image::Iop::unset_texturemap().

void IllumShader::vertex_shader ( VertexContext vtx) [virtual]
virtual void DD::Image::IllumShader::surface_shader ( Vector3 P,
Vector3 V,
Vector3 N,
const VertexContext ,
Pixel surface 
) [protected, pure virtual]

The light shader call. Pure virtual, must be implemented by subclasses.

void IllumShader::_validate ( bool  for_real) [protected, virtual]
void IllumShader::_request ( int  x,
int  y,
int  r,
int  t,
ChannelMask  channels,
int  count 
) [protected, virtual]