cz.cuni.jagrlib.iface
Interface LightModel

All Superinterfaces:
Property
All Known Implementing Classes:
PhongModel

public interface LightModel
extends Property

Abstract light model (BRDF function).

Since:
0.11
Version:
0.26 $Rev: 476 $ $Date: 2007-06-03 03:11:16 +0200 (ne, 03 VI 2007) $ $Author: pepca $
See Also:
LightModel.java, LightSource

Field Summary
static int COMP_ALL
          Component mask: all components (used with light sources).
static int COMP_DIFFUSE
          Component mask: Diffuse component.
static int COMP_SPEC_REFLECTION
          Component mask: Specular reflection component.
static int COMP_SPEC_REFRACTION
          Component mask: Specular reflection component.
static int COMP_SPECULAR
          Component mask: both specular components (used in ray-tracing).
static String MATERIAL_COLOR
          Common material property: color.
static String MATERIAL_H
          Common material property: specular exponent.
static String MATERIAL_KA
          Common material property: ambient coefficient.
static String MATERIAL_KD
          Common material property: diffuse coefficient.
static String MATERIAL_KS
          Common material property: specular coefficient.
static String MATERIAL_KT
          Common material property: transparency.
static String MATERIAL_N
          Common material property: index of refraction.
 
Fields inherited from interface cz.cuni.jagrlib.iface.Property
LOGGING, STATISTICS, TEXT_DESCRIPTION
 
Method Summary
 double[] colorBRDF(double[] in, double[] out, double[] normal, Property data, int mask, double[] result)
          Returns the requested BRDF sample (BRDF is treated as band-color).
 double[] colorBRDF(MicroFacet mf, double[] in, double[] out, int mask, double[] result)
          Returns the requested BRDF sample (BRDF is treated as band-color).
 Property createMaterial()
          Create material object for the shading model.
 double[] getOrigColor(double[] color, Property data)
          Retrieves the original color (defining surface color).
 double[] lightSum(MicroFacet mf, int order, int total, LightSource[] lights, double[] out, double[] result)
          Accumulates light contributions from set of light sources through the given MicroFacet (point on surface of some solid) to the viewing direction.
 double monoBRDF(double[] in, double[] out, double[] normal, Property data, int mask)
          Returns the requested BRDF sample (BRDF is treated as monochrome).
 double monoBRDF(MicroFacet mf, double[] in, double[] out, int mask)
          Returns the requested BRDF sample (BRDF is treated as monochrome).
 void setColor(double[] color, Property data)
          Sets the actual color (for the given BRDF data).
 
Methods inherited from interface cz.cuni.jagrlib.iface.Property
commit, get, set
 

Field Detail

MATERIAL_COLOR

static final String MATERIAL_COLOR
Common material property: color.

See Also:
Constant Field Values

MATERIAL_KA

static final String MATERIAL_KA
Common material property: ambient coefficient.

See Also:
Constant Field Values

MATERIAL_KD

static final String MATERIAL_KD
Common material property: diffuse coefficient.

See Also:
Constant Field Values

MATERIAL_KS

static final String MATERIAL_KS
Common material property: specular coefficient.

See Also:
Constant Field Values

MATERIAL_H

static final String MATERIAL_H
Common material property: specular exponent.

See Also:
Constant Field Values

MATERIAL_KT

static final String MATERIAL_KT
Common material property: transparency.

See Also:
Constant Field Values

MATERIAL_N

static final String MATERIAL_N
Common material property: index of refraction.

See Also:
Constant Field Values

COMP_DIFFUSE

static final int COMP_DIFFUSE
Component mask: Diffuse component.

See Also:
Constant Field Values

COMP_SPEC_REFLECTION

static final int COMP_SPEC_REFLECTION
Component mask: Specular reflection component.

See Also:
Constant Field Values

COMP_SPEC_REFRACTION

static final int COMP_SPEC_REFRACTION
Component mask: Specular reflection component.

See Also:
Constant Field Values

COMP_SPECULAR

static final int COMP_SPECULAR
Component mask: both specular components (used in ray-tracing).

See Also:
Constant Field Values

COMP_ALL

static final int COMP_ALL
Component mask: all components (used with light sources).

See Also:
Constant Field Values
Method Detail

createMaterial

Property createMaterial()
Create material object for the shading model. All data are initialized to their default values.

Returns:
Data object representing the requested material.

monoBRDF

double monoBRDF(double[] in,
                double[] out,
                double[] normal,
                Property data,
                int mask)
Returns the requested BRDF sample (BRDF is treated as monochrome).

Parameters:
in - Input ray direction (double[3] or double[4]).
out - Output (viewing) ray direction (double[3] or double[4]).
normal - Normal vector of a surface.
data - Non-mandatory data object to hold BRDF state information.
mask - Which light components are to be computed?
Returns:
BRDF coefficient f(in->out).
See Also:
monoBRDF(MicroFacet,double[],double[],int), colorBRDF(double[],double[],double[],Property,int,double[])

monoBRDF

double monoBRDF(MicroFacet mf,
                double[] in,
                double[] out,
                int mask)
Returns the requested BRDF sample (BRDF is treated as monochrome). Computations are done relatively to the given MicroFacet (point on surface of some solid).

Parameters:
mf - The MicroFacet (point on surface of some solid).
in - Input ray direction (double[3] or double[4]).
out - Output (viewing) ray direction (double[3] or double[4]).
mask - Which light components are to be computed?
Returns:
BRDF coefficient f(in->mf->out).
See Also:
monoBRDF(double[],double[],double[],Property,int), colorBRDF(MicroFacet,double[],double[],int,double[]), MicroFacet.material

colorBRDF

double[] colorBRDF(double[] in,
                   double[] out,
                   double[] normal,
                   Property data,
                   int mask,
                   double[] result)
Returns the requested BRDF sample (BRDF is treated as band-color).

Parameters:
in - Input ray direction (double[3] or double[4]).
out - Output (viewing) ray direction (double[3] or double[4]).
normal - Normal vector of a surface.
data - Non-mandatory data object to hold BRDF state information.
mask - Which light components are to be computed?
result - Pre-allocated double[C] array to hold BRDF coefficients f(in->out) (C can be either 1 /for monochrome computing/, 3 /for RGB color system/ or greater /for more complex spectral color sampling/). Can be null.
Returns:
Output BRDF spectral coefficients.
See Also:
monoBRDF(double[],double[],double[],Property,int), colorBRDF(MicroFacet,double[],double[],int,double[])

colorBRDF

double[] colorBRDF(MicroFacet mf,
                   double[] in,
                   double[] out,
                   int mask,
                   double[] result)
Returns the requested BRDF sample (BRDF is treated as band-color). Computations are done relatively to the given MicroFacet (point on surface of some solid).

Parameters:
mf - The MicroFacet (point on surface of some solid).
in - Input ray direction (double[3] or double[4]).
out - Output (viewing) ray direction (double[3] or double[4]).
mask - Which light components are to be computed?
result - Pre-allocated double[C] array to hold BRDF coefficients f(in->mf->out) (C can be either 1 /for monochrome computing/, 3 /for RGB color system/ or greater /for more complex spectral color sampling/). Can be null.
Returns:
Output BRDF spectral coefficients.
See Also:
monoBRDF(MicroFacet,double[],double[],int), colorBRDF(double[],double[],double[],Property,int,double[]), MicroFacet.material

lightSum

double[] lightSum(MicroFacet mf,
                  int order,
                  int total,
                  LightSource[] lights,
                  double[] out,
                  double[] result)
Accumulates light contributions from set of light sources through the given MicroFacet (point on surface of some solid) to the viewing direction.

Parameters:
mf - The MicroFacet (point on surface of some solid).
order - Order of this sample inside the actual pixel.
total - Total number of samples in the actual pixel.
lights - Set of light sources that can light the point.
out - Output (viewing) ray direction (double[3] or double[4]).
result - Pre-allocated double[C] array to hold BRDF coefficients f(in->mf->out) (C can be either 1 /for monochrome computing/, 3 /for RGB color system/ or greater /for more complex spectral color sampling/). Can be null, otherwise the initial value will be preseved.
Returns:
Output color coefficients.
See Also:
colorBRDF(MicroFacet,double[],double[],int,double[]), MicroFacet.material

getOrigColor

double[] getOrigColor(double[] color,
                      Property data)
Retrieves the original color (defining surface color).

Parameters:
color - Pre-allocated double[C] array to hold the color (C can be either 1 /for monochrome computing/, 3 /for RGB color system/ or greater /for more complex spectral color sampling/). Can be null.
data - Data object with BRDF state information (optional).
Returns:
Array containing copy of original color (can be altered).

setColor

void setColor(double[] color,
              Property data)
Sets the actual color (for the given BRDF data). This color will be used in subsequent BRDF calculations. The color array won't be altered.

Parameters:
color - Color definition - double[C] array (C can be either 1 /for monochrome computing/, 3 /for RGB color system/ or greater /for more complex spectral color sampling/).
data - Data object with BRDF state information.