Outerra forum

Anteworld - Outerra Game => Modding: Importer, Tools & Utilities => Topic started by: Elecman on August 15, 2018, 09:28:09 pm

Title: How to add lights shader
Post by: Elecman on August 15, 2018, 09:28:09 pm
I wrote this super fast light shader which is able to render millions of (fake) lights very efficiently:

https://www.youtube.com/watch?v=ANCrgK-O0HY&feature=youtu.be

However, I am not sure if it is possible to add this to Outerra as it is not just a shader but also a special mesh which stores additional data (light direction, intensity, color, etc) in the mesh UV, tangent, and color channels.

You can get the Unity version for free here to have a look:
https://assetstore.unity.com/packages/vfx/shaders/spritelights-46409

If @cameni wants to integrate this system, you are free to do so.
Title: Re: How to add lights shader
Post by: Acetone on August 16, 2018, 05:38:12 am
Oh wow! Impressive work  :D
Title: Re: How to add lights shader
Post by: KW71 on August 16, 2018, 12:55:34 pm
Nice!!!!
Title: Re: How to add lights shader
Post by: Revolver on August 18, 2018, 05:17:38 am
Looks very good! Thanks!
Title: Re: How to add lights shader
Post by: Bob425 on August 18, 2018, 05:52:04 am
Very Impressive|||||
Title: Re: How to add lights shader
Post by: fly77 on December 07, 2018, 02:57:18 pm
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: [Select]


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){
 
 
}



(https://uc1a0ff48374e419e249ca3ffa00.previews.dropboxusercontent.com/p/thumb/AARWhWenCp4ggdULUqU8FxQ1vao9gwQZEdIPMJOrH1DblpdgmrWipdEC6ovmbPnhtEFmZq0ZgkvNv-mPOruQ3g7TScLE3Y4ONXtsbPbSUs81gvA5IeDqmLc8TYU9CWk_Ok_RA9wQgqDu36pSoz0qJoiUt-b--HtRk3N5RHW4HKGSbQ1DzH26ZdcbWUwu66_I7cKm8NN2JcfdEPG72J6Zw83oQsk8SaJTEHzmriB1oxRBvw/p.jpeg?size=2048x1536&size_mode=3)