Skip to content

Commit

Permalink
Release v1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
diwi committed Oct 18, 2017
1 parent 16ad451 commit fbe3663
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class ColorPalletteMixer extends PApplet {
// Example for getting a smooth color from a discrete color pallette.

public void settings(){
size(1200, 600, P2D);
size(1000, 100, P2D);
}

public void setup(){
Expand Down
33 changes: 8 additions & 25 deletions examples/Miscellaneous/DepthOfField_Demo/DepthOfField_Demo.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import com.thomasdiewald.pixelflow.java.geometry.DwMeshUtils;
import com.thomasdiewald.pixelflow.java.imageprocessing.filter.DepthOfField;
import com.thomasdiewald.pixelflow.java.imageprocessing.filter.DwFilter;
import com.thomasdiewald.pixelflow.java.imageprocessing.filter.SummedAreaTable;
import com.thomasdiewald.pixelflow.java.render.skylight.DwSceneDisplay;
import com.thomasdiewald.pixelflow.java.render.skylight.DwScreenSpaceGeometryBuffer;
import com.thomasdiewald.pixelflow.java.utils.DwMagnifier;
Expand Down Expand Up @@ -61,8 +60,6 @@ public class DepthOfField_Demo extends PApplet {
PGraphics3D pg_tmp;
DwScreenSpaceGeometryBuffer geombuffer;

SummedAreaTable sat;

DepthOfField dof;

DwMagnifier magnifier;
Expand Down Expand Up @@ -92,11 +89,6 @@ public void setup() {
// projection
perspective(60 * DEG_TO_RAD, width/(float)height, 2, 6000);

// processing font

// shape = loadShape("examples/data/skylight_demo_scene.obj");
// shape.scale(20);

pg_render = (PGraphics3D) createGraphics(width, height, P3D);
pg_render.smooth(8);

Expand All @@ -106,24 +98,17 @@ public void setup() {
pg_dof.beginDraw();
pg_dof.endDraw();


pg_tmp = (PGraphics3D) createGraphics(width, height, P3D);
pg_tmp = (PGraphics3D) createGraphics(width, height, P3D);
pg_tmp.smooth(0);

DwGLTextureUtils.changeTextureFormat(pg_tmp, GL2.GL_RGBA16F, GL2.GL_RGBA, GL2.GL_FLOAT);
pg_tmp.beginDraw();
// pg_tmp.hint(PConstants.DISABLE_TEXTURE_MIPMAPS);
// pg_tmp.textureSampling(2);
// pg_tmp.background(0xFFFFFFFF);
// pg_tmp.blendMode(PConstants.REPLACE);
// pg_tmp.noStroke();
pg_tmp.endDraw();

// main library context
context = new DwPixelFlow(this);
context.print();
context.printGL();



// callback for scene display (used in GBAA)
Expand All @@ -134,14 +119,11 @@ public void display(PGraphics3D canvas) {
}
};

sat = new SummedAreaTable(context);


geombuffer = new DwScreenSpaceGeometryBuffer(context, scene_display);

dof = new DepthOfField(context);


int mag_h = (int) (height/3f);
magnifier = new DwMagnifier(this, 4, 0, height-mag_h, mag_h, mag_h);

Expand All @@ -164,29 +146,30 @@ public void draw() {

DwFilter.get(context).gaussblur.apply(geombuffer.pg_geom, geombuffer.pg_geom, pg_tmp, 5);

// sat.create(pg_render);

// dof.param.focus = map(mouseX, 0, width, 0, 1);
dof.param.focus_pos = new float[]{0.5f, 0.5f};
dof.param.focus_pos[0] = map(mouseX+0.5f, 0, width , 0, 1);
dof.param.focus_pos[1] = map(mouseY+0.5f, 0, height, 1, 0);
dof.param.mult_blur = mult_blur;
dof.apply(pg_render, pg_dof,geombuffer);
dof.apply(pg_render, pg_dof, geombuffer);

DwFilter.get(context).copy.apply(pg_dof, pg_render);
} else {

}

magnifier.apply(pg_dof, mouseX, mouseY);
magnifier.apply(pg_render, mouseX, mouseY);
magnifier.displayTool();

peasycam.beginHUD();
{
blendMode(REPLACE);
clear();
image(pg_dof, 0, 0);
image(pg_render, 0, 0);
// image(geombuffer.pg_geom, 0, 0);

magnifier.display(this.g);


blendMode(BLEND);

pushMatrix();
Expand Down
6 changes: 3 additions & 3 deletions src/com/thomasdiewald/pixelflow/java/DwPixelFlow.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class DwPixelFlow{

static public class PixelFlowInfo{

static public final String version = "1.16";
static public final String version = "1.17";
static public final String name = "PixelFlow";
static public final String author = "Thomas Diewald";
static public final String web = "www.thomasdiewald.com";
Expand All @@ -56,8 +56,8 @@ public String toString(){
}


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

public PApplet papplet;
public PJOGL pjogl;
Expand Down

0 comments on commit fbe3663

Please sign in to comment.