fixed skinned models

This commit is contained in:
Mikulas Florek 2019-07-05 21:01:22 +02:00
parent c20c8fe435
commit 261ac97a31
3 changed files with 4 additions and 4 deletions

View file

@ -45,7 +45,7 @@ vertex_shader [[
#elif defined SKINNED
layout(location = 4) in vec4 a_indices;
layout(location = 5) in vec4 a_weights;
layout(std140) uniform Bones {
layout(std140, binding = 2) uniform Bones {
mat4 u_bones[256];
};
#elif defined INSTANCED

View file

@ -48,7 +48,7 @@ const Shader::Program& Shader::getProgram(ShaderRenderData* rd, u32 defines)
PROFILE_BLOCK("compile_shader");
static const char* shader_code_prefix =
R"#(#version 440
layout (std140) uniform GlobalState {
layout (std140, binding = 0) uniform GlobalState {
mat4 u_shadow_view_projection;
mat4 u_shadowmap_matrices[4];
mat4 u_camera_projection;
@ -64,7 +64,7 @@ const Shader::Program& Shader::getProgram(ShaderRenderData* rd, u32 defines)
float u_time;
ivec2 u_framebuffer_size;
};
layout (std140) uniform PassState {
layout (std140, binding = 1) uniform PassState {
mat4 u_pass_projection;
mat4 u_pass_inv_projection;
mat4 u_pass_view;

View file

@ -625,7 +625,7 @@ RayCastModelHit Terrain::castRay(const DVec3& origin, const Vec3& dir)
hit.t = t;
return hit;
}
if (next_x < next_z) {
if (next_x < next_z && step_x != 0) {
next_x += delta_x;
hx += step_x;
}