Skip to content

Commit cbe9118

Browse files
committed
Removed model and replaced with StaticMesh
1 parent f5826e3 commit cbe9118

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+830
-1557
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#version 450
2+
3+
layout (location = 0) in vec2 fragOffset;
4+
layout (location = 1) in vec4 lightColour;
5+
6+
layout (location = 0) out vec4 outColor;
7+
8+
void main() {
9+
float dis = sqrt(dot(fragOffset, fragOffset));
10+
11+
if (dis >= 1.0) discard;
12+
13+
outColor = vec4(lightColour);
14+
}
Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
#version 450
22

3-
layout(location = 0) in vec2 position;
3+
// Per instance data
4+
layout(location = 0) in vec3 inPosition;
5+
layout(location = 1) in vec4 inColour;
46

57
layout (location = 0) out vec2 fragOffset;
8+
layout (location = 1) out vec4 lightColour;
69

710
struct CameraData
811
{
912
mat4 projectionMatrix;
1013
mat4 viewMatrix;
1114
};
1215

13-
struct LightData
14-
{
15-
vec4 lightColor;
16-
vec4 ambientLightColor;
17-
vec3 position;
16+
vec3 quadVertices[4] = {
17+
vec3(1.0, 1.0, 0),
18+
vec3(1.0, -1.0, 0),
19+
vec3(-1.0, -1.0, 0),
20+
vec3(-1.0, 1.0, 0)
1821
};
1922

2023
layout (set = 0, binding = 0) uniform GlobalData {
2124
CameraData cameraData;
22-
LightData lightData;
2325
} globalData;
2426

2527
const float LIGHT_RADIUS = 0.05;
@@ -28,14 +30,15 @@ mat4 view = globalData.cameraData.viewMatrix;
2830
mat4 projection = globalData.cameraData.projectionMatrix;
2931

3032
void main() {
31-
fragOffset = position;
33+
fragOffset = quadVertices[gl_VertexIndex].xy;
3234

3335
// Find the light position in camera space
34-
vec4 lightInCameraSpace = view * vec4(globalData.lightData.position, 1.0);
36+
vec4 lightInCameraSpace = view * vec4(inPosition, 1.0);
3537

3638
// Find the vertex position in camera space.
3739
vec4 positionInCameraSpace = lightInCameraSpace + LIGHT_RADIUS * vec4(fragOffset, 0.0, 0.0);
3840

3941
// Set the position to exist in camera space, not world space
4042
gl_Position = projection * positionInCameraSpace;
43+
lightColour = inColour;
4144
}
File renamed without changes.
File renamed without changes.

engine/render/assets/shaders/pointLight.frag

Lines changed: 0 additions & 34 deletions
This file was deleted.

engine/render/assets/shaders/texturedQuad.frag

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)