mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Updated shader examples on Android
This commit is contained in:
@@ -38,9 +38,9 @@ void draw() {
|
||||
|
||||
pgl = beginPGL();
|
||||
flatShader.bind();
|
||||
|
||||
vertLoc = pgl.getAttribLocation(flatShader.glProgram, "inVertex");
|
||||
colorLoc = pgl.getAttribLocation(flatShader.glProgram, "inColor");
|
||||
|
||||
vertLoc = pgl.getAttribLocation(flatShader.glProgram, "vertex");
|
||||
colorLoc = pgl.getAttribLocation(flatShader.glProgram, "color");
|
||||
|
||||
pgl.enableVertexAttribArray(vertLoc);
|
||||
pgl.enableVertexAttribArray(colorLoc);
|
||||
|
||||
@@ -18,15 +18,16 @@
|
||||
Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
uniform mat4 projmodelviewMatrix;
|
||||
#define PROCESSING_COLOR_SHADER
|
||||
|
||||
attribute vec4 inVertex;
|
||||
attribute vec4 inColor;
|
||||
uniform mat4 transform;
|
||||
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
|
||||
varying vec4 vertColor;
|
||||
|
||||
void main() {
|
||||
gl_Position = projmodelviewMatrix * inVertex;
|
||||
|
||||
vertColor = inColor;
|
||||
gl_Position = transform * vertex;
|
||||
vertColor = color;
|
||||
}
|
||||
Reference in New Issue
Block a user