initial commit

This commit is contained in:
MihailRis
2025-05-07 20:42:50 +03:00
parent 27b194816b
commit fc46b7c434
36 changed files with 754 additions and 70 deletions
+6
View File
@@ -7,7 +7,9 @@ layout (location = 3) in vec4 v_light;
out vec4 a_color;
out vec2 a_texCoord;
out vec3 a_normal;
out float a_fog;
out vec3 a_position;
out vec3 a_dir;
uniform mat4 u_model;
@@ -31,6 +33,8 @@ void main() {
vec3 pos3d = modelpos.xyz - u_cameraPos;
modelpos.xyz = apply_planet_curvature(modelpos.xyz, pos3d);
a_normal = vec3(0.0, 1.0, 0.0);//v_normal.xyz * 2.0 - 1.0;
vec3 light = v_light.rgb;
float torchlight = max(0.0, 1.0-distance(u_cameraPos, modelpos.xyz) /
u_torchlightDistance);
@@ -48,4 +52,6 @@ void main() {
a_fog = min(1.0, max(pow(depth * u_fogFactor, u_fogCurve),
min(pow(depth * u_weatherFogDencity, u_weatherFogCurve), u_weatherFogOpacity)));
gl_Position = u_proj * u_view * modelpos;
a_position = (u_view * modelpos).xyz;
}