mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
fix some begin/endRaw issues, along with bug #465, which broke ambientLight
This commit is contained in:
@@ -1308,10 +1308,10 @@ public class PGraphics3D extends PGraphics {
|
||||
|
||||
protected float depth_sort_triangles_compare(int a, int b) {
|
||||
if (Float.isNaN(vertices[triangles[a][VERTEX1]][Z]) ||
|
||||
Float.isNaN(vertices[triangles[a][VERTEX2]][Z]) ||
|
||||
Float.isNaN(vertices[triangles[a][VERTEX3]][Z]) ||
|
||||
Float.isNaN(vertices[triangles[b][VERTEX1]][Z]) ||
|
||||
Float.isNaN(vertices[triangles[b][VERTEX2]][Z]) ||
|
||||
Float.isNaN(vertices[triangles[a][VERTEX2]][Z]) ||
|
||||
Float.isNaN(vertices[triangles[a][VERTEX3]][Z]) ||
|
||||
Float.isNaN(vertices[triangles[b][VERTEX1]][Z]) ||
|
||||
Float.isNaN(vertices[triangles[b][VERTEX2]][Z]) ||
|
||||
Float.isNaN(vertices[triangles[b][VERTEX3]][Z])) {
|
||||
throw new RuntimeException("nan triangle");
|
||||
}
|
||||
@@ -1877,7 +1877,7 @@ public class PGraphics3D extends PGraphics {
|
||||
v[DR] * contribution[LIGHT_DIFFUSE_R]);
|
||||
v[G] = min(1, v[EG] + v[AG] * contribution[LIGHT_AMBIENT_G] +
|
||||
v[DG] * contribution[LIGHT_DIFFUSE_G]);
|
||||
v[B] = min(1, v[EB] + v[AB] * contribution[LIGHT_AMBIENT_R] +
|
||||
v[B] = min(1, v[EB] + v[AB] * contribution[LIGHT_AMBIENT_B] +
|
||||
v[DB] * contribution[LIGHT_DIFFUSE_B]);
|
||||
v[A] = min(1, v[DA]);
|
||||
|
||||
|
||||
@@ -8,6 +8,11 @@ X make imageImpl() use WritableRaster in an attempt to speed things up
|
||||
X fix weird situation where fonts used in more than one renderer wouldn't show
|
||||
X opengl doesn't draw a background for the raw recorder
|
||||
X change P3D to smooth images nicely (bilinear was disabled)
|
||||
X ambientLight(r,g,b) was still ambientLight(r,g,r)
|
||||
X http://dev.processing.org/bugs/show_bug.cgi?id=465
|
||||
|
||||
_ P3D smooshes the top row of pixels when drawing text (or images)
|
||||
_ http://dev.processing.org/bugs/show_bug.cgi?id=466
|
||||
|
||||
_ in opengl mode, use its tesselator
|
||||
_ because the vertex calls can just come right back to regular vertex calls
|
||||
|
||||
Reference in New Issue
Block a user