processing-android icon indicating copy to clipboard operation
processing-android copied to clipboard

PShape's texture not displaying in Android Mode

Open Mesalcode opened this issue 5 years ago • 0 comments

Description

A PShape's texture does not display correctly when using Android Mode. The same exact code runs as expected on both Java Mode and APDE.

Expected Behavior

The attached code should display a simple rounded cube 3D model with a texture from an image.

Current Behavior

The texture is not shown, the cube only has a blueish color, that seems to be caused by the setFill and setTint functions working unexpectedly aswell (see Possible Causes section)

Steps to Reproduce

  1. Create a new sketch
  2. Add files to data folder: 1,2
  3. Run the following code in Android Mode:
PShape cube;
PImage front;

void setup(){
 fullScreen(P3D); 
 frameRate(60);
 smooth(10);
 cube = loadShape("cube.obj");
 front = loadImage("cubesite_front.PNG");
 textureMode(NORMAL);
 textureWrap(REPEAT);
 cube.setFill(color(255));
 cube.setTint(color(255));
 cube.setTexture(front);
}

void draw(){
  background(255);
  lights();
  stroke(125);
  fill(125);
  translate(width/2,height/2);
  scale(210);
  shape(cube);
}

Your Environment

  • Processing version: 3.5.4
  • Operating System and OS version: Both Windows 10 and Pop!_OS 20.04 (NVIDIA)

Possible Causes / Solutions

Android Mode seems to deal with Shapes in different ways. The setFill and setTint functions of the above code also work differently. While as expected, on Java Mode, they remove the darker default tint/fill of a textured shape, they seem to apply a blueish tint, when using color(255) as a parameter.

Mesalcode avatar Aug 26 '20 12:08 Mesalcode