Browse Source

Added note about the ElapsedTime built-in shader parameter to documentation.

Lasse Öörni 13 years ago
parent
commit
f5e2be65c1
2 changed files with 4 additions and 1 deletions
  1. 1 1
      Docs/Reference.dox
  2. 3 0
      Engine/Scene/Scene.cpp

+ 1 - 1
Docs/Reference.dox

@@ -626,7 +626,7 @@ When a material defines several techniques for different LOD levels and quality
 - Second most distant & highest quality
 - ...
 
-%Material shader parameters can be floats or vectors up to 4 components. Matrix parameters are not supported.
+%Material shader parameters can be floats or vectors up to 4 components. Matrix parameters are not supported. Note that a built-in ElapsedTime shader parameter is available for implementing material animation effects; it measures the time elapsed in scene updates in seconds.
 
 Default culling mode is counterclockwise. The shadowcull element specifies the culling mode to use in the shadow pass. Note that material's depth bias settings do not apply in the shadow pass; during shadow rendering the light's depth bias is used instead.
 

+ 3 - 0
Engine/Scene/Scene.cpp

@@ -522,6 +522,9 @@ void Scene::Update(float timeStep)
     // Post-update variable timestep logic
     SendEvent(E_SCENEPOSTUPDATE, eventData);
     
+    // Note: using a float for elapsed time accumulation is inherently inaccurate. The purpose of this value is
+    // primarily to update material animation effects, as it is available to shaders. It can be reset by calling
+    // SetElapsedTime()
     elapsedTime_ += timeStep;
 }