9.19 Light
On this page:
9.19.1 Examples
9.19.1.1 Simple searchlight example
9.19.1.2 Multiple lights example

9.19 Light

Sets up a light source for your scene, overriding the default white-light that is applied. You can setup tinted ambient lights, spot lights, and such using this effect.

Light is divided into three components. Ambient Light, Specular light and Diffuse light.
  • Ambient light can be defined as the background light. One good example is a room with the curtains pulled.

  • Diffuse light can be defined as light coming on one specific direction. One good example is a lamp. Most of the light is seen to come from the bulb.

  • Specular light can be defined as concentrated light. It has one specific source (like a lamp) with the additional condition that it is reflected off surfaces in one particular direction.

Please refer to the Blue Book Chapter 5 for more information.

 

Parameters

 

Default

 

Range    

 

Description

 

LightNumber

 

0

 

0 to 13

 

The light number. You can have a maximum of 13 different lights at any given time operating simulteanously

 

 

 

 

 

LightAmbientR

 

1.0

 

(0.0 - 1.0)

 

The red component of the ambient light

 

 

 

 

 

LightAmbientG

 

1.0

 

(0.0 - 1.0)

 

The blue component of the ambient light

 

 

 

 

 

LightAmbientB

 

1.0

 

(0.0 - 1.0)

 

The green component of the ambient light

 

 

 

 

 

LightDiffuseR

 

0.0

 

(0.0 - 1.0)

 

The red component of the diffuse light

 

 

 

 

 

LightDiffuseG

 

0.0

 

(0.0 - 1.0)

 

The blue component of the diffuse light

 

 

 

 

 

LightDiffuseB

 

0.0

 

(0.0 - 1.0)

 

The green component of the diffuse light

 

 

 

 

 

LightSpecularR

 

0.0

 

(0.0 - 1.0)

 

The red component of the specular light

 

 

 

 

 

LightSpecularG

 

0.0

 

(0.0 - 1.0)

 

The blue component of the specular light

 

 

 

 

 

LightSpecularB

 

0.0

 

(0.0 - 1.0)

 

The green component of the specular light

 

 

 

 

 

PositionDirection

 

1.0

 

(0.0,1.0)

 

  • 0: LightX, LightY and LightZ refer to the direction of the light

  • 1: LightX, LightY and LightZ refer to the position of the light

 

 

 

 

 

LightX

 

0.0

 

n/a

 

The x position or direction of the light

 

 

 

 

 

LightY

 

0.0

 

n/a

 

The y position or direction of the light

 

 

 

 

 

LightZ

 

3.0

 

n/a

 

The z position or direction of the light

 

 

 

 

 

SpotDirectionX

 

0.0

 

n/a

 

The x direction of the light. SpotDirectionX,Y,Z are used when PositionDirection is set to 0.0

 

 

 

 

 

SpotDirectionY

 

0.0

 

n/a

 

The y direction of the light

 

 

 

 

 

SpotDirectionZ

 

-1.0

 

n/a

 

The z direction of the light

 

 

 

 

 

SpotConstantAttenuation

 

1.0

 

n/a

 

The rate at which the light dies out, this value is added to SpotLinearAttenuation

 

 

 

 

 

SpotLinearAttenuation

 

0.0

 

n/a

 

The rate at which the light dies out with respect to distance

 

 

 

 

 

SpotCutOff

 

90.0

 

0.0 - 180.0

 

The field-of-view in angles of the spotlight

 

 

 

 

 

SpotFlicker

 

0.0

 

>= 0.0

 

The range within which we allow the SpotExponent to randomly vary, For example, if the SpotExponent is 60.0 and the SpotFlicker is 1.0, then the SpotExponent will randomly vary with the range ( 59.0 - 61.0 ), This parameter is useful if we want to create an OldMovie type flickering effect of the light

 

 

 

 

 

DefaultMaterialColor

 

1

 

{0,1}

 

0 means we paint the material with calls to glColor, 1 means we paint the material using the "Material" effect

Input pattern: (A)

9.19.1 Examples
9.19.1.1 Simple searchlight example
; muSE v2
; My Searchlight style
 
(style-parameters)
 
(segment-durations 8.0)
 
(define muvee-global-effect (effect-stack
                                (effect "Perspective" (A))
                                (effect "CropMedia" (A))))
 
(define muvee-segment-effect (effect-stack
                              (effect "Light" (A)
                                      (param "SpotDirectionX" -0.5 (linear 0.5  0.5)
                                                                   (linear 1.0 -0.5)))
                              (effect "Material" (A))))

This style uses an effect-stack. The above style creates a search light that moves across the screen from left to right. Do note that we also include the material effect in the example. This effect just breaks up our image into a small grid and sets some additional image surface parameters to make the effect work well.

9.19.1.2 Multiple lights example
; muSE v2
; My super colorful style
 
(style-parameters)
 
(segment-durations 8.0)
 
(define muvee-global-effect (effect-stack
                                (effect "Perspective" (A))
                                (effect "CropMedia" (A))))
 
(define muvee-segment-effect (effect-stack
                                        (effect "Light" (A)
                                                (param "LightNumber" 4))
                                        (effect "Light" (A)
                                                (param "LightNumber" 3)
                                                (param "LightAmbientB" 0.0)
                                                (param "LightAmbientG" 0.0)
                                                (param "SpotDirectionX"  0.0)
                                                (param "SpotDirectionY"  0.5 (linear 1.0  -0.5)))
                                        (effect "Light" (A)
                                                (param "LightNumber" 2)
                                                (param "LightAmbientB" 0.0)
                                                (param "LightAmbientG" 0.5)
                                                (param "SpotDirectionX"  0.5 (linear 0.5  0.5)
                                                                             (linear 1.0 -0.5))
                                                (param "SpotDirectionY"  0.5 (linear 0.5  0.5)
                                                                             (linear 1.0 -0.5)))
                                        (effect "Light" (A)
                                                (param "LightNumber" 1)
                                                (param "LightAmbientR" 0.0)
                                                (param "LightAmbientG" 0.5)
                                                (param "SpotDirectionY" -0.5 (linear 0.5  0.5)
                                                                             (linear 1.0 -0.5)))
                                        (effect "Light" (A)
                                                (param "LightAmbientR" 0.0)
                                                (param "LightAmbientG" 0.0)
                                                (param "SpotDirectionX" -0.5 (linear 0.5  0.5)
                                                                             (linear 1.0 -0.5)))
                                        (effect "Material" (A))))

The above style creates multiple instances of the Light effect with different colors and moves them across the screen.