Author Topic: Object3D's transparency issue  (Read 20961 times)

Offline Lobby

  • int
  • **
  • Posts: 66
    • View Profile
    • flowersoft
Re: Object3D's transparency issue
« Reply #15 on: January 01, 2015, 09:09:46 pm »
As a matter of fact, alpha testing is an easy thing if you already have the shader. If you have the shader code, then you have just to load the shader and apply it to all objects that should use alpha testing. Do you have question about my little sample?

Offline AeroShark333

  • float
  • ****
  • Posts: 319
    • View Profile
Re: Object3D's transparency issue
« Reply #16 on: January 02, 2015, 11:44:10 pm »
Your shader does solve the problem for the horizontal orbiting camera (around the model). But not really for free (incl. vertical) orbiting around the model.

Offline Lobby

  • int
  • **
  • Posts: 66
    • View Profile
    • flowersoft
Re: Object3D's transparency issue
« Reply #17 on: January 03, 2015, 11:38:57 am »
Maybe you should make sure that you call setTransparency(-1) on your objects so they will use the Z-buffer correctly.

Offline AeroShark333

  • float
  • ****
  • Posts: 319
    • View Profile
Re: Object3D's transparency issue
« Reply #18 on: January 03, 2015, 01:15:10 pm »
It seems to have worked completely! :D
Thanks a lot!

Question: will it work if I add a third 'box' around the 2 existing boxes?

Offline Lobby

  • int
  • **
  • Posts: 66
    • View Profile
    • flowersoft
Re: Object3D's transparency issue
« Reply #19 on: January 03, 2015, 01:54:34 pm »
Indeed it will ;) . Alpha testing is also used in minecraft btw.

Offline AeroShark333

  • float
  • ****
  • Posts: 319
    • View Profile
Re: Object3D's transparency issue
« Reply #20 on: January 05, 2015, 03:17:21 pm »
A new issue appeared since the use of the shader. (and using setTransparency(-1))

Image:
https://dl.dropboxusercontent.com/u/47988037/Android/Skin%20Viewer%203D/v3%2C1/Bug/Screenshot_2015-01-05-17-34-37.jpg

A user sent me this screenshot.
Basically everything is black... (the user said it was not black before the shader update)
This does not happen on my devices though

Offline Lobby

  • int
  • **
  • Posts: 66
    • View Profile
    • flowersoft
Re: Object3D's transparency issue
« Reply #21 on: January 05, 2015, 03:35:24 pm »
I can't open the image :( .

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Object3D's transparency issue
« Reply #22 on: January 05, 2015, 05:14:45 pm »
If everything is black, it's usually either some value out of range (i.e. larger than 65536) or a problem with the shader code that occurs only with some gpus/shader compilers. These problems are usually logged at runtime. It would be helpful to have the log and a more detailed device info available.

Offline AeroShark333

  • float
  • ****
  • Posts: 319
    • View Profile
Re: Object3D's transparency issue
« Reply #23 on: January 05, 2015, 08:47:07 pm »
Sorry for the dead link:
https://dl.dropboxusercontent.com/u/47988037/Android/Skin%20Viewer%203D/v3.1/Bug/Screenshot_2015-01-05-17-34-37.jpg

The borders of the model (of alpha channel) do seem to show up. (see head)
Only the textures become black

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Object3D's transparency issue
« Reply #24 on: January 06, 2015, 07:59:42 am »
That doesn't really help without the details mentioned above. It's most likely a flaw in the shader's code that one shader compiler ignores but the other doesn't.

Offline AeroShark333

  • float
  • ****
  • Posts: 319
    • View Profile
Re: Object3D's transparency issue
« Reply #25 on: January 06, 2015, 04:30:18 pm »
I got some more information from the user.
The phone is:
Asus Zenfone 4 (Android 4.2.2)

I sent the bugreport (txt-file) to you in PM EgonOlsen and Lobby)

Note: not sure if the opengl texture size warning can be ignored... but the same sizes were used before I added the shader. (and it worked for the user before)
« Last Edit: January 06, 2015, 05:05:26 pm by AeroShark333 »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Object3D's transparency issue
« Reply #26 on: January 06, 2015, 05:24:14 pm »
I can't spot anything obviously wrong in that log except for the texture size issue. Before adding the shader, were you actually using OpenGL ES 2.0 already? Because if not, this might be the problem.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Object3D's transparency issue
« Reply #27 on: January 06, 2015, 05:28:06 pm »
My final question: Is my app project-worthy? (for this page: http://www.jpct.net/projects.html)
I somehow overlooked this question...of course it is. I'll add it later...

Offline AeroShark333

  • float
  • ****
  • Posts: 319
    • View Profile
Re: Object3D's transparency issue
« Reply #28 on: January 06, 2015, 06:15:15 pm »
My final question: Is my app project-worthy? (for this page: http://www.jpct.net/projects.html)
I somehow overlooked this question...of course it is. I'll add it later...
Thanks :)

About your previous post, this is my current code:
Code: [Select]
gLView.setEGLContextClientVersion(2);
viewerRenderer = new ViewerRenderer();
gLView.setRenderer(viewerRenderer);

The shader is loaded in the constructor of ViewerRenderer
The objects are created in the constructor as well (after the shader loading code)

The objects are added to the world in
Code: [Select]
public void onSurfaceChanged(GL10 gl, int width, int height) {I did not pass the GL10 to the framebuffer.

The OpenGLversion is set to 2 before calling the constructor.

The application works fine on most devices... This is the only device I got a report from... And that is since the usage of the shader.


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Object3D's transparency issue
« Reply #29 on: January 06, 2015, 06:19:20 pm »
That wasn't my actual question. The question was: The version that didn't use the custom shader..was it ES 2.0 already?