mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 03:09:18 +02:00
work
This commit is contained in:
12
shaders/alphashadowmap.frag
Normal file
12
shaders/alphashadowmap.frag
Normal file
@@ -0,0 +1,12 @@
|
||||
#version 330
|
||||
|
||||
in vec2 f_coord;
|
||||
|
||||
uniform sampler2D tex1;
|
||||
|
||||
void main()
|
||||
{
|
||||
//gl_FragColor = texture(tex, f_coord);
|
||||
//gl_FragDepth = gl_FragCoord.z;
|
||||
gl_FragDepth = gl_FragCoord.z + (1.0 - texture(tex1, f_coord).a);
|
||||
}
|
||||
14
shaders/billboard.frag
Normal file
14
shaders/billboard.frag
Normal file
@@ -0,0 +1,14 @@
|
||||
#version 330
|
||||
|
||||
in vec3 f_normal;
|
||||
in vec2 f_coord;
|
||||
|
||||
uniform sampler2D tex1;
|
||||
|
||||
#include <common>
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 tex_color = texture(tex1, f_coord);
|
||||
gl_FragColor = tex_color * param[0];
|
||||
}
|
||||
@@ -9,5 +9,5 @@ void main()
|
||||
float dist2 = abs(x * x + y * y);
|
||||
if (dist2 > 0.5f * 0.5f)
|
||||
discard;
|
||||
gl_FragColor = param[0] * emission;
|
||||
gl_FragColor = vec4(param[0].rgb * emission, 1.0f);
|
||||
}
|
||||
|
||||
@@ -87,8 +87,13 @@ float calc_dir_light(light_s light)
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 tex_color = texture(tex1, f_coord);
|
||||
|
||||
if (opacity == 0.0f && tex_color.a < 0.9f)
|
||||
discard;
|
||||
|
||||
float shadow = calc_shadow();
|
||||
vec3 result = ambient * 0.3 + param[0].rgb * emission;
|
||||
vec3 result = ambient * 0.3 + vec3(1.0) * emission;
|
||||
for (uint i = 0U; i < lights_count; i++)
|
||||
{
|
||||
light_s light = lights[i];
|
||||
@@ -106,7 +111,6 @@ void main()
|
||||
result += light.color * part;
|
||||
}
|
||||
|
||||
vec4 tex_color = texture(tex1, f_coord);
|
||||
vec3 c = apply_fog(result * tex_color.xyz);
|
||||
gl_FragColor = vec4(c, tex_color.w);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#version 330 core
|
||||
out vec4 FragColor;
|
||||
|
||||
in vec2 TexCoords;
|
||||
in vec2 f_coords;
|
||||
|
||||
uniform sampler2D tex1;
|
||||
|
||||
@@ -40,7 +40,7 @@ vec3 filmic(vec3 x)
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 texcoord = TexCoords;
|
||||
vec2 texcoord = f_coords;
|
||||
// float x = texcoord.x;
|
||||
// texcoord.x += sin(texcoord.y * 4*2*3.14159 + 0) / 100;
|
||||
// texcoord.y += sin(x * 4*2*3.14159 + 0) / 100;
|
||||
@@ -16,11 +16,11 @@ const vec2 uv[4] = vec2[]
|
||||
vec2(1.0, 0.0)
|
||||
);
|
||||
|
||||
out vec2 TexCoords;
|
||||
out vec2 f_coords;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = vec4(vert[gl_VertexID], 0.0, 1.0);
|
||||
TexCoords = uv[gl_VertexID];
|
||||
f_coords = uv[gl_VertexID];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user