Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - AeroShark333

Pages: 1 ... 10 11 [12] 13
166
Support / Re: Object3D's transparency issue
« on: January 09, 2015, 10:00:30 pm »
...either that, or your updated versions won't get executed on the actual device. Can you somehow confirm that your changes really make it onto the device? If you remove the discard, the resulting shader is the normal default shader that jPCT-AE uses and i'm not aware of any problems with that. Also, please make sure that you are calling build() on all of your Object3Ds.

However, there are other, simpler default shaders. We could try to modify one of them. But for choosing one, i have to know which features you are actually using. So...

  • Are you using light sources or just ambient lighting?
  • If you are using lights, how many?
  • Are you using fog?

Code: [Select]
package com.aeroshark333.skinviewer.skinparts;

import com.threed.jpct.GLSLShader;
import com.threed.jpct.Object3D;
import com.threed.jpct.SimpleVector;
import com.threed.jpct.TextureManager;

public class Body extends Object3D {

private static final long serialVersionUID = 8216608860877707087L;

public Body(final GLSLShader shader) {

super(12);

final Object3D box = this;

SimpleVector upperLeftFront = new SimpleVector(-1, -1.5f, -0.5f);
SimpleVector upperRightFront = new SimpleVector(1, -1.5f, -0.5f);
SimpleVector lowerLeftFront = new SimpleVector(-1, 1.5f, -0.5f);
SimpleVector lowerRightFront = new SimpleVector(1, 1.5f, -0.5f);

SimpleVector upperLeftBack = new SimpleVector(-1, -1.5f, 0.5f);
SimpleVector upperRightBack = new SimpleVector(1, -1.5f, 0.5f);
SimpleVector lowerLeftBack = new SimpleVector(-1, 1.5f, 0.5f);
SimpleVector lowerRightBack = new SimpleVector(1, 1.5f, 0.5f);

// Front
box.addTriangle(upperLeftFront, 0, 0, lowerLeftFront, 0, 1,
upperRightFront, 1, 0, TextureManager.getInstance()
.getTextureID("bodyfront"));
box.addTriangle(upperRightFront, 1, 0, lowerLeftFront, 0, 1,
lowerRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("bodyfront"));
// Back
box.addTriangle(upperLeftBack, 0, 0, upperRightBack, 1, 0,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("bodyback"));
box.addTriangle(upperRightBack, 1, 0, lowerRightBack, 1, 1,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("bodyback"));
// Top
box.addTriangle(upperLeftBack, 0, 0, upperLeftFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("bodytop"));
box.addTriangle(upperRightBack, 1, 0, upperLeftFront, 0, 1,
upperRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("bodytop"));
// Bottom
box.addTriangle(lowerLeftBack, 0, 0, lowerRightBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("bodybottom"));
box.addTriangle(lowerRightBack, 1, 0, lowerRightFront, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("bodybottom"));
// Right
box.addTriangle(upperLeftFront, 0, 0, upperLeftBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("bodyright"));
box.addTriangle(upperLeftBack, 1, 0, lowerLeftBack, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("bodyright"));
// Left
box.addTriangle(upperRightFront, 0, 0, lowerRightFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("bodyleft"));
box.addTriangle(upperRightBack, 1, 0, lowerRightFront, 0, 1,
lowerRightBack, 1, 1, TextureManager.getInstance()
.getTextureID("bodyleft"));

box.setName("body");
this.setTransparency(-1);
this.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
this.setShader(shader);
this.compile();
this.strip();
box.build();
}
}
This code is okay right?

  • Are you using light sources or just ambient lighting?
  • Just ambient lighting
  • If you are using lights, how many?
  • One, the ambient lighting
  • Are you using fog?
  • No.

Code: [Select]
this.mainWorld.setAmbientLight(255, 255, 255);

Well... I gave him an .apk file with the custom shader not set to the right leg.
That DID show him the right leg properly.

167
Support / Re: Object3D's transparency issue
« on: January 09, 2015, 12:05:22 pm »
Okay I tried a few things.
1. discard before gl_FragColor
2. discard after gl_FragColor
3. Option 1 + highp
4. Option 2 + highp
5. The shader code by Lobby without discard

Apparently none worked, so the problem is not the discard (I think)

168
Support / Re: Object3D's transparency issue
« on: January 08, 2015, 11:30:48 am »
No luck with the textures square as well :(
Are there any other options?
Perhaps similar/alternative code that does the same as
Code: [Select]
discard;? (I don't think 'return;' would solve it.

169
Support / Re: Object3D's transparency issue
« on: January 07, 2015, 03:05:51 am »
Thanks for adding it to the projectlist!

Some bad news from the user, the new fragment shader does not work... :(

170
Support / Re: Object3D's transparency issue
« on: January 06, 2015, 06:23:17 pm »
It was using OpenGL 2 yes
I am 100% sure I am using OpenGL2 since the beginning.

Sorry for the misinterpretation by the way

171
Support / Re: Object3D's transparency issue
« 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.


172
Support / Re: Object3D's transparency issue
« 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)

173
Support / Re: Object3D's transparency issue
« 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

174
Support / Re: Object3D's transparency issue
« 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

175
Support / Re: Object3D's transparency issue
« 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?

176
Support / Re: Object3D's transparency issue
« 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.

177
Support / Re: Object3D's transparency issue
« on: January 01, 2015, 08:59:37 pm »
It is possible to use transparent skins in Minecraft.
A skin is a 64x32 png file.
Since every bodypart can have transparent elements, I decided to enable transparency for every part.
Is 'alpha testing' easy to do?
Or are there other solutions?

I tried to make the parts not touch each other using about 0.03f space between the parts. But it did not help at all...
Is it possible to have more drawing/sorting precision? Using the Config perhaps?

What will happen in I enlarge the parts a lot and zoom out the camera? The same?

178
Support / Re: Object3D's transparency issue
« on: December 31, 2014, 01:25:45 pm »
On tablet the issue is visible, on phones it isn't (I suppose the width of the screen does have an effect on the bug's visibility)

Anyway, here is a screenshot: https://dl.dropboxusercontent.com/u/47988037/Android/Skin%20Viewer%203D/Screenshot/bug.png
(Look at the right arm (biological left arm))

179
Support / Re: Object3D's transparency issue
« on: December 29, 2014, 04:15:39 pm »
The issue in post #2 does not happen on all devices for some reason...
But it does on a few...
Is there an easier solution?

180
Support / Re: Object3D's transparency issue
« on: December 09, 2014, 05:45:14 pm »
Thanks for the replies!

I kind of solved my problem already.
I added
Code: [Select]
box.setSortOffset(9); to both RightLeg.java and LeftLeg.java (which seemed to work)
I think this fix was a bit logical (now that I think about it... :|)

Thanks a lot for the support! (I have no idea what alpha testing is, so I guess it is better I don't have to use that difficult stuff xD)

My final question: Is my app project-worthy? (for this page: http://www.jpct.net/projects.html)

Pages: 1 ... 10 11 [12] 13