From c5838c950fd02ea608836fd2078df7a3c558ea68 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Mon, 9 Apr 2012 19:55:01 +0000 Subject: [PATCH] fill() also sets the ambient color (as the old P3D used to do) --- .../src/processing/opengl/PGraphicsOpenGL.java | 16 ++++++++++++++++ .../src/processing/opengl/PGraphicsOpenGL.java | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/android/core/src/processing/opengl/PGraphicsOpenGL.java b/android/core/src/processing/opengl/PGraphicsOpenGL.java index de516913e..bdd3be716 100644 --- a/android/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/android/core/src/processing/opengl/PGraphicsOpenGL.java @@ -4071,6 +4071,22 @@ public class PGraphicsOpenGL extends PGraphics { } + ////////////////////////////////////////////////////////////// + + // FILL COLOR + + + protected void fillFromCalc() { + super.fillFromCalc(); + + // Setting the ambient color from the current fill + // is what the old P3D did and allows to have an + // default ambient color when the user doesn't specify + // it explicitly. + ambientFromCalc(); + } + + ////////////////////////////////////////////////////////////// // LIGHTING diff --git a/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java b/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java index c71a8174a..2847329aa 100644 --- a/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java +++ b/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java @@ -4079,6 +4079,22 @@ public class PGraphicsOpenGL extends PGraphics { this.strokeCap = cap; } + + ////////////////////////////////////////////////////////////// + + // FILL COLOR + + + protected void fillFromCalc() { + super.fillFromCalc(); + + // Setting the ambient color from the current fill + // is what the old P3D did and allows to have an + // default ambient color when the user doesn't specify + // it explicitly. + ambientFromCalc(); + } + //////////////////////////////////////////////////////////////