Probe Light

From Serious Sam Wiki
Jump to: navigation, search
Editor model of unbaked CProbeLightEntity.
Editor model of baked CProbeLightEntity in a room with applied shaders.

General information

Class: CProbeLightEntity

The Probe Light is probably the second most important thing you could come across in SED3/3.5/4, what it does is basically add complex ambient lightning, it generates a cube-map and uses it to add more realistic lightning on the objects in it's area, it also uses that cube-map to add reflections on stuff.


Properties

Parent part (IDENT)

If the parent has more than one moving part this property defines which part the probe light is parented to.


Size (Vector3f)

This let's you declare the area of effect the Probe Light will have, any thing within this area will get affected by the Probe light.


Preview Size (FLOAT)

This simple sets the size of the editor model of the Probe Light.


Render Preview (BOOL)

This defines if the Probe Light's spheres will appear in game as well, not sure why you would need that, but it's there just in case.


Reflection Texture Size (INDEX)

This sets the size of the generated cube-map, by default it's set to -1, witch means that the cube-map will have a texture size of 32 with and 32 height. That's good for most cases, but if you're making a custom probe light for a specific model, that you want to have dramatic reflections, let's say a water puddle on a street, reflecting the windows of houses,at low CPU costs, you could set it to let's say 64 or 128.


Info 16x16.png Note: The size should always be 32,64,128,256 or 512 anything else will probably crash the editor, or make odd errors on players with older graphic cards.

Export to GI (BOOL)

This is used for Global Illumination renders, usually I have it off. It tells the GI baker weather to use the ambient lightning, generated from the Probe Light, in it's renders.


Probe Light (CProbeResource)

This contains the core of the Probe Light expanding it you'll find:


   Reflection Texture (CDynamicLightMultiContentTexture)
      This is the cube-map texture, when you render it, you'll get a local texture in this option. You could even save it, if you want.
   Ambient modulator (FLOAT) 
      Changes probe light ambient affecting strength.
   Diffuse Contrast (FLOAT)
      This sets how much does the probe light affect the ambient lightning, by default it's set to 1, this means a very averaged, and pale affect, usually will result in a single color evenly spread on all sides, higher values, will result in a more contrast ambient lightning, so if you have a dark room, with a bright window, sides that point to the window will be brighter than the ones pointing to the darker walls of the room.
Spawn flags (LFLAGS)

Defines in which difficulty levels and game types the Probe light is spawned.


Name (CString)

Defines the name of the Probe light.


Defines a entity pointer to the parent of the Probe light.


Platforms (LFLAGS)

Defines on which platforms the Probe light is spawned.


Entity ID (ULONG)

Displays the entity ID of the Probe light.


Info 16x16.png Note: Entity ID cannot be edited.

Script Functions

Methods

Info 16x16.png Note: Probe Light doesn't have native methods.

CBaseEntity Methods
Name Parameters Return Data Type Description
Name Data Type
ApplyDamageTool
SEd3.5 or higher
DamageSource CString void To do: Add description
DamageType CString
WeaponIndex WeaponIndex
CharacterClass IDENT
Damage SLONG
EnableReceiveDamageScriptEvent
SEd3.5 or higher
- void Enables ReceiveDamage script events (see below).
Warning 16x16.png Warning: This function disables native damage handling.
EnableTouchAutoMoveTarget
SEd4.0 only
Enabled BOOL void Enables the entity to become an auto move target.
GetAngularVelocity - Vector3f Returns angular velocity of the entity in Vector3f format.
GetAttachmentAbsolutePlacement Attachment IDENT QuatVect Returns placement of attachment in relation to World Spawn in QuatVect format.
GetAttachmentRelativePlacement Attachment IDENT QuatVect Returns placement of attachment in relation to entity in QuatVect format.
GetClassName
SEd3.5 or higher
- CString Returns classname in CString format.
GetLinearVelocity - Vector3f Returns linear velocity of entity in Vector3f format.
GetName - CString Returns the name of the entity in CString format.
GetParent Name IDENT Handle Returns a CBaseEntity handle of the parent of the entity.
GetPlacement - QuatVect Returns position and orientation of the entity in QuatVect format.
GetWorld
SEd3.5 or higher
- CWorld* To do: Add description
GetWorldInfo
SEd3.5 or higher
- CWorldInfoEntity* To do: Add description
InflictDamage Amount SLONG void Inflicts damage to entity.
InflictDamageOfType Amount SLONG void Inflicts damage of a specified damage type to entity.
DamageType CString
InflictDamageToTarget
SEd3.5 or higher
Target Handle void To do: Add description
Amount SLONG
Weapon IDENT
DamageType CString
InflictWeaponDamage
SEd3.5 only
Amount SLONG void To do: Add description
Weapon IDENT
DamageType CString
IsDestroyed - BOOL Returns 1 if entity is destroyed.
IsReceiveDamageScriptEventEnabled
SEd3.5 or higher
- BOOL Returns 1 if ReceiveDamageScriptEvent is enabled (see above).
SetAngularVelocity AngVelocity Vector3f void Sets angular velocity of entity to the specified Vector3f value.
SetLinearVelocity Velocity Vector3f void Sets the velocity of the entity to the specifed Vector3f values.
SetPlacement Placement QuatVect void Sets position and orientation of the entity to the specified QuatVect values.

Events

Destroyed
Triggers when the Probe light is destroyed.
EntityDeleted → SEd3.5 or higher
Triggers when the Probe light is deleted.
ReceiveDamage → SEd3.5 or higher
Triggers when the Probe light receives damage.
Info 16x16.png Note: This event requires enabling via EnableReceiveDamageScriptEvent method.

Other Information

  • When you add one of these it is represented by a white sphere, and when you bake it (Shift + B) another sphere will appear above the white one, showing you the baked cube-map. Now this is useful, because you could judge the ambient light of that Probe Light, by looking at the white sphere , witch is set to be affected only by the ambient light the Probe Light makes. And the shiny one above it shows you what reflection texture entities, in the range of the Probe Light, will have.
  • Usually though you don't really need to modify any of these options, apart maybe from the "Diffuse Contrast" and the Size of the reflection texture.
  • You can have Probe Lights in a Probe Light, meaning that you can have a probe with a very large range, and many smaller ones within it, that will work, and is useful for large levels, you could have large scale probe lights for out door terrains, and small ones in houses or caves.
  • Another thing to note is that you don't have to be perfect with aligning the probe lights's ranges, you can have overlapping ranges, it won't matter.

Related Pages and Links