If we convert a shader for es3 that contains int type attribute and varying to a shader for es1, we need a technique. This is because the es1 shader does not support int type attribute and varying variables.
An idea is to specify an attribute and varying as float types, and cast the values to int types, as shown below.
in float a_test;
int getTestAttr() {
return int(a_test);
}
In this case, it may not be possible to get a large integer due to the precision of the float type, so the shader translator needs to output a warning to the console or file.
If we convert a shader for es3 that contains int type attribute and varying to a shader for es1, we need a technique. This is because the es1 shader does not support int type attribute and varying variables.
An idea is to specify an attribute and varying as float types, and cast the values to int types, as shown below.
In this case, it may not be possible to get a large integer due to the precision of the float type, so the shader translator needs to output a warning to the console or file.