Tesla Graphics Engine Documentation (January 2012)
LightLogic Class
TeslaTesla.GraphicsLightLogic
Logic that feeds Engine light values into the shader before a renderable is to be drawn. This module is designed to work with the engine's default shader library, although it can be used for custom shaders or replaced outright. An instance of LightLogic is always created with a Material. A unique LightLogic should only be associated with one Material at a given time. GlobalAmbient is expected to be a 3-component float vector. LightCount is expected to be an integer (or float equivalent), and the expected light list is expected to be composed of the following structure:
CopyC#
//Light struct that represents a Point, Spot, or Directional
//light. Point lights are with a 180 degree inner/outer angle,
//and directional lights have their position's w = 1.0 .
struct Light {
  //Color properties
  float3 Ambient;
  float3 Diffuse;
  float3 Specular;

  //Attenuation properties
  bool Attenuate;
  float Constant;
  float Linear;
  float Quadratic;

  //Positional (in world space) properties
  float4 Position; //Note: w = 1 means direction is used
  float3 Direction;
  float InnerAngle;
  float OuterAngle;
};
Declaration Syntax
C#
public class LightLogic : BaseMaterialLogic
Members
All Members Constructors Methods Properties



Icon Member Description
LightLogic()()()()
Initializes a new instance of the LightLogic class with module name "LightLogic".

BindLightParameter(String, LightParameter)
Binds an effect parameter to the light parameter.

BindLightParameter(String, Boolean, LightParameter)
Binds an effect parameter to the light parameter.

Clone()()()()
Clones the logic.
(Overrides BaseMaterialLogic.Clone()()()().)
Equals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Execute(Material, IRenderer, IRenderable)
Execute the logic for the given material and renderable (usually a Mesh).
(Overrides BaseMaterialLogic.Execute(Material, IRenderer, IRenderable).)
Finalize()()()()
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
GetHashCode()()()()
Serves as a hash function for a particular type.
(Inherited from Object.)
GetType()()()()
Gets the Type of the current instance.
(Inherited from Object.)
IsEnabled
Gets or sets if this logic is enabled or not.
(Inherited from BaseMaterialLogic.)
MemberwiseClone()()()()
Creates a shallow copy of the current Object.
(Inherited from Object.)
Name
Gets the logic name which its identified by.
(Inherited from BaseMaterialLogic.)
Read(ISavableReader)
Deserializes the object and populates it from the input.
(Inherited from BaseMaterialLogic.)
ToString()()()()
Returns a String that represents the current Object.
(Inherited from Object.)
UnBindLightParameter(String, LightParameter)
Clears a binding.

Write(ISavableWriter)
Serializes the object and writes it to the output.
(Inherited from BaseMaterialLogic.)
Inheritance Hierarchy
Object
BaseMaterialLogic
  LightLogic

Assembly: Tesla (Module: Tesla) Version: 0.5.0.0 (0.5.0.0)