Implement dynamic atmosphere
https://github.com/Fewes/MinimalAtmosphere
This commit is contained in:
parent
9905ffd26b
commit
7038343b19
9 changed files with 373 additions and 29 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue