All changes made for 10th part of tutorial

voxel_engine.cpp - changed structure, added character controls, physics
almost all files are modified (including shaders)
+ new source directory - physics
This commit is contained in:
MihailRis
2021-08-04 01:45:04 +03:00
committed by GitHub
parent e1cdcf01e9
commit 1a00a11917
22 changed files with 587 additions and 149 deletions
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

+7 -6
View File
@@ -7,15 +7,16 @@ layout (location = 2) in vec4 v_light;
out vec4 a_color;
out vec2 a_texCoord;
uniform mat4 model;
uniform mat4 projview;
uniform mat4 u_model;
uniform mat4 u_projview;
uniform vec3 u_skyLightColor;
uniform float u_gamma;
void main(){
vec4 position = projview * model * vec4(v_position, 1.0);
a_color = vec4(v_light.r,v_light.g,v_light.b,1.0f);
vec4 position = u_projview * u_model * vec4(v_position, 1.0);
a_color = vec4(pow(v_light.rgb, vec3(u_gamma)),1.0f);
a_texCoord = v_texCoord;
a_color.rgb += v_light.a;
a_color.rgb += u_skyLightColor * v_light.a*0.5;
a_color.rgb *= 1.0-position.z*0.0025;
//a_color.rgb = pow(a_color.rgb, vec3(1.0/0.7));
gl_Position = position;
}