Skip to content

Commit 1459088

Browse files
committed
Release v0.90 (38)
PJOGL.profile = 3; hopefully fixes point sprite rendering
1 parent 55947e7 commit 1459088

File tree

15 files changed

+61
-42
lines changed

15 files changed

+61
-42
lines changed

examples/FlowFieldParticles_Basic/FlowFieldParticles_Basic.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
import processing.core.*;
2525
import processing.opengl.PGraphics2D;
26+
import processing.opengl.PJOGL;
2627

2728

2829

@@ -59,6 +60,7 @@ public void settings() {
5960
viewport_h = (int) min(viewport_h, displayHeight * 0.9f);
6061
size(viewport_w, viewport_h, P2D);
6162
smooth(0);
63+
PJOGL.profile = 3;
6264
}
6365

6466

examples/FlowFieldParticles_Cohesion/FlowFieldParticles_Cohesion.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
import processing.core.*;
2727
import processing.opengl.PGraphics2D;
28+
import processing.opengl.PJOGL;
2829

2930

3031

@@ -65,6 +66,7 @@ public void settings() {
6566
viewport_h = (int) min(viewport_h, displayHeight * 0.9f);
6667
size(viewport_w, viewport_h, P2D);
6768
smooth(0);
69+
PJOGL.profile = 3;
6870
}
6971

7072

examples/FlowFieldParticles_DevDemo/FlowFieldParticles_DevDemo.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import processing.core.*;
3838
import processing.opengl.PGraphics2D;
3939
import processing.opengl.PGraphicsOpenGL;
40+
import processing.opengl.PJOGL;
4041

4142

4243
public class FlowFieldParticles_DevDemo extends PApplet {
@@ -145,14 +146,14 @@ public void settings() {
145146
viewport_h = (int) min(viewport_h, displayHeight * 0.9f);
146147
size(viewport_w, viewport_h, P2D);
147148
}
149+
PJOGL.profile = 3;
148150
smooth(0);
149151
}
150152

151153

152154
public void setup(){
153155
surface.setLocation(viewport_x, viewport_y);
154156
surface.setResizable(true);
155-
156157
randomSeed(2);
157158
for(int i = 0; i < mobs.length; i++){
158159
float r = random(50,120);
@@ -170,6 +171,7 @@ public void setup(){
170171
particles = new DwFlowFieldParticles(context, 1024 * 1024 * 4);
171172
particles.param.size_display = 10;
172173
particles.param.size_collision = particles.param.size_display;
174+
particles.param.size_cohesion = 5;
173175
particles.param.velocity_damping = 0.99f;
174176

175177
ff_acc = new DwFlowField(context);
@@ -416,7 +418,7 @@ void info(){
416418

417419
fill(col_fg);
418420
noStroke();
419-
rect(0, height, 600, - 20);
421+
rect(0, height, 650, - 20);
420422
fill(255,128,0);
421423
text(txt_fps, 10, height-6);
422424

examples/FlowFieldParticles_Impulse/FlowFieldParticles_Impulse.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
import processing.core.*;
2525
import processing.opengl.PGraphics2D;
26+
import processing.opengl.PJOGL;
2627

2728

2829

@@ -69,6 +70,7 @@ public void settings() {
6970
viewport_h = (int) min(viewport_h, displayHeight * 0.9f);
7071
size(viewport_w, viewport_h, P2D);
7172
smooth(0);
73+
PJOGL.profile = 3;
7274
}
7375

7476

examples/FlowFieldParticles_MouseImpulse/FlowFieldParticles_MouseImpulse.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
import processing.core.*;
2525
import processing.opengl.PGraphics2D;
26+
import processing.opengl.PJOGL;
2627

2728

2829

@@ -64,6 +65,7 @@ public void settings() {
6465
viewport_h = (int) min(viewport_h, displayHeight * 0.9f);
6566
size(viewport_w, viewport_h, P2D);
6667
smooth(0);
68+
PJOGL.profile = 3;
6769
}
6870

6971

examples/FlowFieldParticles_OpticalFlowCapture/FlowFieldParticles_OpticalFlowCapture.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.thomasdiewald.pixelflow.java.imageprocessing.filter.DwFilter;
2222
import processing.core.*;
2323
import processing.opengl.PGraphics2D;
24+
import processing.opengl.PJOGL;
2425
import processing.video.Capture;
2526

2627

@@ -50,6 +51,7 @@ public class FlowFieldParticles_OpticalFlowCapture extends PApplet {
5051
public void settings() {
5152
size(cam_w * 2, cam_h * 2, P2D);
5253
smooth(0);
54+
PJOGL.profile = 3;
5355
}
5456

5557
public void setup(){

examples/Fluid_CustomParticles/Fluid_CustomParticles.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import controlP5.Toggle;
2424
import processing.core.*;
2525
import processing.opengl.PGraphics2D;
26+
import processing.opengl.PJOGL;
2627

2728
public class Fluid_CustomParticles extends PApplet {
2829

@@ -134,6 +135,7 @@ public void update(DwFluid2D fluid) {
134135
public void settings() {
135136
size(viewport_w, viewport_h, P2D);
136137
smooth(4);
138+
PJOGL.profile = 3;
137139
}
138140

139141

examples/ReactionDiffusion/ReactionDiffusion.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ public void setup() {
5454

5555
// pixelflow context
5656
context = new DwPixelFlow(this);
57+
context.print();
58+
context.printGL();
5759

5860
// 1) 32 bit per channel
5961
tex_grayscott.resize(context, GL2.GL_RG32F, width, height, GL2.GL_RG, GL2.GL_FLOAT, GL2.GL_NEAREST, 2, 4);

src/com/thomasdiewald/pixelflow/java/DwPixelFlow.java

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class DwPixelFlow{
3838

3939
static public class PixelFlowInfo{
4040

41-
static public final String version = "0.89";
41+
static public final String version = "0.90";
4242
static public final String name = "PixelFlow";
4343
static public final String author = "Thomas Diewald";
4444
static public final String web = "http://www.thomasdiewald.com";
@@ -51,41 +51,38 @@ public String toString(){
5151

5252
static public final PixelFlowInfo INFO;
5353

54-
static{
54+
static {
5555
INFO = new PixelFlowInfo();
5656
}
5757

5858

59-
public static final String SHADER_DIR = "/com/thomasdiewald/pixelflow/glsl/";
60-
// public static final String SHADER_DIR = "D:/data/__Eclipse/workspace/WORKSPACE_FLUID/PixelFlow/src/com/thomasdiewald/pixelflow/glsl/";
59+
// public static final String SHADER_DIR = "/com/thomasdiewald/pixelflow/glsl/";
60+
public static final String SHADER_DIR = "D:/data/__Eclipse/workspace/WORKSPACE_FLUID/PixelFlow/src/com/thomasdiewald/pixelflow/glsl/";
6161

6262
public PApplet papplet;
6363
public PJOGL pjogl;
6464
public GL2ES2 gl;
6565

66-
public final DwUtils utils;
66+
public final DwUtils utils = new DwUtils(this);
6767

6868
private int scope_depth = 0;
6969

70-
public DwGLFrameBuffer framebuffer;
70+
public final DwGLFrameBuffer framebuffer = new DwGLFrameBuffer();
7171

7272

7373
private HashMap<String, DwGLSLProgram> shader_cache = new HashMap<String, DwGLSLProgram>();
7474

75+
7576
public DwPixelFlow(PApplet papplet){
7677
this.papplet = papplet;
77-
78-
this.gl = begin(); end();
78+
this.papplet.registerMethod("dispose", this);
7979

80+
begin();
8081
pjogl.enableFBOLayer();
81-
82-
papplet.registerMethod("dispose", this);
83-
84-
utils = new DwUtils(this);
85-
86-
framebuffer = new DwGLFrameBuffer(gl);
82+
end();
8783
}
8884

85+
8986
public void dispose(){
9087
release();
9188
}
@@ -103,10 +100,8 @@ public void release(){
103100
}
104101
shader_cache.clear();
105102

106-
if(framebuffer != null){
107-
framebuffer.release();
108-
framebuffer = null;
109-
}
103+
framebuffer.release();
104+
110105
}
111106

112107

@@ -131,9 +126,10 @@ public void release(){
131126

132127
public GL2ES2 begin(){
133128
// System.out.printf("%"+(scope_depth*2+1)+"s GLScope.begin %d\n", " ", scope_depth);
134-
if( scope_depth == 0){
129+
if(scope_depth == 0){
135130
pjogl = (PJOGL) papplet.beginPGL();
136-
gl = pjogl.gl.getGL2ES2();
131+
gl = pjogl.gl.getGL2ES2();
132+
framebuffer.allocate(gl);
137133
}
138134

139135
scope_depth++;

src/com/thomasdiewald/pixelflow/java/dwgl/DwGLFrameBuffer.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,14 @@ public class DwGLFrameBuffer {
2727
public int max_color_attachments;
2828
public int max_draw_buffers;
2929
public int max_bind;
30-
public DwGLFrameBuffer(GL2ES2 gl){
31-
allocate(gl);
30+
31+
public DwGLFrameBuffer(){
3232
}
3333

34+
// public DwGLFrameBuffer(GL2ES2 gl){
35+
// allocate(gl);
36+
// }
37+
3438
public void release(){
3539
if(gl != null){
3640
if(HANDLE_fbo != null) gl.glDeleteFramebuffers(1, HANDLE_fbo, 0);

0 commit comments

Comments
 (0)