Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Outerra Tech Demo download. Help with graphics driver issues

Author Topic: How to add lights shader  (Read 2085 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: 962
    • 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: 701
  • 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: 580
  • 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)

i7(960)4x4.0GHz,16Gb-RAM,GTX980Ti(6Gb),Xonar-Phoebus-7.1,2x500Gb/SSD,Hotas-Warthog

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

  • Hero Member
  • *****
  • Posts: 606
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