Showing posts with label processing. Show all posts
Showing posts with label processing. Show all posts

Wednesday, February 21, 2018

Cannot locate connected device in Processing

Leave a Comment

I'm having trouble getting Processing 3.3.6 (x64) for Windows 10 to recognize my LG V20 android device.

At first, I was getting a NoClassDefFoundError when I tried to run a sketch, and the Android SDK updater had 2 suggested updates that I couldn't install due to more errors. My phone was not listed in Processing. The device was I've enabled USB debugging, and the connection works; I can transfer files fine.

After reading across the internet with little advice or success, I tried uninstalling all Android-related files on my computer, as well as any Processing-related files. I uninstalled Java, JRE and JDK. I then reinstalled them all:

  • Java 8u161 JDK and JRE

  • Processing 3.3.6

  • Android SDK (auto-installed by Processing)

It all installed without complaint, and everything seemed fine. However, Processing still can't find or recognize my device. I've also tried these exact steps on my laptop which has a mostly clean install of Windows 10 (apart from chrome and some bloatware) with the same results.

I also tried running something via Processing's emulator; I may have done this wrong, but this comes up with a "Lost connection with emulator while launching" error.

From this, it feels like it HAS to be an issue with the phone, since it's on multiple PCs. But it also HAS to be an issue with the PC, since it occurs on both a phone and an emulator. Frankly, I'm dumbfounded as to what the problem is.

I'm not really sure what else I can do or try; I haven't found my problem anywhere else, and tried the solutions to all similar problems with no success. Does anybody have any ideas?

EDIT: I fixed the problem. I tracked down the location of my adb.exe, and ran "adb devices" in cmd at that location. It listed one device (mine), and said it was unauthorized. A prompt appeared on my phone, and upon confirming it, the device was authorized.

1 Answers

Answers 1

first off all check is your device connected to sdk by running this command

sdk/platform-tools/adb devices 

if your device name not found make sure that you have USB debug enabled

goto settings/developer settings/ allow USB debug mode

if you don't see this option search how to enable developer settings for your phone mine was like goto settings/about/software info and tap constantly on build-number for 7 times

Read More

Friday, February 17, 2017

Processing LoadLibrary failed with error 1114

Leave a Comment

I am running Processing 3.2.4 on Windows 10, and am trying to run a simple 3D program:

void setup(){    size(1200, 800, P3D); }  void draw(){   } 

Whenever I try running the program, instead of getting my program window, I am getting a popup with the following error:LoadLibrary failed with error 1114: A dynamic link library (DLL) initialization routine failed.

What does this error mean, and how can I fix it? (I already tried reinstalling Processing). I am running Processing 3.2.4 on Windows 10, and am trying to run a simple 3D program:

void setup(){    size(1200, 800, P3D); }  void draw(){   } 

Whenever I try running the program, instead of getting my program window, I am getting a popup with the following error:LoadLibrary failed with error 1114: A dynamic link library (DLL) initialization routine failed.

What does this error mean, and how can I fix it? (I already tried reinstalling Processing).

Edit: After clicking close on the error message, the console prints:

Could not run the sketch (Target VM failed to initialize). For more information, read revisions.txt and Help ? Troubleshooting.

The default graphics renderer works. Restarting my computer or moving the installation to another folder hasn't worked either.

1 Answers

Answers 1

I'm not sure why this works, but go to Battery Power plans, and edit the Switchable Dynamic Graphics -> Global Setting inside the advanced power plan settings and set both of the options to Maximize Performance.

Read More

Saturday, April 16, 2016

Trying to port a GLSL glass shader to Processing 3.0

Leave a Comment

EDITED

I am beginner on Processing language and GLSL shaders. I am trying to port a fresnel+cubemap shader for a glass material. But as result my shape ever disappear, instead... :-(

My vertex shader is:

const float Air = 1.0; const float Glass = 1.51714;  const float Eta = Air / Glass;  const float R0 = ((Air - Glass) * (Air - Glass)) / ((Air + Glass) * (Air + Glass));  uniform mat4 transform; uniform mat4 modelview; uniform mat3 normalMatrix;  attribute vec4 vertex; attribute vec3 normal;  varying vec3 v_reflection; varying vec3 v_refraction; varying float v_fresnel;  void main(void){      vec4 t_vertex = modelview * vertex;      vec3 incident = normalize(vec3(t_vertex));      vec3 t_normal = normalMatrix * normal;      v_refraction = refract(incident, t_normal, Eta);     v_reflection = reflect(incident, t_normal);      v_fresnel = R0 + (1.0 - R0) * pow((1.0 - dot(-incident, t_normal)), 5.0);      gl_Position = transform * t_vertex; } 

And the fragment shader:

#ifdef GL_ES precision mediump float; precision mediump int; #endif  uniform samplerCube cubemap;  varying vec3 v_refraction; varying vec3 v_reflection; varying float v_fresnel;  void main(void){     vec4 refractionColor = textureCube(cubemap, normalize(v_refraction));     vec4 reflectionColor = textureCube(cubemap, normalize(v_reflection));      gl_FragColor = mix(refractionColor, reflectionColor, v_fresnel); } 

I am testing this shader with the Processing 3.0 sketch bellow (edited), on Android Mode:

PShader shader; PShape sphere;  void setup() {   fullScreen(P3D);   noStroke();    shader = loadShader("glass.frag.glsl", "glass.vert.glsl");   openCubeMap("posx.png", "negx.png", "posy.png", "negy.png", "posz.png", "negz.png");   shader.set("cubemap", 1);    sphere = createShape(SPHERE, 120);   sphere.setFill(color(-1, 50)); }   void draw() {   background(0);          directionalLight(102, 102, 102, 0, 0, -1);   lightSpecular(204, 204, 204);   directionalLight(102, 102, 102, 0, 1, -1);   specular(100, 150, 150);    translate(width / 2, height / 2);   shader(shader);   shape(sphere); }    void openCubeMap(String posX, String negX, String posY, String negY, String posZ, String negZ) {    PGL pgl = beginPGL();   // create the OpenGL-based cubeMap   IntBuffer envMapTextureID = IntBuffer.allocate(1);   pgl.genTextures(1, envMapTextureID);   pgl.activeTexture(PGL.TEXTURE1);   pgl.enable(PGL.TEXTURE_CUBE_MAP);     pgl.bindTexture(PGL.TEXTURE_CUBE_MAP, envMapTextureID.get(0));   pgl.texParameteri(PGL.TEXTURE_CUBE_MAP, PGL.TEXTURE_WRAP_S, PGL.CLAMP_TO_EDGE);   pgl.texParameteri(PGL.TEXTURE_CUBE_MAP, PGL.TEXTURE_WRAP_T, PGL.CLAMP_TO_EDGE);   pgl.texParameteri(PGL.TEXTURE_CUBE_MAP, PGL.TEXTURE_WRAP_R, PGL.CLAMP_TO_EDGE);   pgl.texParameteri(PGL.TEXTURE_CUBE_MAP, PGL.TEXTURE_MIN_FILTER, PGL.LINEAR);   pgl.texParameteri(PGL.TEXTURE_CUBE_MAP, PGL.TEXTURE_MAG_FILTER, PGL.LINEAR);    //Load in textures   String[] textureNames = { posX, negX, posY, negY, posZ, negZ };   for (int i=0; i<textureNames.length; i++) {         PImage texture = loadImage(textureNames[i]);     int w = texture.width;     int h = texture.height;     texture.loadPixels();     pgl.texImage2D(PGL.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, PGL.RGBA, w, h, 0, PGL.RGBA, PGL.UNSIGNED_BYTE, IntBuffer.wrap(texture.pixels));   }    endPGL(); } 

And I am using this images to build the cubemap.

Someone know how I can make this work?

0 Answers

Read More