Skip to content

Commit 5b686a9

Browse files
committed
sync android opengl renderer with desktop
1 parent 94d55f7 commit 5b686a9

14 files changed

+2483
-1997
lines changed

core/src/processing/core/PGraphics.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ public class PGraphics extends PImage implements PConstants {
526526
// ........................................................
527527

528528
protected boolean curveInited = false;
529-
protected int curveDetail = 20;
529+
public int curveDetail = 20;
530530
public float curveTightness = 0;
531531
// catmull-rom basis matrix, perhaps with optional s parameter
532532
protected PMatrix3D curveBasisMatrix;

core/src/processing/opengl/ColorVert.glsl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020

2121
#define PROCESSING_COLOR_SHADER
2222

23-
uniform mat4 transform;
23+
uniform mat4 transformMatrix;
2424

25-
attribute vec4 vertex;
25+
attribute vec4 position;
2626
attribute vec4 color;
2727

2828
varying vec4 vertColor;
2929

3030
void main() {
31-
gl_Position = transform * vertex;
31+
gl_Position = transformMatrix * position;
3232

3333
vertColor = color;
3434
}

core/src/processing/opengl/LightVert.glsl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
#define PROCESSING_LIGHT_SHADER
2222

23-
uniform mat4 modelview;
24-
uniform mat4 transform;
23+
uniform mat4 modelviewMatrix;
24+
uniform mat4 transformMatrix;
2525
uniform mat3 normalMatrix;
2626

2727
uniform int lightCount;
@@ -33,7 +33,7 @@ uniform vec3 lightSpecular[8];
3333
uniform vec3 lightFalloff[8];
3434
uniform vec2 lightSpot[8];
3535

36-
attribute vec4 vertex;
36+
attribute vec4 position;
3737
attribute vec4 color;
3838
attribute vec3 normal;
3939

@@ -75,10 +75,10 @@ float blinnPhongFactor(vec3 lightDir, vec3 vertPos, vec3 vecNormal, float shine)
7575

7676
void main() {
7777
// Vertex in clip coordinates
78-
gl_Position = transform * vertex;
78+
gl_Position = transformMatrix * position;
7979

8080
// Vertex in eye coordinates
81-
vec3 ecVertex = vec3(modelview * vertex);
81+
vec3 ecVertex = vec3(modelviewMatrix * position);
8282

8383
// Normal vector in eye coordinates
8484
vec3 ecNormal = normalize(normalMatrix * normal);

core/src/processing/opengl/LineVert.glsl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020

2121
#define PROCESSING_LINE_SHADER
2222

23-
uniform mat4 modelview;
24-
uniform mat4 projection;
23+
uniform mat4 modelviewMatrix;
24+
uniform mat4 projectionMatrix;
2525

2626
uniform vec4 viewport;
2727
uniform int perspective;
2828
uniform vec3 scale;
2929

30-
attribute vec4 vertex;
30+
attribute vec4 position;
3131
attribute vec4 color;
3232
attribute vec4 direction;
3333

@@ -45,20 +45,20 @@ vec4 windowToClipVector(vec2 window, vec4 viewport, float clip_w) {
4545
}
4646

4747
void main() {
48-
vec4 posp = modelview * vertex;
48+
vec4 posp = modelviewMatrix * position;
4949

5050
// Moving vertices slightly toward the camera
5151
// to avoid depth-fighting with the fill triangles.
5252
// Discussed here:
5353
// http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848
5454
posp.xyz = posp.xyz * scale;
55-
vec4 clipp = projection * posp;
55+
vec4 clipp = projectionMatrix * posp;
5656
float thickness = direction.w;
5757

5858
if (thickness != 0.0) {
59-
vec4 posq = posp + modelview * vec4(direction.xyz, 0);
59+
vec4 posq = posp + modelviewMatrix * vec4(direction.xyz, 0);
6060
posq.xyz = posq.xyz * scale;
61-
vec4 clipq = projection * posq;
61+
vec4 clipq = projectionMatrix * posq;
6262

6363
vec3 window_p = clipToWindow(clipp, viewport);
6464
vec3 window_q = clipToWindow(clipq, viewport);

0 commit comments

Comments
 (0)