Author Topic: Help! - all I get is a black triangle  (Read 9960 times)

Offline adrian_roney

  • byte
  • *
  • Posts: 11
    • View Profile
Help! - all I get is a black triangle
« on: October 16, 2011, 02:31:50 pm »
Hi I wonder if you can help

I am trying to render a 3ds model on android  (attached in zip including texture graphics - well I would have but its too large, how can I get it to someone? ) its supposed to be a 3d model of the ship "the freedom of the seas" that I picked up on 3d wharehouse.

When it renders all I get is a black triangle.

I am really new to this stuff, and so don't understand why.  I picked up your demo code and have modified it slightly to load the textures in the model.  It seems to be loading everything correctly?

I have also attached my Demo.java file.

I am sure I have missed something really simple!

please help.

Thanks

Adrian

[attachment deleted by admin]

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Help! - all I get is a black triangle
« Reply #1 on: October 16, 2011, 05:56:32 pm »
The complete log output as well as a screenshot might help.

Offline adrian_roney

  • byte
  • *
  • Posts: 11
    • View Profile
Re: Help! - all I get is a black triangle
« Reply #2 on: October 16, 2011, 06:12:09 pm »
Hi,

Thanks for even replying.

here is the log output and screenshot.

Code: [Select]
D/AndroidRuntime(15029): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
D/AndroidRuntime(15029): CheckJNI is OFF
D/dalvikvm(15029): creating instr width table
D/AndroidRuntime(15029): Calling main entry com.android.commands.am.Am
I/ActivityManager(11232): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.threed.jpct.shader/.De
mo } from pid 15029
D/AndroidRuntime(15029): Shutting down VM
I/ActivityManager(11232): Start proc com.threed.jpct.shader for activity com.threed.jpct.shader/.Demo: pid=15037 uid=10164 gids={}
D/dalvikvm(15029): GC_CONCURRENT freed 102K, 69% free 320K/1024K, external 0K/0K, paused 0ms+0ms
D/dalvikvm(15029): Debugger has detached; object registry had 1 entries
I/AndroidRuntime(15029): NOTE: attach of thread 'Binder Thread #2' failed
I/jPCT-AE (15037): onCreate
I/jPCT-AE (15037): onResume
D/libEGL  (15037): loaded /system/lib/egl/libGLES_android.so
I/ActivityManager(11232): Displayed com.threed.jpct.shader/.Demo: +137ms
D/libEGL  (15037): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so
D/libEGL  (15037): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so
D/libEGL  (15037): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so
I/jPCT-AE (15037): onSurfaceCreated
I/jPCT-AE (15037): OpenGL vendor:     Imagination Technologies
I/jPCT-AE (15037): OpenGL renderer:   PowerVR SGX 540
I/jPCT-AE (15037): OpenGL version:    OpenGL ES-CM 1.1
I/jPCT-AE (15037): OpenGL renderer initialized (using 2 texture stages)
I/jPCT-AE (15037): Loading Texture...
I/jPCT-AE (15037): Loading Texture...
I/jPCT-AE (15037): Loading Texture...
D/dalvikvm(15037): GC_FOR_MALLOC freed 63K, 40% free 4097K/6727K, external 1753K/2137K, paused 21ms
I/jPCT-AE (15037): Loading Texture...
I/jPCT-AE (15037): Loading Texture...
D/dalvikvm(15037): GC_EXPLICIT freed 9K, 38% free 4408K/7047K, external 1625K/2137K, paused 30ms
D/dalvikvm(15037): GC_EXPLICIT freed 1K, 38% free 4407K/7047K, external 1625K/2137K, paused 32ms
I/jPCT-AE (15037): Loading Texture...
I/jPCT-AE (15037): Loading Texture...
I/jPCT-AE (15037): Loading Texture...
I/jPCT-AE (15037): Loading Texture...
I/jPCT-AE (15037): Loading Texture...
D/dalvikvm(15037): GC_EXPLICIT freed <1K, 36% free 4730K/7303K, external 1625K/2137K, paused 35ms
D/dalvikvm(15037): GC_EXPLICIT freed <1K, 36% free 4729K/7303K, external 1625K/2137K, paused 28ms
I/jPCT-AE (15037): Loading Texture...
I/jPCT-AE (15037): Loading Texture...
I/jPCT-AE (15037): Loading Texture...
I/jPCT-AE (15037): Loading Texture...
I/jPCT-AE (15037): Loading Texture...
D/dalvikvm(15037): GC_EXPLICIT freed <1K, 34% free 5051K/7559K, external 1625K/2137K, paused 29ms
D/dalvikvm(15037): GC_EXPLICIT freed <1K, 34% free 5051K/7559K, external 1625K/2137K, paused 24ms
I/jPCT-AE (15037): Loading Texture...
I/jPCT-AE (15037): Loading Texture...
I/jPCT-AE (15037): Loading Texture...
I/jPCT-AE (15037): Loading Texture...
I/jPCT-AE (15037): Loading Texture...
D/dalvikvm(15037): GC_EXPLICIT freed <1K, 31% free 5757K/8327K, external 1625K/2137K, paused 26ms
D/dalvikvm(15037): GC_EXPLICIT freed <1K, 31% free 5757K/8327K, external 1625K/2137K, paused 23ms
I/jPCT-AE (15037): Loading Texture...
D/szipinf (15037): Initializing inflate state
I/jPCT-AE (15037): Loading file from InputStream
D/szipinf (15037): Initializing zlib to inflate
I/jPCT-AE (15037): Expanding buffers...16384 bytes
I/jPCT-AE (15037): Expanding buffers...24576 bytes
I/jPCT-AE (15037): Expanding buffers...32768 bytes
I/jPCT-AE (15037): Expanding buffers...40960 bytes
I/jPCT-AE (15037): Expanding buffers...49152 bytes
I/jPCT-AE (15037): Expanding buffers...57344 bytes
I/jPCT-AE (15037): Expanding buffers...65536 bytes
I/jPCT-AE (15037): Expanding buffers...73728 bytes
I/jPCT-AE (15037): Expanding buffers...81920 bytes
I/jPCT-AE (15037): Expanding buffers...163840 bytes
I/jPCT-AE (15037): Expanding buffers...245760 bytes
I/jPCT-AE (15037): Expanding buffers...327680 bytes
D/dalvikvm(15037): GC_FOR_MALLOC freed 847K, 37% free 6142K/9671K, external 1625K/2137K, paused 19ms
I/jPCT-AE (15037): Expanding buffers...409600 bytes
I/jPCT-AE (15037): Expanding buffers...491520 bytes
D/dalvikvm(15037): GC_FOR_MALLOC freed 720K, 39% free 6302K/10183K, external 1625K/2137K, paused 21ms
I/jPCT-AE (15037): Expanding buffers...573440 bytes
D/dalvikvm(15037): GC_FOR_MALLOC freed 480K, 38% free 6382K/10183K, external 1625K/2137K, paused 16ms
I/jPCT-AE (15037): Expanding buffers...655360 bytes
D/dalvikvm(15037): GC_FOR_MALLOC freed 560K, 37% free 6462K/10183K, external 1625K/2137K, paused 16ms
I/dalvikvm-heap(15037): Grow heap (frag case) to 10.976MB for 737296-byte allocation
D/dalvikvm(15037): GC_FOR_MALLOC freed 640K, 41% free 6542K/10951K, external 1625K/2137K, paused 15ms
I/jPCT-AE (15037): Expanding buffers...737280 bytes
I/jPCT-AE (15037): Expanding buffers...819200 bytes
I/jPCT-AE (15037): File from InputStream loaded...807662 bytes
D/dalvikvm(15037): GC_FOR_MALLOC freed 720K, 40% free 6623K/10951K, external 1625K/2137K, paused 32ms
I/jPCT-AE (15037): Processing new material FrontCol!
I/jPCT-AE (15037): Processing new material Roofing_!
I/jPCT-AE (15037): Processing new material Roofin01!
I/jPCT-AE (15037): Processing new material Roofin02!
I/jPCT-AE (15037): Processing new material Roofin03!
I/jPCT-AE (15037): Processing new material Roofin04!
I/jPCT-AE (15037): Processing new material Roofin05!
I/jPCT-AE (15037): Processing new material Roofin06!
I/jPCT-AE (15037): Processing new material Roofin07!
I/jPCT-AE (15037): Processing new material Roofin08!
I/jPCT-AE (15037): Processing new material Roofin09!
I/jPCT-AE (15037): Processing new material Roofin10!
I/jPCT-AE (15037): Processing new material Roofin11!
I/jPCT-AE (15037): Processing new material Roofin12!
I/jPCT-AE (15037): Processing new material Color_I1!
I/jPCT-AE (15037): Processing new material Color_H1!
I/jPCT-AE (15037): Processing new material Color_00!
I/jPCT-AE (15037): [ 1318781335192 ] - WARNING: Error reading material's diffuse color...try Config.oldStyle3DSLoader=true!
I/jPCT-AE (15037): Processing new material Color_D0!
I/jPCT-AE (15037): Processing new material Color_01!
I/jPCT-AE (15037): [ 1318781335196 ] - WARNING: Error reading material's diffuse color...try Config.oldStyle3DSLoader=true!
I/jPCT-AE (15037): Processing new material Metal_Al!
I/jPCT-AE (15037): [ 1318781335197 ] - WARNING: Error reading material's diffuse color...try Config.oldStyle3DSLoader=true!
I/jPCT-AE (15037): Processing new material Water_Sp!
I/jPCT-AE (15037): [ 1318781335198 ] - WARNING: Error reading material's diffuse color...try Config.oldStyle3DSLoader=true!
I/jPCT-AE (15037): Processing new material Color_H0!
I/jPCT-AE (15037): Processing new material Color_I0!
I/jPCT-AE (15037): [ 1318781335199 ] - WARNING: Error reading material's diffuse color...try Config.oldStyle3DSLoader=true!
I/jPCT-AE (15037): Processing new material Color_E0!
I/jPCT-AE (15037): Processing new material Color_A0!
I/jPCT-AE (15037): Processing new material Color_02!
I/jPCT-AE (15037): Processing new material Color_A1!
I/jPCT-AE (15037): Processing new material Color_03!
I/jPCT-AE (15037): Processing new material Vegetati!
I/jPCT-AE (15037): [ 1318781335201 ] - WARNING: Error reading material's diffuse color...try Config.oldStyle3DSLoader=true!
I/jPCT-AE (15037): Processing new material Color_04!
I/jPCT-AE (15037): Processing new material Color_05!
I/jPCT-AE (15037): Processing new material RoyalCar!
I/jPCT-AE (15037): [ 1318781335202 ] - WARNING: Error reading material's diffuse color...try Config.oldStyle3DSLoader=true!
I/jPCT-AE (15037): Processing new material Color_06!
I/jPCT-AE (15037): Processing new material Color_G0!
I/jPCT-AE (15037): Processing new material Foregrou!
I/jPCT-AE (15037): Processing new material Brick_Pa!
I/jPCT-AE (15037): Processing object from 3DS-file: Mesh01
D/dalvikvm(15037): GC_CONCURRENT freed 819K, 31% free 7654K/10951K, external 1625K/2137K, paused 2ms+4ms
D/dalvikvm(15037): GC_FOR_MALLOC freed 4K, 22% free 9459K/11975K, external 1625K/2137K, paused 28ms
D/dalvikvm(15037): GC_FOR_MALLOC freed <1K, 20% free 11134K/13767K, external 1625K/2137K, paused 29ms
D/dalvikvm(13321): GC_CONCURRENT freed 287K, 48% free 3197K/6087K, external 1625K/2137K, paused 1ms+104ms
I/jPCT-AE (15037): Object 'Mesh01_jPCT0' created using 20400 polygons and 9929 vertices.
I/jPCT-AE (15037): Processing object from 3DS-file: Mesh02
I/jPCT-AE (15037): Object 'Mesh02_jPCT1' created using 2 polygons and 4 vertices.
I/jPCT-AE (15037): Processing object from 3DS-file: Mesh03
I/jPCT-AE (15037): Object 'Mesh03_jPCT2' created using 2 polygons and 4 vertices.
I/jPCT-AE (15037): Processing object from 3DS-file: Mesh04
I/jPCT-AE (15037): Object 'Mesh04_jPCT3' created using 56 polygons and 112 vertices.
I/jPCT-AE (15037): Processing object from 3DS-file: Mesh05
I/jPCT-AE (15037): Object 'Mesh05_jPCT4' created using 2 polygons and 4 vertices.
I/jPCT-AE (15037): Processing object from 3DS-file: Mesh06
I/jPCT-AE (15037): Object 'Mesh06_jPCT5' created using 2 polygons and 4 vertices.
I/jPCT-AE (15037): Processing object from 3DS-file: Mesh07
I/jPCT-AE (15037): Object 'Mesh07_jPCT6' created using 2 polygons and 4 vertices.
I/jPCT-AE (15037): Processing object from 3DS-file: Mesh08
I/jPCT-AE (15037): Object 'Mesh08_jPCT7' created using 10 polygons and 20 vertices.
I/jPCT-AE (15037): Processing object from 3DS-file: Mesh09
I/jPCT-AE (15037): Object 'Mesh09_jPCT8' created using 4 polygons and 8 vertices.
I/jPCT-AE (15037): Processing object from 3DS-file: Mesh10
I/jPCT-AE (15037): Object 'Mesh10_jPCT9' created using 2 polygons and 4 vertices.
I/jPCT-AE (15037): Processing object from 3DS-file: Mesh11
I/jPCT-AE (15037): Object 'Mesh11_jPCT10' created using 2 polygons and 4 vertices.
I/jPCT-AE (15037): Processing object from 3DS-file: Group1
I/jPCT-AE (15037): Processing object from 3DS-file: Mesh12
I/jPCT-AE (15037): Object 'Mesh12_jPCT11' created using 18 polygons and 12 vertices.
I/jPCT-AE (15037): Processing object from 3DS-file: Mesh13
I/jPCT-AE (15037): Object 'Mesh13_jPCT12' created using 2 polygons and 4 vertices.
I/jPCT-AE (15037): Processing object from 3DS-file: Model
I/jPCT-AE (15037): Name in hierarchy found: Model
I/jPCT-AE (15037): Name in hierarchy found: Group1
I/jPCT-AE (15037): Name in hierarchy found: Mesh01
I/jPCT-AE (15037): Name in hierarchy found: Mesh02
I/jPCT-AE (15037): Name in hierarchy found: Mesh03
I/jPCT-AE (15037): Name in hierarchy found: Mesh04
I/jPCT-AE (15037): Name in hierarchy found: Mesh05
I/jPCT-AE (15037): Name in hierarchy found: Mesh06
I/jPCT-AE (15037): Name in hierarchy found: Mesh07
I/jPCT-AE (15037): Name in hierarchy found: Mesh08
I/jPCT-AE (15037): Name in hierarchy found: Mesh09
I/jPCT-AE (15037): Name in hierarchy found: Mesh10
I/jPCT-AE (15037): Name in hierarchy found: Mesh11
I/jPCT-AE (15037): Name in hierarchy found: Mesh12
I/jPCT-AE (15037): Name in hierarchy found: Mesh13
D/dalvikvm(15037): GC_FOR_MALLOC freed 4378K, 45% free 8600K/15431K, external 1625K/2137K, paused 33ms
D/dalvikvm(15037): GC_CONCURRENT freed <1K, 32% free 10603K/15431K, external 1625K/2137K, paused 2ms+2ms
D/dalvikvm(15037): GC_CONCURRENT freed 2892K, 37% free 9758K/15431K, external 1625K/2137K, paused 2ms+4ms
D/dalvikvm(15037): GC_CONCURRENT freed 1044K, 31% free 10762K/15431K, external 1625K/2137K, paused 1ms+5ms
D/dalvikvm(15037): GC_FOR_MALLOC freed 799K, 27% free 11410K/15431K, external 1625K/2137K, paused 52ms
I/jPCT-AE (15037): Normal vectors calculated in 874ms!
I/jPCT-AE (15037): Adding Lightsource: 0
I/jPCT-AE (15037): Memory usage before compacting: 12545 KB used out of 15559 KB
D/dalvikvm(15037): GC_EXPLICIT freed 3748K, 44% free 8797K/15559K, external 1625K/2137K, paused 53ms
D/dalvikvm(15037): GC_EXPLICIT freed <1K, 44% free 8797K/15559K, external 1625K/2137K, paused 27ms
I/jPCT-AE (15037): Memory usage after compacting: 8797 KB used out of 15559 KB
I/jPCT-AE (15037): Saving master Activity!
D/dalvikvm(15037): GC_CONCURRENT freed 1937K, 43% free 8908K/15559K, external 1625K/2137K, paused 2ms+3ms
D/dalvikvm(15037): GC_EXTERNAL_ALLOC freed 1501K, 43% free 8926K/15559K, external 2127K/2137K, paused 34ms
I/jPCT-AE (15037): Subobject of object 13/ship compiled to indexed fixed point data using 14259 vertices in 268ms!
I/jPCT-AE (15037): Subobject of object 13/ship compiled to indexed fixed point data using 6 vertices in 1ms!
I/jPCT-AE (15037): Subobject of object 13/ship compiled to indexed fixed point data using 6 vertices in 1ms!
I/jPCT-AE (15037): Subobject of object 13/ship compiled to indexed fixed point data using 6 vertices in 1ms!
I/jPCT-AE (15037): Subobject of object 13/ship compiled to indexed fixed point data using 6 vertices in 1ms!
I/jPCT-AE (15037): Subobject of object 13/ship compiled to indexed fixed point data using 6 vertices in 2ms!
I/jPCT-AE (15037): Subobject of object 13/ship compiled to indexed fixed point data using 6 vertices in 1ms!
I/jPCT-AE (15037): Subobject of object 13/ship compiled to indexed fixed point data using 6 vertices in 0ms!
I/jPCT-AE (15037): Subobject of object 13/ship compiled to indexed fixed point data using 6 vertices in 2ms!
I/jPCT-AE (15037): Subobject of object 13/ship compiled to indexed fixed point data using 6 vertices in 1ms!
I/jPCT-AE (15037): Subobject of object 13/ship compiled to indexed fixed point data using 6 vertices in 1ms!
I/jPCT-AE (15037): Subobject of object 13/ship compiled to indexed fixed point data using 6 vertices in 3ms!
I/jPCT-AE (15037): Subobject of object 13/ship compiled to indexed fixed point data using 6 vertices in 1ms!
I/jPCT-AE (15037): Subobject of object 13/ship compiled to indexed fixed point data using 24 vertices in 1ms!
I/jPCT-AE (15037): Subobject of object 13/ship compiled to indexed fixed point data using 1926 vertices in 26ms!
I/jPCT-AE (15037): Subobject of object 13/ship compiled to indexed fixed point data using 318 vertices in 6ms!
I/jPCT-AE (15037): Subobject of object 13/ship compiled to indexed fixed point data using 330 vertices in 6ms!
I/jPCT-AE (15037): Subobject of object 13/ship compiled to indexed fixed point data using 99 vertices in 3ms!
D/dalvikvm(15037): GC_EXTERNAL_ALLOC freed 438K, 43% free 8949K/15559K, external 2720K/2739K, paused 29ms
I/jPCT-AE (15037): Subobject of object 13/ship compiled to indexed fixed point data using 23997 vertices in 378ms!
D/dalvikvm(15037): GC_CONCURRENT freed 1874K, 43% free 8982K/15559K, external 3058K/3084K, paused 2ms+2ms
D/dalvikvm(15037): GC_EXTERNAL_ALLOC freed 77K, 43% free 8904K/15559K, external 3058K/3084K, paused 28ms
I/jPCT-AE (15037): Subobject of object 13/ship compiled to indexed fixed point data using 16476 vertices in 277ms!
D/dalvikvm(15037): GC_EXTERNAL_ALLOC freed 1406K, 44% free 8865K/15559K, external 3101K/3123K, paused 37ms
I/jPCT-AE (15037): Subobject of object 13/ship compiled to indexed fixed point data using 4011 vertices in 89ms!
I/jPCT-AE (15037): Object 13/ship compiled to 21 subobjects in 1417ms!
I/jPCT-AE (15037): Object 'ship' uses multiple texture sets!
I/jPCT-AE (15037): VBO created for object 'ship'
I/jPCT-AE (15037): VBO created for object 'ship'
I/jPCT-AE (15037): VBO created for object 'ship'
I/jPCT-AE (15037): VBO created for object 'ship'
I/jPCT-AE (15037): VBO created for object 'ship'
I/jPCT-AE (15037): VBO created for object 'ship'
I/jPCT-AE (15037): VBO created for object 'ship'
I/jPCT-AE (15037): VBO created for object 'ship'
I/jPCT-AE (15037): VBO created for object 'ship'
I/jPCT-AE (15037): VBO created for object 'ship'
I/jPCT-AE (15037): VBO created for object 'ship'
I/jPCT-AE (15037): VBO created for object 'ship'
I/jPCT-AE (15037): VBO created for object 'ship'
D/dalvikvm(15037): GC_EXTERNAL_ALLOC freed 1953K, 51% free 7660K/15559K, external 3197K/3288K, paused 32ms
I/jPCT-AE (15037): VBO created for object 'ship'
I/jPCT-AE (15037): VBO created for object 'ship'
I/jPCT-AE (15037): VBO created for object 'ship'
I/jPCT-AE (15037): VBO created for object 'ship'
I/jPCT-AE (15037): VBO created for object 'ship'
I/jPCT-AE (15037): VBO created for object 'ship'
I/jPCT-AE (15037): VBO created for object 'ship'
I/jPCT-AE (15037): VBO created for object 'ship'
D/dalvikvm(14494): GC_EXPLICIT freed 370K, 42% free 4252K/7303K, external 2834K/3533K, paused 496ms
I/dalvikvm(15037): Total arena pages for JIT: 11
I/dalvikvm(15037): Total arena pages for JIT: 12
D/dalvikvm(14380): GC_EXPLICIT freed 8K, 50% free 2715K/5379K, external 1625K/2137K, paused 40ms

Scrrenshot is attached.


[attachment deleted by admin]
« Last Edit: October 16, 2011, 10:25:27 pm by EgonOlsen »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Help! - all I get is a black triangle
« Reply #3 on: October 16, 2011, 08:33:16 pm »
You are using something based on the shader example but initialized with the OpenGL ES 1.1 renderer...this puzzles me a little bit. Can you please post the line where you create the FrameBuffer...? Maybe you are mixing modes here...

Offline adrian_roney

  • byte
  • *
  • Posts: 11
    • View Profile
Re: Help! - all I get is a black triangle
« Reply #4 on: October 16, 2011, 09:37:46 pm »
Hi,

do you mean this?

Code: [Select]
mGLView.setEGLConfigChooser(new GLSurfaceView.EGLConfigChooser() {
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
// Ensure that we get a 16bit framebuffer. Otherwise, we'll fall
// back to Pixelflinger on some device (read: Samsung I7500)
int[] attributes = new int[] { EGL10.EGL_DEPTH_SIZE, 16,
EGL10.EGL_NONE };
EGLConfig[] configs = new EGLConfig[1];
int[] result = new int[1];
egl.eglChooseConfig(display, attributes, configs, 1, result);
return configs[0];
}
});
I guess I need to make it use OpenGL ES 2.0? some how?

Sorry for such a newbie question..

I am trying to run it on a Samsung Nexus S if that helps in the debug?

Adrian.
« Last Edit: October 16, 2011, 10:25:57 pm by EgonOlsen »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Help! - all I get is a black triangle
« Reply #5 on: October 16, 2011, 09:53:20 pm »
No, not that part. The part where you call "new FrameBuffer(...)". I'm a bit confused that the app is labeled HelloShader and is located in the shader package but seems to use the 1.1 initialization code (the one that you've posted). I just want to make sure that you are using the correct constructor for this setting.

Offline adrian_roney

  • byte
  • *
  • Posts: 11
    • View Profile
Re: Help! - all I get is a black triangle
« Reply #6 on: October 16, 2011, 09:55:26 pm »
public void onSurfaceChanged(GL10 gl, int w, int h) {
         if (fb != null) {
            fb.dispose();
         }

         fb = new FrameBuffer(gl, w, h);

Thanks for your patience..


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Help! - all I get is a black triangle
« Reply #7 on: October 16, 2011, 10:02:04 pm »
Ok, this looks fine. The log looks fine too. Can you post the complete source code (remember to wrap it in code-tags or otherwise, it'll look very strange)?

Offline adrian_roney

  • byte
  • *
  • Posts: 11
    • View Profile
Re: Help! - all I get is a black triangle
« Reply #8 on: October 16, 2011, 10:04:18 pm »
hi I added it as an attachment to the original post

are you able to grab it?


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Help! - all I get is a black triangle
« Reply #9 on: October 16, 2011, 10:07:35 pm »
Yes, i somehow missed that. I'll have a look...

Offline adrian_roney

  • byte
  • *
  • Posts: 11
    • View Profile
Re: Help! - all I get is a black triangle
« Reply #10 on: October 16, 2011, 10:09:33 pm »
you are awesome by the way.

Thanks for this!!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Help! - all I get is a black triangle
« Reply #11 on: October 16, 2011, 10:12:51 pm »
I can't find anything wrong at first glance...have you tried to lower the 5.5f scaling value in the loader call to something much smaller (like 0.1f) to make sure that what we see here isn't just an enourmous part of the ship because it's scaled to high? If that doesn't help, feel free to send me the file via email.

Offline adrian_roney

  • byte
  • *
  • Posts: 11
    • View Profile
Re: Help! - all I get is a black triangle
« Reply #12 on: October 16, 2011, 10:19:35 pm »
yeah I tried that..

it just draws a tiny black square..


Offline adrian_roney

  • byte
  • *
  • Posts: 11
    • View Profile
Re: Help! - all I get is a black triangle
« Reply #13 on: October 16, 2011, 10:23:11 pm »
I have however just tried instantiating the Frame buffer with the width and height..

interestingly it now seems to be loading OpenGL es 2.0.

but I get a crash...

Code: [Select]
I/ActivityManager(11232): Start proc com.threed.jpct.shader for activity com.threed.jpct.shader/.Demo: pid=16447 uid=10164 gids={}
D/dalvikvm(16447): Debugger has detached; object registry had 1 entries
I/jPCT-AE (16447): onCreate
I/jPCT-AE (16447): onResume
D/libEGL  (16447): loaded /system/lib/egl/libGLES_android.so
D/libEGL  (16447): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so
D/libEGL  (16447): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so
I/ActivityManager(11232): Displayed com.threed.jpct.shader/.Demo: +168ms
D/libEGL  (16447): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so
V/RenderScript_jni(11310): surfaceDestroyed
I/jPCT-AE (16447): onSurfaceCreated
I/jPCT-AE (16447): Initializing GL20 render pipeline...
I/jPCT-AE (16447): Loading default shaders !
I/jPCT-AE (16447): Default fragment shader is: /defaultFragmentShader.src
I/jPCT-AE (16447): Loading file from InputStream
I/jPCT-AE (16447): Text file from InputStream loaded...2008 bytes
I/jPCT-AE (16447): Default vertex shader is: /defaultVertexShader.src
I/jPCT-AE (16447): Loading file from InputStream
I/jPCT-AE (16447): Text file from InputStream loaded...3897 bytes
I/jPCT-AE (16447): Compiling shader program!
E/libEGL  (16447): called unimplemented OpenGL ES API
E/libEGL  (16447): called unimplemented OpenGL ES API
E/libEGL  (16447): called unimplemented OpenGL ES API
E/libEGL  (16447): called unimplemented OpenGL ES API
E/libEGL  (16447): called unimplemented OpenGL ES API
I/jPCT-AE (16447): Could not compile shader 35633:
E/libEGL  (16447): called unimplemented OpenGL ES API
I/jPCT-AE (16447): [ 1318796545590 ] - ERROR: Failed to load and compile vertex shaders!
I/jPCT-AE (16447): [ 1318796545590 ] - WARNING: Unable to load shader!
I/jPCT-AE (16447): [ 1318796545592 ] - ERROR: java.lang.RuntimeException: [ 1318796545590 ] - ERROR: Failed to load and compile vertex shaders!
I/jPCT-AE (16447):      at com.threed.jpct.Logger.log(Logger.java:189)
I/jPCT-AE (16447):      at com.threed.jpct.GLSLShader.loadProgram(GLSLShader.java:586)
I/jPCT-AE (16447):      at com.threed.jpct.GLSLShader.<init>(GLSLShader.java:230)
I/jPCT-AE (16447):      at com.threed.jpct.GL20.<init>(GL20.java:118)
I/jPCT-AE (16447):      at java.lang.Class.newInstanceImpl(Native Method)
I/jPCT-AE (16447):      at java.lang.Class.newInstance(Class.java:1409)
I/jPCT-AE (16447):      at com.threed.jpct.GLRenderer.init(GLRenderer.java:469)
I/jPCT-AE (16447):      at com.threed.jpct.GLRenderer.init(GLRenderer.java:458)
I/jPCT-AE (16447):      at com.threed.jpct.FrameBuffer.<init>(FrameBuffer.java:92)
I/jPCT-AE (16447):      at com.threed.jpct.FrameBuffer.<init>(FrameBuffer.java:117)
I/jPCT-AE (16447):      at com.threed.jpct.shader.Demo$MyRenderer.onSurfaceChanged(Demo.java:250)
I/jPCT-AE (16447):      at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1356)
I/jPCT-AE (16447):      at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
I/jPCT-AE (16447): [ 1318796545595 ] - ERROR: java.lang.RuntimeException: [ 1318796545592 ] - ERROR: java.lang.RuntimeException: [ 1318796545590 ] - ERROR: Fail
ed to load and compile vertex shaders!
I/jPCT-AE (16447):      at com.threed.jpct.Logger.log(Logger.java:189)
I/jPCT-AE (16447):      at com.threed.jpct.GLSLShader.loadProgram(GLSLShader.java:586)
I/jPCT-AE (16447):      at com.threed.jpct.GLSLShader.<init>(GLSLShader.java:230)
I/jPCT-AE (16447):      at com.threed.jpct.GL20.<init>(GL20.java:118)
I/jPCT-AE (16447):      at java.lang.Class.newInstanceImpl(Native Method)
I/jPCT-AE (16447):      at java.lang.Class.newInstance(Class.java:1409)
I/jPCT-AE (16447):      at com.threed.jpct.GLRenderer.init(GLRenderer.java:469)
I/jPCT-AE (16447):      at com.threed.jpct.GLRenderer.init(GLRenderer.java:458)
I/jPCT-AE (16447):      at com.threed.jpct.FrameBuffer.<init>(FrameBuffer.java:92)
I/jPCT-AE (16447):      at com.threed.jpct.FrameBuffer.<init>(FrameBuffer.java:117)
I/jPCT-AE (16447):      at com.threed.jpct.shader.Demo$MyRenderer.onSurfaceChanged(Demo.java:250)
I/jPCT-AE (16447):      at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1356)
I/jPCT-AE (16447):      at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
I/jPCT-AE (16447):
I/jPCT-AE (16447):      at com.threed.jpct.Logger.log(Logger.java:189)
I/jPCT-AE (16447):      at com.threed.jpct.Logger.log(Logger.java:148)
I/jPCT-AE (16447):      at com.threed.jpct.GLSLShader.<init>(GLSLShader.java:234)
I/jPCT-AE (16447):      at com.threed.jpct.GL20.<init>(GL20.java:118)
I/jPCT-AE (16447):      at java.lang.Class.newInstanceImpl(Native Method)
I/jPCT-AE (16447):      at java.lang.Class.newInstance(Class.java:1409)
I/jPCT-AE (16447):      at com.threed.jpct.GLRenderer.init(GLRenderer.java:469)
I/jPCT-AE (16447):      at com.threed.jpct.GLRenderer.init(GLRenderer.java:458)
I/jPCT-AE (16447):      at com.threed.jpct.FrameBuffer.<init>(FrameBuffer.java:92)
I/jPCT-AE (16447):      at com.threed.jpct.FrameBuffer.<init>(FrameBuffer.java:117)
I/jPCT-AE (16447):      at com.threed.jpct.shader.Demo$MyRenderer.onSurfaceChanged(Demo.java:250)
I/jPCT-AE (16447):      at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1356)
I/jPCT-AE (16447):      at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
I/jPCT-AE (16447): [ 1318796545598 ] - ERROR: java.lang.RuntimeException: [ 1318796545595 ] - ERROR: java.lang.RuntimeException: [ 1318796545592 ] - ERROR: java
.lang.RuntimeException: [ 1318796545590 ] - ERROR: Failed to load and compile vertex shaders!
I/jPCT-AE (16447):      at com.threed.jpct.Logger.log(Logger.java:189)
I/jPCT-AE (16447):      at com.threed.jpct.GLSLShader.loadProgram(GLSLShader.java:586)
I/jPCT-AE (16447):      at com.threed.jpct.GLSLShader.<init>(GLSLShader.java:230)
I/jPCT-AE (16447):      at com.threed.jpct.GL20.<init>(GL20.java:118)
I/jPCT-AE (16447):      at java.lang.Class.newInstanceImpl(Native Method)
I/jPCT-AE (16447):      at java.lang.Class.newInstance(Class.java:1409)
I/jPCT-AE (16447):      at com.threed.jpct.GLRenderer.init(GLRenderer.java:469)
I/jPCT-AE (16447):      at com.threed.jpct.GLRenderer.init(GLRenderer.java:458)
I/jPCT-AE (16447):      at com.threed.jpct.FrameBuffer.<init>(FrameBuffer.java:92)
I/jPCT-AE (16447):      at com.threed.jpct.FrameBuffer.<init>(FrameBuffer.java:117)
I/jPCT-AE (16447):      at com.threed.jpct.shader.Demo$MyRenderer.onSurfaceChanged(Demo.java:250)
I/jPCT-AE (16447):      at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1356)
I/jPCT-AE (16447):      at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
I/jPCT-AE (16447):
I/jPCT-AE (16447):      at com.threed.jpct.Logger.log(Logger.java:189)
I/jPCT-AE (16447):      at com.threed.jpct.Logger.log(Logger.java:148)
I/jPCT-AE (16447):      at com.threed.jpct.GLSLShader.<init>(GLSLShader.java:234)
I/jPCT-AE (16447):      at com.threed.jpct.GL20.<init>(GL20.java:118)
I/jPCT-AE (16447):      at java.lang.Class.newInstanceImpl(Native Method)
I/jPCT-AE (16447):      at java.lang.Class.newInstance(Class.java:1409)
I/jPCT-AE (16447):      at com.threed.jpct.GLRenderer.init(GLRenderer.java:469)
I/jPCT-AE (16447):      at com.threed.jpct.GLRenderer.init(GLRenderer.java:458)
I/jPCT-AE (16447):      at com.threed.jpct.FrameBuffer.<init>(FrameBuffer.java:92)
I/jPCT-AE (16447):      at com.threed.jpct.FrameBuffer.<init>(FrameBuffer.java:117)
I/jPCT-AE (16447):      at com.threed.jpct.shader.Demo$MyRenderer.onSurfaceChanged(Demo.java:250)
I/jPCT-AE (16447):      at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1356)
I/jPCT-AE (16447):      at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
I/jPCT-AE (16447):
I/jPCT-AE (16447):      at com.threed.jpct.Logger.log(Logger.java:189)
I/jPCT-AE (16447):      at com.threed.jpct.Logger.log(Logger.java:136)
I/jPCT-AE (16447):      at com.threed.jpct.GLRenderer.init(GLRenderer.java:471)
I/jPCT-AE (16447):      at com.threed.jpct.GLRenderer.init(GLRenderer.java:458)
I/jPCT-AE (16447):      at com.threed.jpct.FrameBuffer.<init>(FrameBuffer.java:92)
I/jPCT-AE (16447):      at com.threed.jpct.FrameBuffer.<init>(FrameBuffer.java:117)
I/jPCT-AE (16447):      at com.threed.jpct.shader.Demo$MyRenderer.onSurfaceChanged(Demo.java:250)
I/jPCT-AE (16447):      at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1356)
I/jPCT-AE (16447):      at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
W/dalvikvm(16447): threadid=9: thread exiting with uncaught exception (group=0x40015560)
E/AndroidRuntime(16447): FATAL EXCEPTION: GLThread 10
E/AndroidRuntime(16447): java.lang.RuntimeException: [ 1318796545598 ] - ERROR: java.lang.RuntimeException: [ 1318796545595 ] - ERROR: java.lang.RuntimeExceptio
n: [ 1318796545592 ] - ERROR: java.lang.RuntimeException: [ 1318796545590 ] - ERROR: Failed to load and compile vertex shaders!
E/AndroidRuntime(16447):        at com.threed.jpct.Logger.log(Logger.java:189)
E/AndroidRuntime(16447):        at com.threed.jpct.GLSLShader.loadProgram(GLSLShader.java:586)
E/AndroidRuntime(16447):        at com.threed.jpct.GLSLShader.<init>(GLSLShader.java:230)
E/AndroidRuntime(16447):        at com.threed.jpct.GL20.<init>(GL20.java:118)
E/AndroidRuntime(16447):        at java.lang.Class.newInstanceImpl(Native Method)
E/AndroidRuntime(16447):        at java.lang.Class.newInstance(Class.java:1409)
E/AndroidRuntime(16447):        at com.threed.jpct.GLRenderer.init(GLRenderer.java:469)
E/AndroidRuntime(16447):        at com.threed.jpct.GLRenderer.init(GLRenderer.java:458)
E/AndroidRuntime(16447):        at com.threed.jpct.FrameBuffer.<init>(FrameBuffer.java:92)
E/AndroidRuntime(16447):        at com.threed.jpct.FrameBuffer.<init>(FrameBuffer.java:117)
E/AndroidRuntime(16447):        at com.threed.jpct.shader.Demo$MyRenderer.onSurfaceChanged(Demo.java:250)
E/AndroidRuntime(16447):        at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1356)
E/AndroidRuntime(16447):        at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
E/AndroidRuntime(16447):
E/AndroidRuntime(16447):        at com.threed.jpct.Logger.log(Logger.java:189)
E/AndroidRuntime(16447):        at com.threed.jpct.Logger.log(Logger.java:148)
E/AndroidRuntime(16447):        at com.threed.jpct.GLSLShader.<init>(GLSLShader.java:234)
E/AndroidRuntime(16447):        at com.threed.jpct.GL20.<init>(GL20.java:118)
E/AndroidRuntime(16447):        at java.lang.Class.newInstanceImpl(Native Method)
E/AndroidRuntime(16447):        at java.lang.Class.newInstance(Class.java:1409)
E/AndroidRuntime(16447):        at com.threed.jpct.GLRenderer.init(GLRenderer.java:469)
E/AndroidRuntime(16447):        at com.threed.jpct.GLRenderer.init(GLRenderer.java:458)
E/AndroidRuntime(16447):        at com.threed.jpct.FrameBuffer.<init>(FrameBuffer.java:92)
E/AndroidRuntime(16447):        at com.threed.jpct.FrameBuffer.<init>(FrameBuffer.java:117)
E/AndroidRuntime(16447):        at com.threed.jpct.shader.Demo$MyRenderer.onSurfaceChanged(Demo.java:250)
E/AndroidRuntime(16447):        at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1356)
E/AndroidRuntime(16447):        at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
E/AndroidRuntime(16447):
E/AndroidRuntime(16447):        at com.threed.jpct.Logger.log(Logger.java:189)
E/AndroidRuntime(16447):        at com.threed.jpct.Logger.log(Logger.java:136)
E/AndroidRuntime(16447):        at com.threed.jpct.GLRenderer.init(GLRenderer.java:471)
E/AndroidRuntime(16447):        at com.threed.jpct.GLRenderer.init(GLRenderer.java:458)
E/AndroidRuntime(16447):        at com.threed.jpct.FrameBuffer.<init>(FrameBuffer.java:92)
E/AndroidRuntime(16447):        at com.threed.jpct.FrameBuffer.<init>(FrameBuffer.java:117)
E/AndroidRuntime(16447):        at com.threed.jpct.shader.Demo$MyRenderer.onSurfaceChanged(Demo.java:250)
E/AndroidRuntime(16447):        at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1356)
E/AndroidRuntime(16447):        at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
E/AndroidRuntime(16447):
E/AndroidRuntime(16447):        at com.threed.jpct.Logger.log(Logger.java:189)
E/AndroidRuntime(16447):        at com.threed.jpct.Logger.log(Logger.java:148)
E/AndroidRuntime(16447):        at com.threed.jpct.FrameBuffer.<init>(FrameBuffer.java:94)
E/AndroidRuntime(16447):        at com.threed.jpct.FrameBuffer.<init>(FrameBuffer.java:117)
E/AndroidRuntime(16447):        at com.threed.jpct.shader.Demo$MyRenderer.onSurfaceChanged(Demo.java:250)
E/AndroidRuntime(16447):        at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1356)
E/AndroidRuntime(16447):        at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
W/ActivityManager(11232):   Force finishing activity com.threed.jpct.shader/.Demo
I/jPCT-AE (16447): onPause
V/RenderScript_jni(11310): surfaceCreated
V/RenderScript_jni(11310): surfaceChanged
I/ActivityManager(11232): No longer want android.process.acore (pid 16337): hidden #16
« Last Edit: October 16, 2011, 10:25:43 pm by EgonOlsen »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Help! - all I get is a black triangle
« Reply #14 on: October 16, 2011, 10:24:47 pm »
Of course you do, because you have to change the GLView initialization code as well for this. However, this can't be the source of your problem. I would like to have a look at this model file...