GUI: Box drawing

This commit is contained in:
2026-05-13 05:40:31 +02:00
parent 79c62141df
commit bce62feb09
24 changed files with 747 additions and 62 deletions

View File

@@ -0,0 +1,6 @@
layout(set = 0, binding = 0, scalar) uniform GlobalUniforms {
mat4 matrixWStoVS;
mat4 matrixVStoCS;
mat3x2 matrixSSPXtoCS;
vec3 ambientLight;
} _Global;

View File

@@ -0,0 +1,14 @@
struct Box {
vec4 backgroundColor;
vec4 borderColor;
vec2 positionSSPX;
vec2 sizePX;
float borderWidthPX;
float borderRadiusPX;
};
#include "global_uniforms.glsl"
layout(set = 0, binding = 1, scalar) readonly buffer Boxes {
Box _Boxes[];
};

View File

@@ -0,0 +1,17 @@
struct Image {
vec4 tint;
vec2 positionSSPX;
vec2 sizePX;
vec2 uvMin;
vec2 uvMax;
uint16_t textureId;
};
#include "global_uniforms.glsl"
layout(set = 0, binding = 1, scalar) readonly buffer Images {
Image _Images[];
};
layout(set = 0, binding = 2) uniform sampler _Sampler;
layout(set = 0, binding = 3) uniform texture2D _Textures[];

View File

@@ -0,0 +1,58 @@
// --- SET 0 --- GLOBAL --------------------------------------------------------
struct PointLight {
vec3 positionWS;
vec3 color;
};
struct DirectionalLight {
vec3 directionWS;
vec3 color;
};
struct Material {
vec3 baseColor;
vec3 emissive;
float ior;
float metallic;
float normalScale;
float occlusionTextureStrength;
float roughness;
uint16_t baseColorTexture;
uint16_t emissiveTexture;
uint16_t normalTexture;
uint16_t occlusionRoughnessMetallicTexture;
};
struct ObjectUniforms {
mat4 matrixOStoWS;
mat4 matrixOStoWSNormal;
uint16_t material;
};
#include "global_uniforms.glsl"
layout(set = 0, binding = 1, scalar) readonly buffer PointLights {
uint count;
PointLight lights[];
} _PointLights;
layout(set = 0, binding = 2, scalar) readonly buffer DirectionalLights {
uint count;
DirectionalLight lights[];
} _DirectionalLights;
layout(set = 0, binding = 3, scalar) readonly buffer Materials {
Material _Materials[];
};
layout(set = 0, binding = 4) uniform sampler _Sampler;
layout(set = 0, binding = 5) uniform texture2D _Textures[];
// --- SET 1 --- PER BATCH -----------------------------------------------------
layout(set = 1, binding = 0, scalar) readonly buffer ObjectsUniforms {
ObjectUniforms _Object[];
};

View File

@@ -0,0 +1,8 @@
vec3 toneMapAcesNarkowicz(vec3 color) {
const float A = 2.51;
const float B = 0.03;
const float C = 2.43;
const float D = 0.59;
const float E = 0.14;
return clamp((color * (A * color + B)) / (color * (C * color + D) + E), 0.0, 1.0);
}