diff --git a/Assets/Materials/UI/UIMat_Black.shmat b/Assets/Materials/UI/UIMat_Black.shmat new file mode 100644 index 00000000..d27853ac --- /dev/null +++ b/Assets/Materials/UI/UIMat_Black.shmat @@ -0,0 +1,8 @@ +- VertexShader: 46580970 + FragmentShader: 50110174 + SubPass: UI + Properties: + data.color: {x: 0.5, y: 0, z: 0, w: 1} + data.textureIndex: 0 + data.alpha: 0 + data.beta: {x: 1, y: 1, z: 1} \ No newline at end of file diff --git a/Assets/Materials/UI/UIMat_Black.shmat.shmeta b/Assets/Materials/UI/UIMat_Black.shmat.shmeta new file mode 100644 index 00000000..caac5feb --- /dev/null +++ b/Assets/Materials/UI/UIMat_Black.shmat.shmeta @@ -0,0 +1,3 @@ +Name: UIMat_Black +ID: 120016136 +Type: 7 diff --git a/Assets/Shaders/UI_Black_FS.glsl b/Assets/Shaders/UI_Black_FS.glsl new file mode 100644 index 00000000..84664ede --- /dev/null +++ b/Assets/Shaders/UI_Black_FS.glsl @@ -0,0 +1,49 @@ +#version 450 +#extension GL_ARB_separate_shader_objects : enable +#extension GL_ARB_shading_language_420pack : enable +#extension GL_EXT_nonuniform_qualifier : require + +struct MatPropData +{ + vec4 color; + int textureIndex; + float alpha; +}; + +layout(location = 0) in struct +{ + vec4 vertPos; // location 0 + vec2 uv; // location = 1 + vec4 normal; // location = 2 + +} In; + +// material stuff +layout(location = 3) flat in struct +{ + int materialIndex; + uint eid; + uint lightLayerIndex; +} In2; + +layout (set = 0, binding = 1) uniform sampler2D textures[]; // for textures (global) +layout (std430, set = 2, binding = 0) buffer MaterialProperties // For materials +{ + MatPropData data[]; +} MatProp; + +layout(location = 0) out vec4 fragColor; +layout(location = 1) out uint outEntityID; + +void main() +{ + fragColor = MatProp.data[In2.materialIndex].color; + if (fragColor.a < 0.01f) + { + discard; + } + fragColor.a = MatProp.data[In2.materialIndex].alpha; + + // fragColor.a = 1.0f; + outEntityID = In2.eid; +} \ No newline at end of file diff --git a/Assets/Shaders/UI_Black_FS.shshaderb b/Assets/Shaders/UI_Black_FS.shshaderb new file mode 100644 index 00000000..17a072c9 Binary files /dev/null and b/Assets/Shaders/UI_Black_FS.shshaderb differ diff --git a/Assets/Shaders/UI_Black_FS.shshaderb.shmeta b/Assets/Shaders/UI_Black_FS.shshaderb.shmeta new file mode 100644 index 00000000..b5429d75 --- /dev/null +++ b/Assets/Shaders/UI_Black_FS.shshaderb.shmeta @@ -0,0 +1,3 @@ +Name: UI_Black_FS +ID: 50110174 +Type: 2