Object3D's transparency issue

Started by AeroShark333, December 06, 2014, 12:07:56 PM

Previous topic - Next topic

Lobby

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?

AeroShark333

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.

Lobby

Maybe you should make sure that you call setTransparency(-1) on your objects so they will use the Z-buffer correctly.

AeroShark333

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?

Lobby

Indeed it will ;) . Alpha testing is also used in minecraft btw.

AeroShark333

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

Lobby


EgonOlsen

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.

AeroShark333

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

EgonOlsen

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.

AeroShark333

#25
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)

EgonOlsen

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.

EgonOlsen

Quote from: AeroShark333 on December 09, 2014, 05:45:14 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...

AeroShark333

Quote from: EgonOlsen on January 06, 2015, 05:28:06 PM
Quote from: AeroShark333 on December 09, 2014, 05:45:14 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:

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
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.


EgonOlsen

That wasn't my actual question. The question was: The version that didn't use the custom shader..was it ES 2.0 already?