Init
This commit is contained in:
19
assets/shaders/circleFragment.glsl
Normal file
19
assets/shaders/circleFragment.glsl
Normal file
@@ -0,0 +1,19 @@
|
||||
#version 330 core
|
||||
out vec4 FragColor;
|
||||
|
||||
varying vec2 val;
|
||||
|
||||
void main() {
|
||||
float radius = 1.0f;
|
||||
float radius2 = 0.5f;
|
||||
float smoothing = 0.005f;
|
||||
float dist = sqrt(dot(val,val));
|
||||
|
||||
if (dist > radius || dist < radius2) {
|
||||
discard;
|
||||
}
|
||||
float sm = smoothstep(radius, radius - smoothing, dist);
|
||||
float sm2 = smoothstep(radius2, radius2 + smoothing, dist);
|
||||
float alpha = sm * sm2;
|
||||
FragColor = vec4(1.0, 0.0, 0.0, alpha);
|
||||
}
|
||||
16
assets/shaders/circleVertex.glsl
Normal file
16
assets/shaders/circleVertex.glsl
Normal file
@@ -0,0 +1,16 @@
|
||||
#version 330 core
|
||||
//precision highp float;
|
||||
|
||||
layout (location = 0) in vec4 aPos;
|
||||
layout (location = 1) in vec2 value;
|
||||
|
||||
uniform mat4 transform;
|
||||
uniform mat4 proj;
|
||||
uniform mat4 view;
|
||||
|
||||
varying vec2 val;
|
||||
|
||||
void main() {
|
||||
gl_Position = proj*view*transform* aPos;
|
||||
val = value;
|
||||
}
|
||||
7
assets/shaders/fragment1.glsl
Normal file
7
assets/shaders/fragment1.glsl
Normal file
@@ -0,0 +1,7 @@
|
||||
#version 330 core
|
||||
out vec4 FragColor;
|
||||
in vec3 ourColor;
|
||||
|
||||
void main() {
|
||||
FragColor = vec4(ourColor , 1.0);
|
||||
}
|
||||
7
assets/shaders/fragment2.glsl
Normal file
7
assets/shaders/fragment2.glsl
Normal file
@@ -0,0 +1,7 @@
|
||||
#version 330 core
|
||||
out vec4 FragColor;
|
||||
uniform vec4 Color;
|
||||
|
||||
void main() {
|
||||
FragColor = Color;
|
||||
}
|
||||
12
assets/shaders/fragment3.glsl
Normal file
12
assets/shaders/fragment3.glsl
Normal file
@@ -0,0 +1,12 @@
|
||||
#version 330 core
|
||||
out vec4 FragColor;
|
||||
|
||||
in vec3 ourColor;
|
||||
in vec2 TextureCords;
|
||||
|
||||
uniform sampler2D Texture;
|
||||
|
||||
void main() {
|
||||
FragColor = texture(Texture, TextureCords) * vec4(ourColor, 1.0);
|
||||
}
|
||||
|
||||
11
assets/shaders/fragment4.glsl
Normal file
11
assets/shaders/fragment4.glsl
Normal file
@@ -0,0 +1,11 @@
|
||||
#version 330 core
|
||||
out vec4 FragColor;
|
||||
|
||||
in vec3 ourColor;
|
||||
in vec2 TextureCords;
|
||||
|
||||
uniform sampler2D Texture;
|
||||
|
||||
void main() {
|
||||
FragColor = texture(Texture, TextureCords) * vec4(ourColor, 1.0);
|
||||
}
|
||||
10
assets/shaders/vertex1.glsl
Normal file
10
assets/shaders/vertex1.glsl
Normal file
@@ -0,0 +1,10 @@
|
||||
#version 330 core
|
||||
layout (location = 0) in vec3 aPos;
|
||||
layout (location = 1) in vec3 aColor;
|
||||
|
||||
out vec3 ourColor;
|
||||
|
||||
void main() {
|
||||
gl_Position = vec4(aPos, 1.0);
|
||||
ourColor = aColor;
|
||||
}
|
||||
6
assets/shaders/vertex2.glsl
Normal file
6
assets/shaders/vertex2.glsl
Normal file
@@ -0,0 +1,6 @@
|
||||
#version 330
|
||||
layout (location = 0) in vec3 aPos;
|
||||
|
||||
void main() {
|
||||
gl_Position = vec4(aPos, 1.0);
|
||||
}
|
||||
14
assets/shaders/vertex3.glsl
Normal file
14
assets/shaders/vertex3.glsl
Normal file
@@ -0,0 +1,14 @@
|
||||
#version 330 core
|
||||
layout (location = 0) in vec3 aPos;
|
||||
layout (location = 1) in vec3 aColor;
|
||||
layout (location = 2) in vec2 aTextureCords;
|
||||
|
||||
out vec3 ourColor;
|
||||
out vec2 TextureCords;
|
||||
|
||||
void main() {
|
||||
gl_Position = vec4(aPos, 1.0);
|
||||
ourColor = aColor;
|
||||
TextureCords = aTextureCords;
|
||||
}
|
||||
|
||||
15
assets/shaders/vertex4.glsl
Normal file
15
assets/shaders/vertex4.glsl
Normal file
@@ -0,0 +1,15 @@
|
||||
#version 330 core
|
||||
layout (location =0 ) in vec3 aPos;
|
||||
layout (location = 1) in vec3 aColor;
|
||||
layout (location = 2) in vec2 aTextureCords;
|
||||
|
||||
out vec3 ourColor;
|
||||
out vec2 TextureCords;
|
||||
|
||||
uniform mat4 transform;
|
||||
|
||||
void main() {
|
||||
gl_Position = transform * vec4(aPos, 1.0);
|
||||
ourColor = aColor;
|
||||
TextureCords = aTextureCords;
|
||||
}
|
||||
BIN
assets/textures/wall.jpg
Normal file
BIN
assets/textures/wall.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 251 KiB |
Reference in New Issue
Block a user