I am not very experienced when it comes to WebGL so any help will be greatly appreciated. I have drawn a simple square on screen and set the colour using gl_FragColor like this:
fsSource = `
void main() {
gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
}
`;
And then passing the fsSource variable as a parameter to the initShaderProgram(gl, vsSource, fsSource);
The color is then changed later on. I would like to know if there exists some function which I can use to get the current gl_FragColor and be able to do something of the sort:
if ( getColourOfSquareFunction() == 'red' )
{
//do something
}
else
{
//do something else
}
Thank you!
Aucun commentaire:
Enregistrer un commentaire