Fixed shaders on Intel Cards - not allowed use of 'active' word

This commit is contained in:
Enrico Turri 2020-03-31 12:51:50 +02:00
parent 25d58faaad
commit f1ccd38258
3 changed files with 8 additions and 8 deletions

View File

@ -8,7 +8,7 @@ const float EPSILON = 0.0001;
struct SlopeDetection
{
bool active;
bool actived;
// x = yellow, y = red
vec2 z_range;
mat3 volume_world_normal_matrix;
@ -37,7 +37,7 @@ void main()
{
if (any(lessThan(clipping_planes_dots, ZERO)))
discard;
vec3 color = slope.active ? slope_color() : uniform_color.rgb;
vec3 color = slope.actived ? slope_color() : uniform_color.rgb;
// 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;
gl_FragColor = vec4(vec3(intensity.y, intensity.y, intensity.y) + color * intensity.x, uniform_color.a);

View File

@ -20,7 +20,7 @@ const vec3 ZERO = vec3(0.0, 0.0, 0.0);
struct PrintBoxDetection
{
bool active;
bool actived;
vec3 min;
vec3 max;
mat4 volume_world_matrix;
@ -28,7 +28,7 @@ struct PrintBoxDetection
struct SlopeDetection
{
bool active;
bool actived;
// x = yellow, y = red
vec2 z_range;
mat3 volume_world_normal_matrix;
@ -72,7 +72,7 @@ void main()
intensity.x += NdotL * LIGHT_FRONT_DIFFUSE;
// compute deltas for out of print volume detection (world coordinates)
if (print_box.active)
if (print_box.actived)
{
vec3 v = (print_box.volume_world_matrix * gl_Vertex).xyz;
delta_box_min = v - print_box.min;
@ -85,7 +85,7 @@ void main()
}
// z component of normal vector in world coordinate used for slope shading
world_normal_z = slope.active ? (normalize(slope.volume_world_normal_matrix * gl_Normal)).z : 0.0;
world_normal_z = slope.actived ? (normalize(slope.volume_world_normal_matrix * gl_Normal)).z : 0.0;
gl_Position = ftransform();
// Point in homogenous coordinates.

View File

@ -655,11 +655,11 @@ void GLVolumeCollection::render(GLVolumeCollection::ERenderType type, bool disab
GLint print_box_min_id = (current_program_id > 0) ? ::glGetUniformLocation(current_program_id, "print_box.min") : -1;
GLint print_box_max_id = (current_program_id > 0) ? ::glGetUniformLocation(current_program_id, "print_box.max") : -1;
GLint print_box_active_id = (current_program_id > 0) ? ::glGetUniformLocation(current_program_id, "print_box.active") : -1;
GLint print_box_active_id = (current_program_id > 0) ? ::glGetUniformLocation(current_program_id, "print_box.actived") : -1;
GLint print_box_worldmatrix_id = (current_program_id > 0) ? ::glGetUniformLocation(current_program_id, "print_box.volume_world_matrix") : -1;
#if ENABLE_SLOPE_RENDERING
GLint slope_active_id = (current_program_id > 0) ? ::glGetUniformLocation(current_program_id, "slope.active") : -1;
GLint slope_active_id = (current_program_id > 0) ? ::glGetUniformLocation(current_program_id, "slope.actived") : -1;
GLint slope_normal_matrix_id = (current_program_id > 0) ? ::glGetUniformLocation(current_program_id, "slope.volume_world_normal_matrix") : -1;
GLint slope_z_range_id = (current_program_id > 0) ? ::glGetUniformLocation(current_program_id, "slope.z_range") : -1;
#endif // ENABLE_SLOPE_RENDERING