Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
32a8fbf
Serial: Add support for opening Raspbian-style named ports
gohai Mar 16, 2018
01ccaf1
Increase the maximum number of lights to 4 for Mesa vc4
gohai Mar 16, 2018
bf4e7a3
ARM Mali: Implement glRenderbufferStorageMultisample for gl3es3
gohai Apr 18, 2018
fada294
ARM Mali: Implement glReadBuffer for gl3es3
gohai Apr 18, 2018
e151628
ARM Mali: Report "es" as part of GLSL versions
gohai Apr 18, 2018
0965370
ARM Mali: Specify precision for _fragColor
gohai Apr 18, 2018
e5ba6a9
ARM Mali: Implement glBlitFramebuffer for gl3es3
gohai Apr 18, 2018
d96aa3a
ARM Mali: Implement gDrawBuffer for gl3es3
gohai Apr 18, 2018
f73f460
ARM Mali: Don't assume anisotropic filtering for gl3es3
gohai Apr 18, 2018
a476177
update to Java 8u172
benfry Apr 23, 2018
ec47beb
IO: Implement Raspbian-only method for setting pull{up,down} resistors
gohai Jun 16, 2018
7cde730
IO: Clarify SimpleInput example
gohai Jun 27, 2018
f7e530a
IO: Speed up GPIO.pinMode()
gohai Jun 25, 2018
dc11272
ARM Mali: Don't use GL_MULTISAMPLE or GL_POLYGON_SMOOTH on ES
gohai Apr 23, 2018
5518417
Unconditionally disable POLYGON_SMOOTH in restoreGL()
gohai Apr 24, 2018
89c3ffa
Enable exporting of Windows applications on ARM
gohai Apr 24, 2018
3b88eeb
IO: Fix crash when I2C.read() was called without prior write()
gohai Jun 28, 2018
657ce85
IO: Add a 100ms timeout to I2C to allow communication with Arduino
gohai Jun 28, 2018
ed6d36d
IO: Reorganize OOP examples
gohai Jun 29, 2018
4e30acd
IO: Add MPR121 capacitive touch example
gohai Jun 29, 2018
afe8609
IO: Add BME280 environmental sensor example
Jun 30, 2018
aea3f99
IO: Add TSL2561 environmental sensor example
Jun 30, 2018
961505d
IO: Add PCA9685 servo/PWM controller example
Jun 30, 2018
841f942
IO: Remove the duplicate "duty" argument from the reference for PWM.s…
gohai Jul 1, 2018
ab1b958
IO: Rename ServoSweep example
gohai Jul 1, 2018
2e1eccd
IO: Make I2C errors more verbose
gohai Jul 10, 2018
c1d9528
IO: Fix pinMode() retry logic
gohai Jul 11, 2018
05d67ba
IO: Add a dispose method to PCA9685 example, document pulse widths
gohai Jul 12, 2018
780cc16
OpenGL ES: Fix GLSL version number for 1.00 (#5582)
gohai Jul 20, 2018
8efa774
Update Java to 8u181
gohai Jul 22, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" />
<property name="launch4j.variant" value="linux-armv6hf" />
</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" />
<property name="jdk.update" value="181" />
<property name="jdk.build" value="13" />
<!-- See https://gist.github.com/P7h/9741922
or http://stackoverflow.com/q/10268583 -->
<property name="jdk.hash" value="0da788060d494f5095bf8624735fa2f1" />
<property name="jdk.hash" value="96a7b8442fe848ef90c96a2fad6ed6d1" />

<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" />
<!-- this might be already overwritten by check-linux-arm32 -->
<property name="launch4j.variant" value="linux" />

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

<!-- make executable (ant doesn't preserve) -->
Expand Down
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[] preprocVertSrc = preprocessVertexSource(texVertShaderSource, getGLSLVersion(), getGLSLVersionSuffix());
String vertSource = PApplet.join(preprocVertSrc, "\n");
String[] preprocFragSrc = preprocessFragmentSource(tex2DFragShaderSource, getGLSLVersion());
String[] preprocFragSrc = preprocessFragmentSource(tex2DFragShaderSource, getGLSLVersion(), getGLSLVersionSuffix());
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[] preprocVertSrc = preprocessVertexSource(texVertShaderSource, getGLSLVersion(), getGLSLVersionSuffix());
String vertSource = PApplet.join(preprocVertSrc, "\n");
String[] preprocFragSrc = preprocessFragmentSource(texRectFragShaderSource, getGLSLVersion());
String[] preprocFragSrc = preprocessFragmentSource(texRectFragShaderSource, getGLSLVersion(), getGLSLVersionSuffix());
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();
abstract protected String getGLSLVersionSuffix();


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) {
protected String[] loadVertexShader(String filename, int version, String versionSuffix) {
return loadVertexShader(filename);
}


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


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


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


protected static String[] preprocessFragmentSource(String[] fragSrc0,
int version) {
int version,
String versionSuffix) {
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;
fragSrc[0] = "#version " + version + versionSuffix;
} 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;";
fragSrc[0] = "#version " + version + versionSuffix;
if (" es".equals(versionSuffix)) {
fragSrc[1] = "out mediump vec4 _fragColor;";
} else {
fragSrc[1] = "out vec4 _fragColor;";
}
}

return fragSrc;
}

protected static String[] preprocessVertexSource(String[] vertSrc0,
int version) {
int version,
String versionSuffix) {
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;
vertSrc[0] = "#version " + version + versionSuffix;
} 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;
vertSrc[0] = "#version " + version + versionSuffix;
}

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

protected boolean hasAnisoSamplingSupport() {
int major = getGLVersion()[0];
if (major < 3) {
if (isES() || 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
if (pgl.isES()) {
// neither GL_MULTISAMPLE nor GL_POLYGON_SMOOTH are part of GLES2 or GLES3
} else if (smooth < 1) {
pgl.disable(PGL.MULTISAMPLE);
} else if (1 <= smooth) {
pgl.enable(PGL.MULTISAMPLE);
}
if (!pgl.isES()) {
pgl.disable(PGL.POLYGON_SMOOTH);
}

Expand Down Expand Up @@ -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
if (pgl.isES()) {
// neither GL_MULTISAMPLE nor GL_POLYGON_SMOOTH are part of GLES2 or GLES3
} 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")) {
if (!pgl.isES()) {
pgl.disable(PGL.POLYGON_SMOOTH);
}

Expand Down Expand Up @@ -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
if (OPENGL_RENDERER.equals("VideoCore IV HW")) { // Broadcom's binary driver for Raspberry Pi
defLightShaderVertURL =
PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/LightVert-brcm.glsl");
defTexlightShaderVertURL =
PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/TexLightVert-brcm.glsl");
} else if (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();
}

protected String getGLSLVersionSuffix() {
VersionNumber vn = context.getGLSLVersionNumber();
if (context.isGLESProfile() && 1 < vn.getMajor()) {
return " es";
} else {
return "";
}
}


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


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


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


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


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


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


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


@Override
protected String[] loadVertexShader(URL url, int version) {
protected String[] loadVertexShader(URL url, int version, String versionSuffix) {
try {
String[] vertSrc0 = PApplet.loadStrings(url.openStream());
return preprocessVertexSource(vertSrc0, version);
return preprocessVertexSource(vertSrc0, version, versionSuffix);
} 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 if (gl3es3 != null) {
gl3es3.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 if (gl3es3 != null) {
gl3es3.glRenderbufferStorageMultisample(target, samples, format, width, height);
} else {
throw new RuntimeException(String.format(MISSING_GLFUNC_ERROR, "glRenderbufferStorageMultisample()"));
}
Expand All @@ -1948,6 +1961,8 @@ public void readBuffer(int buf) {
gl2x.glReadBuffer(buf);
} else if (gl3 != null) {
gl3.glReadBuffer(buf);
} else if (gl3es3 != null) {
gl3es3.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 if (gl3es3 != null) {
IntBuffer intBuffer = IntBuffer.allocate(1);
intBuffer.put(buf);
intBuffer.rewind();
gl3es3.glDrawBuffers(1, intBuffer);
} else {
throw new RuntimeException(String.format(MISSING_GLFUNC_ERROR, "glDrawBuffer()"));
}
Expand Down
Loading