Implement dynamic atmosphere

https://github.com/Fewes/MinimalAtmosphere
This commit is contained in:
reo 2025-09-18 23:23:53 +03:00
parent 9905ffd26b
commit 7038343b19
9 changed files with 373 additions and 29 deletions

View file

@ -10,14 +10,14 @@ uniform mat4 projection;
uniform vec2 uv_offset;
uniform vec2 uv_scale;
out vec3 v_normal;
out vec3 v_world_normal;
out vec2 v_tex;
out vec3 v_position;
out vec3 v_world_pos;
void main() {
mat4 modelview = view * model;
v_normal = transpose(inverse(mat3(modelview))) * normal;
v_tex = tex_coords * uv_scale + uv_offset;
v_position = (modelview * vec4(position, 1.0)).xyz;
gl_Position = projection * modelview * vec4(position, 1.0);
mat3 model3 = mat3(model);
v_world_normal = normalize(transpose(inverse(model3)) * normal);
v_tex = tex_coords * uv_scale + uv_offset;
v_world_pos = (model * vec4(position, 1.0)).xyz;
gl_Position = projection * view * vec4(v_world_pos, 1.0);
}