Here's a "hack" that sort of points out the culprit and provides a work around of sorts (though NOT fully compatible):
Quote:
PImage img;
void setup() {
size(200,200,P3D);
img = loadImage("milan_rubbish.jpg");
}
void draw() {
tint(color(255,0,0));
rotateZ(0.1);
// image(img,0,0); // won't tint
hacked_image(img,0,0); // will tint
}
// a hacked version of image(PImage,float,float) from PGraphics:
// (note: this is NOT a complete solution, like it doesn't support
// imageMode(CORNERS) and so forth, just a quick hack to "expose" the problem)
void hacked_image(PImage image, float x, float y) {
float x1 = x;
float x2 = x + image.width;
float y1 = y;
float y2 = y + image.height;
float u1 = 0;
float v1 = 0;
float u2 = image.width;
float v2 = image.height;
boolean savedStroke = g.stroke;
g.stroke = false;
color savedFillColor = g.fillColor;
color savedTintColor = g.tintColor;
// some "slightly" different color
color alterTintColor = color(red(savedTintColor)-1, green(savedTintColor), blue(savedTintColor), alpha(savedTintColor));
beginShape(QUADS);
texture(image);
// HOW THE HACK WORKS:
// normally P3D won't tint a flat-shaded textured triangle
// (it will take the alpha from the tint, but not the rgb)
// so by slightly varying the fill on vertexes it forces the triangle renderer
// to use gourard shading thus tinting the texture as expected (more or less)
fill(alterTintColor); vertex(x1, y1, u1, v1);
fill(savedTintColor); vertex(x1, y2, u1, v2);
fill(alterTintColor); vertex(x2, y2, u2, v2);
fill(savedTintColor); vertex(x2, y1, u2, v1);
endShape();
// restore stuff we've messed with:
fill(savedFillColor);
g.stroke = savedStroke;
}