aboutsummaryrefslogtreecommitdiff
path: root/js/lib/rdge/runtime/RuntimeMaterial.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/rdge/runtime/RuntimeMaterial.js')
-rw-r--r--js/lib/rdge/runtime/RuntimeMaterial.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/js/lib/rdge/runtime/RuntimeMaterial.js b/js/lib/rdge/runtime/RuntimeMaterial.js
index 294c4787..1bbbc3b1 100644
--- a/js/lib/rdge/runtime/RuntimeMaterial.js
+++ b/js/lib/rdge/runtime/RuntimeMaterial.js
@@ -54,6 +54,10 @@ var RuntimeMaterial = function RuntimeMaterial( world )
54 { 54 {
55 } 55 }
56 56
57 this.import = function( importStr )
58 {
59 }
60
57 this.getPropertyFromString = function( prop, str ) 61 this.getPropertyFromString = function( prop, str )
58 { 62 {
59 var index = str.indexOf( prop ); 63 var index = str.indexOf( prop );
@@ -304,6 +308,35 @@ function RuntimeUberMaterial()
304{ 308{
305} 309}
306 310
311function RuntimePlasmaMaterial()
312{
313 // inherit the members of RuntimeMaterial
314 this.inheritedFrom = RuntimeMaterial;
315 this.inheritedFrom();
316
317 this.init = function( )
318 {
319 this.update();
320 }
321
322 this.update = function( time )
323 {
324 var material = this._materialNode;
325 if (material)
326 {
327 var technique = material.shaderProgram.default;
328 var renderer = g_Engine.getContext().renderer;
329 if (renderer && technique)
330 {
331 if (this._shader && this._shader.default)
332 this._shader.default.u_time.set( [this._time] );
333 this._time += this._dTime;
334 if (this._time > 200.0) this._time = 0.0;
335 }
336 }
337 }
338}
339
307 340
308if (typeof exports === "object") 341if (typeof exports === "object")
309{ 342{
@@ -314,4 +347,5 @@ if (typeof exports === "object")
314 exports.RuntimeLinearGradientMaterial = RuntimeLinearGradientMaterial; 347 exports.RuntimeLinearGradientMaterial = RuntimeLinearGradientMaterial;
315 exports.RuntimeBumpMetalMaterial = RuntimeBumpMetalMaterial; 348 exports.RuntimeBumpMetalMaterial = RuntimeBumpMetalMaterial;
316 exports.RuntimeUberMaterial = RuntimeUberMaterial; 349 exports.RuntimeUberMaterial = RuntimeUberMaterial;
350 exports.RuntimePlasmaMaterial = RuntimePlasmaMaterial;
317} 351}