Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Download Outerra Tech Demo. Unofficial Outerra Discord server, MicroProse Discord server for OWS.

Author Topic: How to add lights shader  (Read 10791 times)

Elecman

  • Jr. Member
  • *
  • Posts: 14
  • newbie
How to add lights shader
« 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.
Logged

Acetone

  • Hero Member
  • *****
  • Posts: 963
    • Youtube channel
Re: How to add lights shader
« Reply #1 on: August 16, 2018, 05:38:12 am »

Oh wow! Impressive work  :D
Logged

KW71

  • Outerra Developer
  • Hero Member
  • *****
  • Posts: 762
  • Love OT!
Re: How to add lights shader
« Reply #2 on: August 16, 2018, 12:55:34 pm »

Nice!!!!
Logged
"A man who is contented with what he has done, will never become famous for what he will do".

Revolver

  • Hero Member
  • *****
  • Posts: 672
  • Adlerhorst-Hangar Design Group ©
Re: How to add lights shader
« Reply #3 on: August 18, 2018, 05:17:38 am »

Looks very good! Thanks!
Logged
"Es gibt nur eine Sünde, die gegen die ganze Menschheit mit allen ihren Geschlechtern begangen
werden kann, und dies ist die Verfälschung der Geschichte."(F.Hebbel)


Bob425

  • Jr. Member
  • *
  • Posts: 45
Re: How to add lights shader
« Reply #4 on: August 18, 2018, 05:52:04 am »

Very Impressive|||||
Logged

fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1761
Re: How to add lights shader
« Reply #5 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){
 
 
}



« Last Edit: December 07, 2018, 03:38:33 pm by fly77 »
Logged