Skip to content

Commit dac029e

Browse files
committed
Release v1.04 (44)
1 parent 5ccb6be commit dac029e

File tree

9 files changed

+20
-18
lines changed

9 files changed

+20
-18
lines changed

examples/FlowFieldParticles_Basic/FlowFieldParticles_Basic.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,11 @@ public void spawnParticles(){
196196
sr.vel(vx, vy);
197197
particles.spawn(vw, vh, sr);
198198

199-
if(mousePressed){
199+
if(mousePressed){
200+
float pr = particles.getCollisionSize() * 0.5f;
200201
count = ceil(particles.getCount() * 0.01f);
201-
count = min(max(count, 1), 10000);
202-
radius = ceil(sqrt(count));
202+
count = min(max(count, 1), 4000);
203+
radius = ceil(sqrt(count * pr * pr));
203204
px = mouseX;
204205
py = mouseY;
205206
vx = (mouseX - pmouseX) * +5;

examples/FlowFieldParticles_DevDemo/FlowFieldParticles_DevDemo.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,8 @@ void updateScene(){
524524
if(APPLY_OBSTACLES)
525525
{
526526
if(UPDATE_SCENE){
527-
rot += particles.param.timestep * 0.8f;
528-
slide += particles.param.timestep * 0.4f;
527+
rot += particles.getTimestep() * 0.008f;
528+
slide += particles.getTimestep() * 0.004f;
529529
}
530530

531531
pg_obstacles.rectMode(CENTER);

examples/Shadertoy_PlasmaGlobe/Shadertoy_PlasmaGlobe.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ public void setup() {
6464
}
6565

6666
tex_noise.resize(context, GL2.GL_RGBA8, wh, wh, GL2.GL_RGBA, GL2.GL_UNSIGNED_BYTE, GL2.GL_LINEAR, GL2.GL_MIRRORED_REPEAT, 4, 1, bbuffer);
67+
tex_noise.generateMipMap();
68+
6769
frameRate(60);
6870
}
6971

@@ -73,7 +75,7 @@ public void draw() {
7375
toy.set_iMouse(mouseX, height-1-mouseY, mouseX, height-1-mouseY);
7476
}
7577
toy.set_iChannel(0, tex_noise);
76-
toy.apply(this.g);
78+
toy.apply(g);
7779

7880
String txt_fps = String.format(getClass().getSimpleName()+ " [size %d/%d] [frame %d] [fps %6.2f]", width, height, frameCount, frameRate);
7981
surface.setTitle(txt_fps);

examples/Shadertoy_WetStone/Shadertoy_WetStone.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ public void settings() {
3737

3838
public void setup() {
3939
surface.setResizable(true);
40-
40+
4141
context = new DwPixelFlow(this);
4242
context.print();
4343
context.printGL();
44-
44+
4545
toy = new DwShadertoy(context, "data/WetStone.frag");
4646

4747
frameRate(60);
@@ -52,7 +52,8 @@ public void draw() {
5252
if(mousePressed){
5353
toy.set_iMouse(mouseX, height-1-mouseY, mouseX, height-1-mouseY);
5454
}
55-
toy.apply(this.g);
55+
56+
toy.apply(g);
5657

5758
String txt_fps = String.format(getClass().getSimpleName()+ " [size %d/%d] [frame %d] [fps %6.2f]", width, height, frameCount, frameRate);
5859
surface.setTitle(txt_fps);

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

Lines changed: 1 addition & 1 deletion
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 = "1.03";
41+
static public final String version = "1.04";
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";

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,10 @@ public void setParam_Filter(int minfilter, int magfilter){
295295
public void generateMipMap(){
296296
gl.glBindTexture (target, HANDLE[0]);
297297
gl.glTexParameteri (target, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR_MIPMAP_LINEAR);
298-
gl.glTexParameteri (target, GL2.GL_GENERATE_MIPMAP, GL.GL_TRUE);
298+
// gl.glTexParameteri (target, GL2.GL_GENERATE_MIPMAP, GL.GL_TRUE);
299299
gl.glGenerateMipmap(target);
300300
gl.glBindTexture (target, 0);
301+
DwGLError.debug(gl, "DwGLTexture.generateMipMap");
301302
}
302303

303304
public void setParam_Border(float[] border){

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
package com.thomasdiewald.pixelflow.java.dwgl;
22

3-
import com.jogamp.opengl.GL2ES2;
43
import com.thomasdiewald.pixelflow.java.DwPixelFlow;
54

65
public class DwGLTextureCube {
76

8-
static private int TEX_COUNT = 0;
7+
// static private int TEX_COUNT = 0;
98

109
public DwPixelFlow context;
11-
private GL2ES2 gl;
10+
// private GL2ES2 gl;
1211

1312
public int[] HANDLE = null;
1413

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
package com.thomasdiewald.pixelflow.java.dwgl;
1010

1111
import com.jogamp.opengl.GL;
12-
import com.jogamp.opengl.GL2;
1312
import com.jogamp.opengl.GL2ES2;
14-
import com.thomasdiewald.pixelflow.java.DwPixelFlow;
1513

1614
import processing.core.PGraphics;
1715
import processing.core.PVector;
@@ -129,7 +127,7 @@ static public void generateMipMaps(PGraphicsOpenGL pg){
129127
PGL pgl = pg.beginPGL();
130128
pgl.bindTexture (tex.glTarget, tex.glName);
131129
pgl.texParameteri (tex.glTarget, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR_MIPMAP_LINEAR);
132-
pgl.texParameteri (tex.glTarget, GL2.GL_GENERATE_MIPMAP, GL.GL_TRUE);
130+
// pgl.texParameteri (tex.glTarget, GL2.GL_GENERATE_MIPMAP, GL.GL_TRUE);
133131
pgl.generateMipmap(tex.glTarget);
134132
pgl.bindTexture (tex.glTarget, 0);
135133
pg.endPGL();

src/com/thomasdiewald/pixelflow/java/imageprocessing/DwShadertoy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,14 @@ public void dispose(){
107107

108108
public void release(){
109109
tex.release();
110-
reset();
111110
}
112111

113112

114113
public boolean resize(int w, int h){
115114
boolean resized = tex.resize(context, GL2.GL_RGBA32F, w, h, GL2.GL_RGBA, GL2.GL_FLOAT, GL2.GL_LINEAR, GL2.GL_CLAMP_TO_EDGE, 4, 4);
116115
if(resized && auto_reset_on_resize){
117116
reset();
117+
tex.clear(0.0f);
118118
}
119119
return resized;
120120
}

0 commit comments

Comments
 (0)