Removed striped shading for sinking objects

This commit is contained in:
enricoturri1966 2021-07-19 11:37:18 +02:00
parent ccf67793bd
commit 75a2d7620b
2 changed files with 0 additions and 13 deletions

View file

@ -31,7 +31,6 @@ struct SlopeDetection
uniform vec4 uniform_color;
uniform SlopeDetection slope;
uniform bool sinking;
#ifdef ENABLE_ENVIRONMENT_MAP
uniform sampler2D environment_tex;
@ -51,11 +50,6 @@ varying float world_pos_z;
varying float world_normal_z;
varying vec3 eye_normal;
vec3 sinking_color(vec3 color)
{
return (mod(model_pos.x + model_pos.y + model_pos.z, BANDS_WIDTH) < (0.5 * BANDS_WIDTH)) ? mix(color, ZERO, 0.6666) : color;
}
uniform bool compute_triangle_normals_in_fs;
void main()
@ -97,9 +91,6 @@ void main()
}
// if the fragment is outside the print volume -> use darker color
color = (any(lessThan(delta_box_min, ZERO)) || any(greaterThan(delta_box_max, ZERO))) ? mix(color, ZERO, 0.3333) : color;
// if the object is sinking, shade it with inclined bands or white around world z = 0
if (sinking)
color = (abs(world_pos_z) < 0.05) ? WHITE : sinking_color(color);
#ifdef ENABLE_ENVIRONMENT_MAP
if (use_environment_tex)
gl_FragColor = vec4(0.45 * texture2D(environment_tex, normalize(eye_normal_fs).xy * 0.5 + 0.5).xyz + 0.8 * color * intensity_fs.x, alpha);

View file

@ -800,10 +800,6 @@ void GLVolumeCollection::render(GLVolumeCollection::ERenderType type, bool disab
shader->set_uniform("print_box.volume_world_matrix", volume.first->world_matrix());
shader->set_uniform("slope.actived", m_slope.active && !volume.first->is_modifier && !volume.first->is_wipe_tower);
shader->set_uniform("slope.volume_world_normal_matrix", static_cast<Matrix3f>(volume.first->world_matrix().matrix().block(0, 0, 3, 3).inverse().transpose().cast<float>()));
#if ENABLE_ALLOW_NEGATIVE_Z
shader->set_uniform("sinking", volume.first->is_sinking());
#endif // ENABLE_ALLOW_NEGATIVE_Z
volume.first->render();
}