2023-08-14 19:22:04 +02:00
|
|
|
function __3dLight() : __3dObject() constructor {
|
2023-08-23 20:01:09 +02:00
|
|
|
UI_vertex = [ array_create(33) ];
|
|
|
|
for( var i = 0; i <= 32; i++ )
|
2023-11-15 02:35:30 +01:00
|
|
|
UI_vertex[0][i] = new __vertex(0, lengthdir_x(0.5, i / 32 * 360), lengthdir_y(0.5, i / 32 * 360), c_white);
|
2023-08-14 19:22:04 +02:00
|
|
|
VB_UI = build(noone, UI_vertex);
|
|
|
|
|
|
|
|
color = c_white;
|
|
|
|
intensity = 1;
|
|
|
|
|
2023-08-22 11:51:45 +02:00
|
|
|
shadow_mapper = sh_d3d_shadow_depth;
|
|
|
|
shadow_active = false;
|
|
|
|
shadow_map = noone;
|
|
|
|
shadow_map_size = 1024;
|
2023-08-23 20:01:09 +02:00
|
|
|
shadow_map_scale = 4;
|
2023-08-22 11:51:45 +02:00
|
|
|
shadow_map_camera = camera_create();
|
|
|
|
shadow_map_view = array_create(16, 0);
|
|
|
|
shadow_map_proj = array_create(16, 0);
|
2023-08-23 20:01:09 +02:00
|
|
|
shadow_bias = 0.001;
|
2023-08-22 11:51:45 +02:00
|
|
|
|
|
|
|
static getCenter = function() { return noone; }
|
|
|
|
static getBBOX = function() { return noone; }
|
|
|
|
|
2023-08-30 16:40:45 +02:00
|
|
|
static submit = function(scene = {}, shader = noone) {}
|
2023-08-22 11:51:45 +02:00
|
|
|
|
|
|
|
static setShadow = function(active, shadowMapSize, shadowMapScale = shadow_map_scale) { #region
|
|
|
|
shadow_active = active;
|
|
|
|
shadow_map_size = shadowMapSize;
|
|
|
|
shadow_map_scale = shadowMapScale;
|
|
|
|
|
|
|
|
return self;
|
|
|
|
} #endregion
|
|
|
|
|
|
|
|
static shadowProjectBegin = function() {}
|
|
|
|
|
|
|
|
static shadowProjectEnd = function() {}
|
|
|
|
|
2023-09-11 16:08:58 +02:00
|
|
|
static submitShadow = function(scene, objects) { #region
|
2023-08-22 11:51:45 +02:00
|
|
|
if(!shadow_active) return;
|
|
|
|
|
|
|
|
shadowProjectBegin();
|
2023-10-08 09:22:01 +02:00
|
|
|
objects.submit(scene, shadow_mapper);
|
2023-08-22 11:51:45 +02:00
|
|
|
shadowProjectEnd();
|
|
|
|
} #endregion
|
2023-08-14 19:22:04 +02:00
|
|
|
}
|