FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Merge branch 'master' of github.com:processing/processing · jasstrong/processing@9f8efcd · GitHub

Repository navigation

Commit 9f8efcd

Browse files
committed
Merge branch 'master' of github.com:processing/processing
2 parents 153c3dc + e0ba9f7 commit 9f8efcd

6 files changed

Lines changed: 28 additions & 24 deletions

File tree

‎core/src/processing/opengl/PGraphicsOpenGL.java‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2610,14 +2610,15 @@ void rawPolys() {
26102610
raw.noStroke();
26112611
raw.beginShape(TRIANGLES);
26122612

2613-
sortTriangles();
2613+
2614+
//sortTriangles();
26142615

26152616
float[] vertices = tessGeo.polyVertices;
26162617
int[] color = tessGeo.polyColors;
26172618
float[] uv = tessGeo.polyTexCoords;
2618-
//short[] indices = tessGeo.polyIndices; // unused [fry]
2619-
2619+
short[] indices = tessGeo.polyIndices; // unused [fry]
26202620

2621+
/*
26212622
sortTriangles();
26222623
for (int i = 0; i < sortedTriangleCount; i++) {
26232624
Triangle tri = sortedPolyTriangles[i];
@@ -2697,9 +2698,9 @@ void rawPolys() {
26972698
}
26982699
26992700
}
2701+
*/
27002702

27012703

2702-
/*
27032704
for (int i = 0; i < texCache.size; i++) {
27042705
PImage textureImage = texCache.getTextureImage(i);
27052706

@@ -2791,7 +2792,7 @@ void rawPolys() {
27912792
}
27922793
}
27932794
}
2794-
*/
2795+
27952796

27962797
raw.endShape();
27972798
}

‎core/src/processing/opengl/PJOGL.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ protected void initSurface(int antialias) {
369369
canvasAWT = null;
370370
}
371371

372+
pg.parent.defaultSize = false;
372373
registerListeners();
373374

374375
fboLayerCreated = false;
@@ -384,6 +385,7 @@ protected void reinitSurface() {
384385
fboLayerCreated = false;
385386
fboLayerInUse = false;
386387
firstFrame = true;
388+
pg.parent.defaultSize = false;
387389
}
388390

389391

‎core/src/processing/opengl/PShader.java‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public class PShader implements PConstants {
116116
protected int transformMatLoc;
117117
protected int modelviewMatLoc;
118118
protected int projectionMatLoc;
119-
protected int bufferLoc;
119+
protected int ppixelsLoc;
120120
protected int bufferUnit;
121121
protected int viewportLoc;
122122

@@ -1158,7 +1158,7 @@ protected void loadUniforms() {
11581158
projectionMatLoc = getUniformLoc("projectionMatrix");
11591159

11601160
viewportLoc = getUniformLoc("viewport");
1161-
bufferLoc = getUniformLoc("buffer");
1161+
ppixelsLoc = getUniformLoc("ppixels");
11621162

11631163
normalMatLoc = getUniformLoc("normalMatrix");
11641164

@@ -1209,9 +1209,9 @@ protected void setCommonUniforms() {
12091209
setUniformValue(viewportLoc, x, y, w, h);
12101210
}
12111211

1212-
if (-1 < bufferLoc) {
1212+
if (-1 < ppixelsLoc) {
12131213
bufferUnit = getLastTexUnit() + 1;
1214-
setUniformValue(bufferLoc, bufferUnit);
1214+
setUniformValue(ppixelsLoc, bufferUnit);
12151215
pgl.activeTexture(PGL.TEXTURE0 + bufferUnit);
12161216
currentPG.bindFrontTexture();
12171217
} else {
@@ -1304,7 +1304,7 @@ protected void unbindTyped() {
13041304
if (-1 < texCoordLoc) pgl.disableVertexAttribArray(texCoordLoc);
13051305
if (-1 < normalLoc) pgl.disableVertexAttribArray(normalLoc);
13061306

1307-
if (-1 < bufferLoc) {
1307+
if (-1 < ppixelsLoc) {
13081308
pgl.requestFBOLayer();
13091309
pgl.activeTexture(PGL.TEXTURE0 + bufferUnit);
13101310
currentPG.unbindFrontTexture();

‎java/examples/Topics/Shaders/Conway/Conway.pde‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// GLSL version of Conway's game of life, ported from GLSL sandbox:
22
// http://glsl.heroku.com/e#207.3
3-
// Exemplifies the use of the buffer uniform in the shader, that gives
4-
// access to the previous frame.
3+
// Exemplifies the use of the ppixels uniform in the shader, that gives
4+
// access to the pixels of the previous frame.
55
PShader conway;
66
PGraphics pg;
77

‎java/examples/Topics/Shaders/Conway/data/conway.glsl‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ precision highp float;
99
uniform float time;
1010
uniform vec2 mouse;
1111
uniform vec2 resolution;
12-
uniform sampler2D buffer;
12+
uniform sampler2D ppixels;
1313

1414
vec4 live = vec4(0.5,1.0,0.7,1.);
1515
vec4 dead = vec4(0.,0.,0.,1.);
@@ -28,15 +28,15 @@ void main( void ) {
2828
}
2929
} else {
3030
float sum = 0.;
31-
sum += texture2D(buffer, position + pixel * vec2(-1., -1.)).g;
32-
sum += texture2D(buffer, position + pixel * vec2(-1., 0.)).g;
33-
sum += texture2D(buffer, position + pixel * vec2(-1., 1.)).g;
34-
sum += texture2D(buffer, position + pixel * vec2(1., -1.)).g;
35-
sum += texture2D(buffer, position + pixel * vec2(1., 0.)).g;
36-
sum += texture2D(buffer, position + pixel * vec2(1., 1.)).g;
37-
sum += texture2D(buffer, position + pixel * vec2(0., -1.)).g;
38-
sum += texture2D(buffer, position + pixel * vec2(0., 1.)).g;
39-
vec4 me = texture2D(buffer, position);
31+
sum += texture2D(ppixels, position + pixel * vec2(-1., -1.)).g;
32+
sum += texture2D(ppixels, position + pixel * vec2(-1., 0.)).g;
33+
sum += texture2D(ppixels, position + pixel * vec2(-1., 1.)).g;
34+
sum += texture2D(ppixels, position + pixel * vec2(1., -1.)).g;
35+
sum += texture2D(ppixels, position + pixel * vec2(1., 0.)).g;
36+
sum += texture2D(ppixels, position + pixel * vec2(1., 1.)).g;
37+
sum += texture2D(ppixels, position + pixel * vec2(0., -1.)).g;
38+
sum += texture2D(ppixels, position + pixel * vec2(0., 1.)).g;
39+
vec4 me = texture2D(ppixels, position);
4040

4141
if (me.g <= 0.1) {
4242
if ((sum >= 2.9) && (sum <= 3.1)) {

‎java/examples/Topics/Shaders/DomeProjection/DomeProjection.pde‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ IntBuffer envMapTextureID;
2121
int envMapSize = 1024;
2222

2323
void setup() {
24-
size(640, 640, P3D);
24+
size(640, 640, P3D);
2525
initCubeMap();
2626
}
2727

@@ -32,6 +32,7 @@ void draw() {
3232

3333
void drawScene() {
3434
background(0);
35+
3536
stroke(255, 0, 0);
3637
strokeWeight(2);
3738
for (int i = -width; i < 2 * width; i += 50) {
@@ -46,6 +47,6 @@ void drawScene() {
4647
translate(mouseX, mouseY, 200);
4748
rotateX(frameCount * 0.01);
4849
rotateY(frameCount * 0.01);
49-
box(100);
50+
box(100);
5051
}
5152

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL