more possible errors

This commit is contained in:
Maxime Gimeno 2020-10-06 10:20:05 +02:00
parent 10739ba980
commit e4362c88a7
3 changed files with 47 additions and 47 deletions

View File

@ -32,7 +32,7 @@ void main(void) {
gl_FragColor = vec4(d,d,d,1.0);
else
{
if(color.w<0)
if(color.w<0.)
{
highp vec4 my_color = vec4(color.xyz, 1.);

View File

@ -23,17 +23,17 @@ void main(void)
mv_matrix_3[2] = mv_matrix[2].xyz;
fN = mv_matrix_3* normals;
highp mat4 transOB = mat4(1, 0, 0, 0, // first column
0, 1, 0, 0, // second column
0, 0, 1, 0, // third column
highp mat4 transOB = mat4(1., 0., 0., 0., // first column
0., 1., 0., 0., // second column
0., 0., 1., 0., // third column
center.x, center.y, center.z, 1); // fourth column
highp mat4 transBO = mat4(1, 0, 0, 0, // first column
0, 1, 0, 0, // second column
0, 0, 1, 0, // third column
highp mat4 transBO = mat4(1., 0., 0., 0., // first column
0., 1., 0., 0., // second column
0., 0., 1., 0., // third column
-center.x, -center.y, -center.z, 1); // fourth column
highp mat4 scaling = mat4(shrink_factor, 0, 0, 0,
0, shrink_factor, 0, 0,
0, 0, shrink_factor, 0,
0, 0, 0, 1);
highp mat4 scaling = mat4(shrink_factor, 0., 0., 0.,
0., shrink_factor, 0., 0.,
0., 0., shrink_factor, 0.,
0., 0., 0., 1.);
gl_Position = mvp_matrix *transOB * scaling * transBO * vertex;
}

View File

@ -2,8 +2,8 @@
varying highp vec4 color;
void main(void)
{
if(color.w<0)
gl_FragColor = vec4(0,0,0,1.0);
if(color.w<0.)
gl_FragColor = vec4(0.,0.,0.,1.0);
else
discard;
}