◐ Shell
reader mode source ↗
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
13 changes: 8 additions & 5 deletions build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<property name="jre.download.jdk" value="true" />
<property name="jre.downloader" value="linux-arm32-vfp-hflt.tar.gz" />
<property name="linux.dist" value="linux/processing-${version}-linux-armv6hf.tgz" />
</target>
<target name="check-linux-arm64" if="linux-arm64">
<property name="jre.download.jdk" value="true" />
Expand All @@ -70,11 +71,11 @@
value="../../processing-docs/content/examples" />

<property name="jdk.version" value="8" />
<property name="jdk.update" value="162" />
<property name="jdk.build" value="12" />
<!-- See https://gist.github.com/P7h/9741922
or http://stackoverflow.com/q/10268583 -->
<property name="jdk.hash" value="0da788060d494f5095bf8624735fa2f1" />

<property name="jdk.short" value="${jdk.version}u${jdk.update}" />
<property name="jdk.esoteric" value="1.${jdk.version}.0_${jdk.update}" />
Expand Down Expand Up @@ -798,11 +799,13 @@

<property name="launch4j.dir"
value="linux/work/modes/java/application/launch4j" />

<!-- rename the version we need -->
<move file="${launch4j.dir}/bin/windres-linux"
tofile="${launch4j.dir}/bin/windres" />
<move file="${launch4j.dir}/bin/ld-linux"
tofile="${launch4j.dir}/bin/ld" />

<!-- make executable (ant doesn't preserve) -->
39 changes: 23 additions & 16 deletions core/src/processing/opengl/PGL.java
Original file line number Diff line number Diff line change
Expand Up @@ -1287,9 +1287,9 @@ protected PGL initTex2DShader() {
PGL ppgl = primaryPGL ? this : graphics.getPrimaryPGL();

if (!ppgl.loadedTex2DShader || ppgl.tex2DShaderContext != ppgl.glContext) {
String[] preprocVertSrc = preprocessVertexSource(texVertShaderSource, getGLSLVersion());
String vertSource = PApplet.join(preprocVertSrc, "\n");
String[] preprocFragSrc = preprocessFragmentSource(tex2DFragShaderSource, getGLSLVersion());
String fragSource = PApplet.join(preprocFragSrc, "\n");
ppgl.tex2DVertShader = createShader(VERTEX_SHADER, vertSource);
ppgl.tex2DFragShader = createShader(FRAGMENT_SHADER, fragSource);
Expand Down Expand Up @@ -1419,9 +1419,9 @@ protected PGL initTexRectShader() {
PGL ppgl = primaryPGL ? this : graphics.getPrimaryPGL();

if (!ppgl.loadedTexRectShader || ppgl.texRectShaderContext != ppgl.glContext) {
String[] preprocVertSrc = preprocessVertexSource(texVertShaderSource, getGLSLVersion());
String vertSource = PApplet.join(preprocVertSrc, "\n");
String[] preprocFragSrc = preprocessFragmentSource(texRectFragShaderSource, getGLSLVersion());
String fragSource = PApplet.join(preprocFragSrc, "\n");
ppgl.texRectVertShader = createShader(VERTEX_SHADER, vertSource);
ppgl.texRectFragShader = createShader(FRAGMENT_SHADER, fragSource);
Expand Down Expand Up @@ -1848,6 +1848,7 @@ protected static int qualityToSamples(int quality) {


abstract protected int getGLSLVersion();


protected String[] loadVertexShader(String filename) {
Expand Down Expand Up @@ -1880,28 +1881,29 @@ protected String[] loadVertexShader(URL url) {
}


protected String[] loadVertexShader(String filename, int version) {
return loadVertexShader(filename);
}


protected String[] loadFragmentShader(String filename, int version) {
return loadFragmentShader(filename);
}


protected String[] loadFragmentShader(URL url, int version) {
return loadFragmentShader(url);
}


protected String[] loadVertexShader(URL url, int version) {
return loadVertexShader(url);
}


protected static String[] preprocessFragmentSource(String[] fragSrc0,
int version) {
if (containsVersionDirective(fragSrc0)) {
// The user knows what she or he is doing
return fragSrc0;
Expand All @@ -1915,7 +1917,7 @@ protected static String[] preprocessFragmentSource(String[] fragSrc0,
int offset = 1;

fragSrc = preprocessShaderSource(fragSrc0, search, replace, offset);
fragSrc[0] = "#version " + version;
} else {
// We need to replace 'texture' uniform by 'texMap' uniform and
// 'textureXXX()' functions by 'texture()' functions. Order of these
Expand All @@ -1932,15 +1934,20 @@ protected static String[] preprocessFragmentSource(String[] fragSrc0,
int offset = 2;

fragSrc = preprocessShaderSource(fragSrc0, search, replace, offset);
fragSrc[0] = "#version " + version;
fragSrc[1] = "out vec4 _fragColor;";
}

return fragSrc;
}

protected static String[] preprocessVertexSource(String[] vertSrc0,
int version) {
if (containsVersionDirective(vertSrc0)) {
// The user knows what she or he is doing
return vertSrc0;
Expand All @@ -1954,7 +1961,7 @@ protected static String[] preprocessVertexSource(String[] vertSrc0,
int offset = 1;

vertSrc = preprocessShaderSource(vertSrc0, search, replace, offset);
vertSrc[0] = "#version " + version;
} else {
// We need to replace 'texture' uniform by 'texMap' uniform and
// 'textureXXX()' functions by 'texture()' functions. Order of these
Expand All @@ -1971,7 +1978,7 @@ protected static String[] preprocessVertexSource(String[] vertSrc0,
int offset = 1;

vertSrc = preprocessShaderSource(vertSrc0, search, replace, offset);
vertSrc[0] = "#version " + version;
}

return vertSrc;
Expand Down Expand Up @@ -2225,7 +2232,7 @@ protected boolean hasPackedDepthStencilSupport() {

protected boolean hasAnisoSamplingSupport() {
int major = getGLVersion()[0];
if (major < 3) {
String ext = getString(EXTENSIONS);
return -1 < ext.indexOf("_texture_filter_anisotropic");
} else {
Expand Down
23 changes: 13 additions & 10 deletions core/src/processing/opengl/PGraphicsOpenGL.java
Original file line number Diff line number Diff line change
Expand Up @@ -1561,13 +1561,14 @@ protected void restoreGL() {
}
pgl.depthFunc(PGL.LEQUAL);

if (OPENGL_RENDERER.equals("VideoCore IV HW")) {
// Broadcom's VC IV driver is unhappy with either of these
// ignore for now
} else if (smooth < 1) {
pgl.disable(PGL.MULTISAMPLE);
} else if (1 <= smooth) {
pgl.enable(PGL.MULTISAMPLE);
pgl.disable(PGL.POLYGON_SMOOTH);
}

Expand Down @@ -6775,16 +6776,14 @@ protected void setGLSettings() {
// quality = temp;
// }
}
if (OPENGL_RENDERER.equals("VideoCore IV HW")) {
// Broadcom's VC IV driver is unhappy with either of these
// ignore for now
} else if (smooth < 1) {
pgl.disable(PGL.MULTISAMPLE);
} else if (1 <= smooth) {
pgl.enable(PGL.MULTISAMPLE);
}
// work around runtime exceptions in Broadcom's VC IV driver
if (false == OPENGL_RENDERER.equals("VideoCore IV HW")) {
pgl.disable(PGL.POLYGON_SMOOTH);
}

Expand Down @@ -6895,8 +6894,12 @@ protected void getGLParameters() {

// overwrite the default shaders with vendor specific versions
// if needed
if (OPENGL_RENDERER.equals("VideoCore IV HW") || // Broadcom's binary driver for Raspberry Pi
OPENGL_RENDERER.contains("VC4")) { // Mesa driver for same hardware
defLightShaderVertURL =
PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/LightVert-vc4.glsl");
defTexlightShaderVertURL =
Expand Down
44 changes: 32 additions & 12 deletions core/src/processing/opengl/PJOGL.java
Original file line number Diff line number Diff line change
Expand Up @@ -509,50 +509,59 @@ protected int getGLSLVersion() {
return vn.getMajor() * 100 + vn.getMinor();
}


@Override
protected String[] loadVertexShader(String filename) {
return loadVertexShader(filename, getGLSLVersion());
}


@Override
protected String[] loadFragmentShader(String filename) {
return loadFragmentShader(filename, getGLSLVersion());
}


@Override
protected String[] loadVertexShader(URL url) {
return loadVertexShader(url, getGLSLVersion());
}


@Override
protected String[] loadFragmentShader(URL url) {
return loadFragmentShader(url, getGLSLVersion());
}


@Override
protected String[] loadFragmentShader(String filename, int version) {
String[] fragSrc0 = sketch.loadStrings(filename);
return preprocessFragmentSource(fragSrc0, version);
}


@Override
protected String[] loadVertexShader(String filename, int version) {
String[] vertSrc0 = sketch.loadStrings(filename);
return preprocessVertexSource(vertSrc0, version);
}


@Override
protected String[] loadFragmentShader(URL url, int version) {
try {
String[] fragSrc0 = PApplet.loadStrings(url.openStream());
return preprocessFragmentSource(fragSrc0, version);
} catch (IOException e) {
PGraphics.showException("Cannot load fragment shader " + url.getFile());
}
@@ -561,10 +570,10 @@ protected String[] loadFragmentShader(URL url, int version) {


@Override
protected String[] loadVertexShader(URL url, int version) {
try {
String[] vertSrc0 = PApplet.loadStrings(url.openStream());
return preprocessVertexSource(vertSrc0, version);
} catch (IOException e) {
PGraphics.showException("Cannot load vertex shader " + url.getFile());
}
Expand Down Expand Up @@ -1926,6 +1935,8 @@ public void blitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, int dstX
gl2x.glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
} else if (gl3 != null) {
gl3.glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
} else {
throw new RuntimeException(String.format(MISSING_GLFUNC_ERROR, "glBlitFramebuffer()"));
}
Expand All @@ -1937,6 +1948,8 @@ public void renderbufferStorageMultisample(int target, int samples, int format,
gl2x.glRenderbufferStorageMultisample(target, samples, format, width, height);
} else if (gl3 != null) {
gl3.glRenderbufferStorageMultisample(target, samples, format, width, height);
} else {
throw new RuntimeException(String.format(MISSING_GLFUNC_ERROR, "glRenderbufferStorageMultisample()"));
}
@@ -1948,6 +1961,8 @@ public void readBuffer(int buf) {
gl2x.glReadBuffer(buf);
} else if (gl3 != null) {
gl3.glReadBuffer(buf);
} else {
throw new RuntimeException(String.format(MISSING_GLFUNC_ERROR, "glReadBuffer()"));
}
Expand All @@ -1959,6 +1974,11 @@ public void drawBuffer(int buf) {
gl2x.glDrawBuffer(buf);
} else if (gl3 != null) {
gl3.glDrawBuffer(buf);
} else {
throw new RuntimeException(String.format(MISSING_GLFUNC_ERROR, "glDrawBuffer()"));
}
Loading
Toggle all file notes Toggle all file annotations