Anteworld - Outerra Game > Modding: Importer, Tools & Utilities

How to add lights shader

<< < (2/2)

fly77:
I tried to place 100 spotlights in outerra and it kills my framerates ! I hope there is or will be another way to do it in outerra.


--- Code: ---

var light_z = 7.1;        // corresponds to lantern height
var white ;
var white_range = 1000;



function init_chassis(){
 
  white =  Create2DArray(10,10);     
    var i,j;
    for ( i=0;i<10;i++){
      for (j=0; j<10;j++){     
         white[i][j] = this.add_point_light({ x: 2.45 + j*50, y: i*50, z: light_z }, { color: { x: 0.6, y: 0.6, z: 1 }, size: 0.25, angle: 48, edge: 0.01, intensity: 0, range: white_range, fadeout: 0.0 }); 
      }     
    }
   
     return {mass:100000, com:{ x:0, y:0, z:-1000}};
}


function init_vehicle() {

this.geom = this.get_geomob(0);

  this.set_fps_camera_pos({x:0,y:0,z:3});
 
  var i,j;
    for ( i=0;i<10;i++){
    for (j=0; j<10;j++){                 
     this.light(white[i][j], 1);
     }
  } 
}


function Create2DArray(rows,columns) {
   var x = new Array(rows);
   for (var i = 0; i < rows; i++) {
       x[i] = new Array(columns);
   }
   return x;
}


function update_frame(dt, engine, brake, steering){
 
 
}
--- End code ---



Navigation

[0] Message Index

[*] Previous page

Go to full version