diff --git a/Texture.cpp b/Texture.cpp index 69b02dac..cdaae948 100644 --- a/Texture.cpp +++ b/Texture.cpp @@ -832,12 +832,12 @@ void opengl_texture::alloc_rendertarget(GLint format, GLint components, GLint ty } void -opengl_texture::set_filtering() const { - +opengl_texture::set_filtering() const +{ // default texture mode ::glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); ::glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR ); - ::glTexParameterf(target, GL_TEXTURE_MAX_ANISOTROPY, Global.AnisotropicFiltering ); + ::glTexParameterf(target, GL_TEXTURE_MAX_ANISOTROPY_EXT, Global.AnisotropicFiltering ); bool sharpen{ false }; for( auto const &trait : traits ) { diff --git a/appveyor.yml b/appveyor.yml index 4d1f1fab..42a6e323 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -41,6 +41,9 @@ artifacts: name: binaries_x86 - path: builds/eu07_x64_bin.zip name: binaries_x64 +- path: shaders + name: shaders + type: zip - path: builds/eu07_x86_pdb.zip name: symbols_x86 - path: builds/eu07_x64_pdb.zip diff --git a/gl/ubo.h b/gl/ubo.h index 08f17aea..63cd17c7 100644 --- a/gl/ubo.h +++ b/gl/ubo.h @@ -3,7 +3,7 @@ #include "object.h" #include "bindable.h" -#define UBS_PAD(x) uint64_t : x * 4; uint64_t : x * 4; +#define UBS_PAD(x) uint8_t PAD[x] namespace gl { @@ -38,7 +38,7 @@ namespace gl glm::mat4 projection; glm::mat4 lightview; float time; - UBS_PAD(12) + UBS_PAD(12); }; static_assert(sizeof(scene_ubs) == 144, "bad size of ubs"); @@ -54,7 +54,7 @@ namespace gl glm::vec3 velocity; float opacity; float emission; - UBS_PAD(12) + UBS_PAD(12); void set_modelview(const glm::mat4 &mv) { diff --git a/shaders/mat_nolight.frag b/shaders/mat_clouds.frag similarity index 100% rename from shaders/mat_nolight.frag rename to shaders/mat_clouds.frag diff --git a/shaders/mat_default.frag b/shaders/mat_default.frag index 8892619c..ede3669a 100644 --- a/shaders/mat_default.frag +++ b/shaders/mat_default.frag @@ -103,6 +103,8 @@ void main() discard; } + vec3 envcolor = texture(envmap, reflect(f_pos, normalize(f_normal))).rgb; + float shadow = calc_shadow(); vec3 result = ambient * 0.3 + vec3(1.0) * emission; for (uint i = 0U; i < lights_count; i++) @@ -119,7 +121,7 @@ void main() if (i == 0U) part *= shadow; - result += light.color * part; + result += light.color * part * envcolor; } vec3 c = apply_fog(result * tex_color.xyz); diff --git a/shaders/mat_mir.frag b/shaders/mat_mirr.frag similarity index 100% rename from shaders/mat_mir.frag rename to shaders/mat_mirr.frag