diff options
author | reduz <reduzio@gmail.com> | 2021-01-08 13:03:09 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2021-01-19 23:31:02 +0100 |
commit | 7008e3c6eafa374e5d64ee7867608abe696698c2 (patch) | |
tree | 5332b4257a22a56f11bb30abfc507a219cf456a4 /servers/rendering/renderer_rd/shaders/cluster_data_inc.glsl | |
parent | 53e234fe5fa9e54372c897e4409dce9f4b3b1fe7 (diff) |
Shader optimizations to reduce VGPR usage and increase occupancy
Diffstat (limited to 'servers/rendering/renderer_rd/shaders/cluster_data_inc.glsl')
-rw-r--r-- | servers/rendering/renderer_rd/shaders/cluster_data_inc.glsl | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/servers/rendering/renderer_rd/shaders/cluster_data_inc.glsl b/servers/rendering/renderer_rd/shaders/cluster_data_inc.glsl index e723468dd8..3a4bf4da07 100644 --- a/servers/rendering/renderer_rd/shaders/cluster_data_inc.glsl +++ b/servers/rendering/renderer_rd/shaders/cluster_data_inc.glsl @@ -6,12 +6,18 @@ struct LightData { //this structure needs to be as packed as possible vec3 position; float inv_radius; + vec3 direction; float size; - uint attenuation_energy; //attenuation - uint color_specular; //rgb color, a specular (8 bit unorm) - uint cone_attenuation_angle; // attenuation and angle, (16bit float) - uint shadow_color_enabled; //shadow rgb color, a>0.5 enabled (8bit unorm) + + vec3 color; + float attenuation; + + float cone_attenuation; + float cone_angle; + float specular_amount; + bool shadow_enabled; + vec4 atlas_rect; // rect in the shadow atlas mat4 shadow_matrix; float shadow_bias; @@ -34,9 +40,13 @@ struct ReflectionData { float index; vec3 box_offset; uint mask; - vec4 params; // intensity, 0, interior , boxproject vec3 ambient; // ambient color + float intensity; + bool exterior; + bool box_project; uint ambient_mode; + uint pad; + //0-8 is intensity,8-9 is ambient, mode mat4 local_matrix; // up to here for spot and omni, rest is for directional // notes: for ambientblend, use distance to edge to blend between already existing global environment }; |