Problem showing 3d model

Started by receme, September 09, 2015, 08:24:50 AM

Previous topic - Next topic

receme

Hello, I am trying to load a .obj 3d model using jpct-ae. it loaded successfully but there is a gray shade over the 3d model. However, in my samsung galaxy A5 device, model is showing ok. But in nexus 6 device, a gray shade is showing over the model. How to solve this problem?

EgonOlsen

Are you using any custom shaders for this? Can you post the complete log output?

receme

#2
No I have not used any custom shader. I followed the sample project and modify that according to my project

Here is the log.....


09-09 15:19:16.817  21613-21613/com.infolytx.mobilityapp I/jPCT-AE﹕ onCreate
09-09 15:19:16.946  21613-21613/com.infolytx.mobilityapp D/ActivityThread﹕ ACT-AM_ON_RESUME_CALLED ActivityRecord{425123e0 token=android.os.BinderProxy@42511b50 {com.infolytx.mobilityapp/com.infolytx.jpct.Promotion3dModel}}
09-09 15:19:16.951  21613-21613/com.infolytx.mobilityapp V/PhoneWindow﹕ DecorView setVisiblity: visibility = 0 ,Parent =ViewRoot{4267bcd0 com.infolytx.mobilityapp/com.infolytx.jpct.Promotion3dModel,ident = 4}, this =com.android.internal.policy.impl.PhoneWindow$DecorView{4259d2a8 V.E..... R.....I. 0,0-0,0}
09-09 15:19:16.952  21613-21613/com.infolytx.mobilityapp D/ActivityThread﹕ ACT-LAUNCH_ACTIVITY handled : 0 / ActivityRecord{425123e0 token=android.os.BinderProxy@42511b50 {com.infolytx.mobilityapp/com.infolytx.jpct.Promotion3dModel}}
09-09 15:19:17.089  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ GL context is 1104865928
09-09 15:19:17.093  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Initializing GL20 render pipeline...
09-09 15:19:17.094  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Accessing shaders via JAR!
09-09 15:19:17.094  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading default shaders !
09-09 15:19:17.095  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ 0 shaders in replacement map!
09-09 15:19:17.095  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Default fragment shader is: /defaultFragmentShader.src
09-09 15:19:17.296  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading file from InputStream
09-09 15:19:17.297  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Text file from InputStream loaded...2416 bytes
09-09 15:19:17.297  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Default vertex shader is: /defaultVertexShader.src
09-09 15:19:17.297  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading file from InputStream
09-09 15:19:17.298  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Text file from InputStream loaded...4496 bytes
09-09 15:19:17.299  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Compiling shader program!
09-09 15:19:17.301  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Handles of 3: 1/32/2
09-09 15:19:17.301  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading default shaders (Tex0Amb)!
09-09 15:19:17.301  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ 0 shaders in replacement map!
09-09 15:19:17.302  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Default fragment shader is: /defaultFragmentShader.src
09-09 15:19:17.303  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading file from InputStream
09-09 15:19:17.303  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Text file from InputStream loaded...199 bytes
09-09 15:19:17.305  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Default vertex shader is: /defaultVertexShader.src
09-09 15:19:17.307  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading file from InputStream
09-09 15:19:17.308  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Text file from InputStream loaded...757 bytes
09-09 15:19:17.308  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Compiling shader program!
09-09 15:19:17.309  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Handles of 6: 1/3/-1
09-09 15:19:17.310  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading default shaders (Tex0)!
09-09 15:19:17.310  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ 0 shaders in replacement map!
09-09 15:19:17.310  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Default fragment shader is: /defaultFragmentShader.src
09-09 15:19:17.311  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading file from InputStream
09-09 15:19:17.312  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Text file from InputStream loaded...201 bytes
09-09 15:19:17.312  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Default vertex shader is: /defaultVertexShader.src
09-09 15:19:17.313  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading file from InputStream
09-09 15:19:17.313  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Text file from InputStream loaded...4020 bytes
09-09 15:19:17.313  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Compiling shader program!
09-09 15:19:17.315  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Handles of 9: 1/29/2
09-09 15:19:17.315  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading default shaders (Tex1)!
09-09 15:19:17.315  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ 0 shaders in replacement map!
09-09 15:19:17.315  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Default fragment shader is: /defaultFragmentShader.src
09-09 15:19:17.316  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading file from InputStream
09-09 15:19:17.317  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Text file from InputStream loaded...997 bytes
09-09 15:19:17.317  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Default vertex shader is: /defaultVertexShader.src
09-09 15:19:17.318  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading file from InputStream
09-09 15:19:17.318  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Text file from InputStream loaded...4390 bytes
09-09 15:19:17.318  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Compiling shader program!
09-09 15:19:17.320  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Handles of 12: 1/32/2
09-09 15:19:17.320  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading default shaders (Tex0Light0)!
09-09 15:19:17.320  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ 0 shaders in replacement map!
09-09 15:19:17.320  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Default fragment shader is: /defaultFragmentShader.src
09-09 15:19:17.321  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading file from InputStream
09-09 15:19:17.321  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Text file from InputStream loaded...201 bytes
09-09 15:19:17.322  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Default vertex shader is: /defaultVertexShader.src
09-09 15:19:17.322  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading file from InputStream
09-09 15:19:17.323  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Text file from InputStream loaded...1293 bytes
09-09 15:19:17.323  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Compiling shader program!
09-09 15:19:17.324  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Handles of 15: 1/7/2
09-09 15:19:17.324  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading default shaders (Fog)!
09-09 15:19:17.324  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ 0 shaders in replacement map!
09-09 15:19:17.324  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Default fragment shader is: /defaultFragmentShader.src
09-09 15:19:17.325  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading file from InputStream
09-09 15:19:17.325  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Text file from InputStream loaded...328 bytes
09-09 15:19:17.326  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Default vertex shader is: /defaultVertexShader.src
09-09 15:19:17.327  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading file from InputStream
09-09 15:19:17.328  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Text file from InputStream loaded...4267 bytes
09-09 15:19:17.328  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Compiling shader program!
09-09 15:19:17.331  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Handles of 18: 1/32/2
09-09 15:19:17.331  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading default shaders (FogLight0)!
09-09 15:19:17.331  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ 0 shaders in replacement map!
09-09 15:19:17.331  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Default fragment shader is: /defaultFragmentShader.src
09-09 15:19:17.332  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading file from InputStream
09-09 15:19:17.332  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Text file from InputStream loaded...328 bytes
09-09 15:19:17.332  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Default vertex shader is: /defaultVertexShader.src
09-09 15:19:17.333  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading file from InputStream
09-09 15:19:17.333  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Text file from InputStream loaded...1608 bytes
09-09 15:19:17.334  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Compiling shader program!
09-09 15:19:17.335  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Handles of 21: 1/10/2
09-09 15:19:17.335  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading default shaders (Depth)!
09-09 15:19:17.335  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ 0 shaders in replacement map!
09-09 15:19:17.335  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Default fragment shader is: /defaultFragmentShader.src
09-09 15:19:17.336  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading file from InputStream
09-09 15:19:17.336  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Text file from InputStream loaded...745 bytes
09-09 15:19:17.336  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Default vertex shader is: /defaultVertexShader.src
09-09 15:19:17.337  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading file from InputStream
09-09 15:19:17.337  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Text file from InputStream loaded...248 bytes
09-09 15:19:17.337  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Compiling shader program!
09-09 15:19:17.338  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Handles of 24: 0/0/-1
09-09 15:19:17.338  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ GL20 render pipeline initialized!
09-09 15:19:17.338  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ OpenGL vendor:     ARM
09-09 15:19:17.338  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ OpenGL renderer:   Mali-450 MP
09-09 15:19:17.338  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ OpenGL version:    OpenGL ES 2.0
09-09 15:19:17.339  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ OpenGL renderer initialized (using 2/0 texture stages)
09-09 15:19:17.341  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Adding Lightsource: 0
09-09 15:19:17.437  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading Texture...
09-09 15:19:17.438  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Texture loaded...16384 bytes/64*64 pixels!
09-09 15:19:17.588  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading Texture...
09-09 15:19:17.588  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Texture loaded...16384 bytes/64*64 pixels!
09-09 15:19:17.689  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading Texture...
09-09 15:19:17.689  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Texture loaded...16384 bytes/64*64 pixels!
09-09 15:19:17.819  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading Texture...
09-09 15:19:17.819  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Texture loaded...16384 bytes/64*64 pixels!
09-09 15:19:17.920  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading Texture...
09-09 15:19:17.920  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Texture loaded...16384 bytes/64*64 pixels!
09-09 15:19:18.114  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading Texture...
09-09 15:19:18.114  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Texture loaded...16384 bytes/64*64 pixels!
09-09 15:19:18.292  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading Texture...
09-09 15:19:18.292  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Texture loaded...16384 bytes/64*64 pixels!
09-09 15:19:18.437  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading Texture...
09-09 15:19:18.437  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Texture loaded...16384 bytes/64*64 pixels!
09-09 15:19:18.569  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading Texture...
09-09 15:19:18.570  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Texture loaded...16384 bytes/64*64 pixels!
09-09 15:19:18.698  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading Texture...
09-09 15:19:18.698  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Texture loaded...16384 bytes/64*64 pixels!
09-09 15:19:18.839  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading Texture...
09-09 15:19:18.839  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Texture loaded...16384 bytes/64*64 pixels!
09-09 15:19:18.961  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading Texture...
09-09 15:19:18.961  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Texture loaded...16384 bytes/64*64 pixels!
09-09 15:19:19.009  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading Texture...
09-09 15:19:19.009  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Texture loaded...16384 bytes/64*64 pixels!
09-09 15:19:19.010  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading file from InputStream
09-09 15:19:19.011  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Text file from InputStream loaded...1378 bytes
09-09 15:19:19.012  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Processing new material blueberry!
09-09 15:19:19.013  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Processing new material strawberry!
09-09 15:19:19.014  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Processing new material kiwi!
09-09 15:19:19.015  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Processing new material plate!
09-09 15:19:19.018  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Processing new material cream!
09-09 15:19:19.020  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Loading file from InputStream
09-09 15:19:19.348  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Text file from InputStream loaded...1094137 bytes
09-09 15:19:19.537  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Processing object from OBJ-file: blueberry_pivot
09-09 15:19:19.624  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Object 'blueberry_pivot_jPCT0' created using 330 polygons and 167 vertices.
09-09 15:19:19.624  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Processing object from OBJ-file: strawberry_pivot
09-09 15:19:19.695  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Object 'strawberry_pivot_jPCT1' created using 380 polygons and 192 vertices.
09-09 15:19:19.695  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Processing object from OBJ-file: kiwi_pivot
09-09 15:19:19.746  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Object 'kiwi_pivot_jPCT2' created using 308 polygons and 156 vertices.
09-09 15:19:19.746  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Processing object from OBJ-file: plate_pivot
09-09 15:19:19.772  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Object 'plate_pivot_jPCT3' created using 140 polygons and 72 vertices.
09-09 15:19:19.772  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Processing object from OBJ-file: cream_pivot
09-09 15:19:22.529  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Object 'cream_pivot_jPCT4' created using 11644 polygons and 5848 vertices.
09-09 15:19:22.551  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Normal vectors calculated in 20ms!
09-09 15:19:22.572  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Normal vectors calculated in 17ms!
09-09 15:19:22.595  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Normal vectors calculated in 20ms!
09-09 15:19:22.625  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Normal vectors calculated in 28ms!
09-09 15:19:23.083  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Normal vectors calculated in 429ms!
09-09 15:19:23.088  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Memory usage before compacting: 18661 KB used out of 22208 KB. Max. memory available to the VM is 131072 KB.
09-09 15:19:23.401  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Memory usage after compacting: 13838 KB used out of 22208 KB. Max. memory available to the VM is 131072 KB.
09-09 15:19:23.407  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Saving master Activity!
09-09 15:19:23.516  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Subobject of object 10/object12 compiled to indexed fixed point data using 990/193 vertices in 39ms!
09-09 15:19:23.529  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Subobject of object 10/object12 compiled to indexed fixed point data using 924/232 vertices in 13ms!
09-09 15:19:23.538  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Subobject of object 10/object12 compiled to indexed fixed point data using 1140/229 vertices in 9ms!
09-09 15:19:23.542  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Subobject of object 10/object12 compiled to indexed fixed point data using 420/80 vertices in 4ms!
09-09 15:19:23.719  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Subobject of object 10/object12 compiled to indexed fixed point data using 23997/4758 vertices in 176ms!
09-09 15:19:23.860  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Subobject of object 10/object12 compiled to indexed fixed point data using 10935/2132 vertices in 140ms!
09-09 15:19:23.860  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Object 10/object12 compiled to 6 subobjects in 453ms!
09-09 15:19:23.860  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Object 'object12' uses multiple texture sets!
09-09 15:19:23.865  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Creating buffers...
09-09 15:19:23.865  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ VBO created for object 'object12'
09-09 15:19:23.867  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Creating buffers...
09-09 15:19:23.867  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ VBO created for object 'object12'
09-09 15:19:23.869  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Creating buffers...
09-09 15:19:23.869  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ VBO created for object 'object12'
09-09 15:19:23.870  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Creating buffers...
09-09 15:19:23.871  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ VBO created for object 'object12'
09-09 15:19:23.872  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Creating buffers...
09-09 15:19:23.872  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ VBO created for object 'object12'
09-09 15:19:23.883  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ Creating buffers...
09-09 15:19:23.883  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ VBO created for object 'object12'
09-09 15:19:23.885  21613-22213/com.infolytx.mobilityapp I/jPCT-AE﹕ 0fps

EgonOlsen

Looks fine so far. Make sure that the object isn't transparent (setTransparency(-1);). If that doesn't help, please post the significant parts of your loading and setup code for the objects.

receme

#4
Still no luck :(

However I told before,  using this code the 3d model is loaded perfectly in my Samsung galaxy A5 device. But problem in Nexus 6 device. :(

I am posting the code here.....


I used a FrameLayout to load the GLSurfaceView.....


my onCreate function
...................................
setContentView(R.layout.activity_3dmodel);
mGLView = new GLSurfaceView(getApplication());
mGLView.setEGLContextClientVersion(2);

renderer = new MyRenderer(folderpath);  //param is model folder path in sdcard
mGLView.setRenderer(renderer);
modelContainer.addView(mGLView);   //modelContainer is a framelayout defined in the layout xml file

.................................................
Renderer class...

class MyRenderer implements GLSurfaceView.Renderer {

        private long time = System.currentTimeMillis();
        private String modelFolderPath;

        public MyRenderer(final String modelfolderpath) {
            this.modelFolderPath = modelfolderpath;
        }

        public void onSurfaceChanged(GL10 gl, int w, int h) {
            if (fb != null) {
                fb.dispose();
            }

            fb = new FrameBuffer(w, h); // OpenGL ES 2.0 constructor

            fb.clear(back);


            //if (master == null) {

            world = new World();
            world.setAmbientLight(50, 50, 50);

            sun = new Light(world);
            sun.setIntensity(252, 252, 252);


            final String textturesFolder = modelFolderPath;
            UtilMethods.logMessage("textures folder path", textturesFolder);
            File[] textureFiles = FileUtils.getAllFiles(textturesFolder);
            if (textureFiles != null) {
                for (int i = 0; i < textureFiles.length; i++) {

                    try {
                        FileInputStream fs = new FileInputStream(textureFiles[i]);
                        Bitmap bm = BitmapFactory.decodeStream(fs);
                        Texture texture = new Texture(BitmapHelper.rescale(bm, 64, 64));

                        //if(TextureManager.getInstance().getTexture(textureFiles[i].getName())==null){
                        //TextureManager.getInstance().addTexture(textureFiles[i].getName(), texture);
                        //}

                        try {
                            TextureManager.getInstance().addTexture(textureFiles[i].getName(), texture);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }


                    } catch (FileNotFoundException e) {
                        e.printStackTrace();

                    }
                }
            }

            cube = loadModel(scale);
            cube.setScale(scale);
            cube.setTransparency(-1);
            //cube.setSpecularLighting(true);
            cube.strip();
            cube.build();
            world.addObject(cube);



            Camera cam = world.getCamera();
            cam.moveCamera(Camera.CAMERA_MOVEOUT, 50);
            cam.lookAt(cube.getTransformedCenter());

            SimpleVector sv = new SimpleVector();
            sv.set(cube.getTransformedCenter());
            sv.y -= 100;
            sv.z -= 100;

            sun.setPosition(sv);
            MemoryHelper.compact();

            if (master == null) {
                Logger.log("Saving master Activity!");
                master = Promotion3dModel.this;
            }
            //}
        }

        private Object3D loadModel(float scale) {

            String pathOfObjFile = modelFolderPath + "/" + FileUtils.OBJFILE_NAME;
            String pathOfMtlFile = modelFolderPath + "/" + FileUtils.MTLFILE_NAME;

            InputStream objIns = null;
            InputStream mtlIns = null;
            try {
                objIns = new FileInputStream(pathOfObjFile);
                mtlIns = new FileInputStream(pathOfMtlFile);
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }

            Object3D[] model = Loader.loadOBJ(objIns, mtlIns, scale);
            Object3D o3d = new Object3D(0);
            Object3D temp = null;

            for (int i = 0; i < model.length; i++) {
                temp = model[i];
                temp.setCenter(SimpleVector.ORIGIN);
                temp.rotateX((float) (-.5 * Math.PI));
                temp.rotateMesh();
                temp.setRotationMatrix(new Matrix());
                o3d = Object3D.mergeObjects(o3d, temp);
                o3d.build();
            }


            return o3d;
        }

        public void onSurfaceCreated(GL10 gl, EGLConfig config) {

        }

        public void onDrawFrame(GL10 gl) {

            if (touchTurn != 0) {
                cube.rotateY(touchTurn);
                touchTurn = 0;
            }

            if (touchTurnUp != 0) {
                cube.rotateX(touchTurnUp);
                touchTurnUp = 0;
            }

            fb.clear(back);


            world.renderScene(fb);
            world.draw(fb);
            fb.display();

            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    modelContainer.setVisibility(View.VISIBLE);
                    UtilMethods.dismissProgressDialog();
                }
            });


            if (System.currentTimeMillis() - time >= 1000) {
                Logger.log(fps + "fps");
                fps = 0;
                time = System.currentTimeMillis();
            }
            fps++;
        }
}

EgonOlsen

Can you post another screen shot from a device without the issue for comparison?

receme

Here is the screenshot from Samsung galaxy A5.

EgonOlsen

Strange. Have you tried to run it in a plain Activity without the additional GUI stuff? Looks like something overlays the rendered image...

receme

You are right. it was a silly problem.  :'(   
It changed the activity theme now it is working fine. But really confused about why samsung did not show the shade.

Any way, thank you very much for your help. Really impressed. It was a very quick reply.

However, I am trying to use this library in this project and totally new in handling 3d objects. Before I was trying to load a larger .obj file (>10 mb) and loading time was very long (not suitable for production) . But I saw game examples in the website. So it is proven this library can do awesome work. But is it possible in android?

how can I load larger .obj file faster?

EgonOlsen

Quote from: receme on September 09, 2015, 05:02:57 PM
However, I am trying to use this library in this project and totally new in handling 3d objects. Before I was trying to load a larger .obj file (>10 mb) and loading time was very long (not suitable for production) . But I saw game examples in the website. So it is proven this library can do awesome work. But is it possible in android?

how can I load larger .obj file faster?
OBJ files are ASCII files. Reading them requires a lot of parsing, converting and finally creating the triangles, which is why it's rather slow. The fastest way to load files with jPCT-AE is to use serialized objects. The basic idea is to use desktop jPCT to load the objects once and save them into an optimized format that can be loaded by jPCT-AE very fast. More info can be found here: http://www.jpct.net/wiki/index.php?title=Differences_between_jPCT_and_jPCT-AE#Performance_and_memory_issues.2C_serialized_objects

receme

Thank for your suggestion. Of course I will try this.  :)

receme

Hello, I was able to serialize my obj file using jBrush. I have loaded .ser file and yes it is really fast.

But I have some problems. Actually I was able to load a serialized 3d model which have only one texture file...


TextureManager tm = TextureManager.getInstance();

Texture texture = new Texture(BitmapHelper.rescale(BitmapHelper.convert(getResources().getDrawable(R.drawable.blueberry_bump)), 64, 64));
tm.addTexture("tex.png", texture);

......

model.setTexture("tex.png");



But I cannot load 3d model which has multiple textures images. Can you please tell me how can I do this?


EgonOlsen

Assigning textures to objects with multiple textures usually happens at load time. It doesn't matter if you load a 3ds, obj or serialized object, the approach is always the same. It's described here: http://www.jpct.net/wiki/index.php?title=Loading_models