Recent Posts

Pages: 1 [2] 3 4 ... 10
11
Support / Re: Rendered in black with multiple texture files (jpg + png)
« Last post by EgonOlsen on November 03, 2018, 12:53:27 pm »
Not sure if that's your issue here, but you can't have transparent parts in objects that are actually opaque. What you are seeing there might be the actual color of the png texture without the alpha channel. Can you split your model into two, where one contains the opaque parts and one the transparent one?
12
Support / Re: Rendered in black with multiple texture files (jpg + png)
« Last post by yjoo9317 on November 02, 2018, 07:51:02 pm »
Thanks for the reply.

I removed setTexture calls and leave it doing auto-set.

I noticed that each texture was applied to the area where it was supposed to be.

But still floor texture (png file) is rendered in black..
10% of the png texture is shadow and the rest area is transparent.

That 10% (shadow) was rendered in red and the transparent area is rendered in black.
Any clue on that?
png file with transparency would cause the problem?

The reason why I am saying this,
If I switch png to jpg file instead, then it renders it at least.
But to draw the proper alpha channel, it needs to use a png file still.

Thanks.
13
Support / Re: Rendered in black with multiple texture files (jpg + png)
« Last post by EgonOlsen on November 02, 2018, 12:22:43 pm »
It doesn't work that way. For assigning multiple textures to one mesh, you have to rely on the auto-assignment. setTexture(...) sets the texture for the whole mesh at once. What you actually want to do, is to remove the setTexture()-calls and make sure that name1 and name2 in the addTexture()-calls match the names from the mtl-file. In case of doubt, have a look at the log output when loading the model for the exact names.
14
Support / Re: Rendered in black with multiple texture files (jpg + png)
« Last post by yjoo9317 on November 01, 2018, 10:19:24 pm »
<mtl>
newmtl Body_White
Ka 1.000000 1.000000 1.000000
illum 1
map_Ka body.jpg

newmtl FLOOR
Kd 0.800000 0.800000 0.800000
illum 1
map_Kd floor.png
map_d floor.png


//Add texture to TextureManager
TextureManager.getInstance().addTexture(name1, new Texture(tfis1)); // for body tfis1 is FileInputStream to .jpg file
TextureManager.getInstance().addTexture(name2, new Texture(tfis2, true)); // for floor tfis2 is FileInputStream to .png file. tried both with or without alpha. neither work.

//and then Set Texture
model.setTexture(name1); //  for body.jpg
model.setTexture(name2);  // for floor.png

If I exclude name2 texture, then at least it can render the body fine.

15
Support / Re: Rendered in black with multiple texture files (jpg + png)
« Last post by EgonOlsen on October 31, 2018, 11:07:35 pm »
How are you assigning the textures?
16
Support / Rendered in black with multiple texture files (jpg + png)
« Last post by yjoo9317 on October 31, 2018, 09:44:24 pm »
Hi,

my model mtl file is pointing to 2 texture files for body (.jpg) and shadow (.png) respectively.
I noticed the model is rendered in almost black. (with a little red-ish area)
If I exclude png file then it renders the model fine but obviously shadow area is also rendered with body texture.
Am I missing something here?

note: when adding png texture, I also turned on "useAlpha" parameter as well.
        Also loading the model from serial file to speed up.
17
Support / to delete an Object3D
« Last post by MichaelJPCT on October 28, 2018, 09:03:18 am »
Hi Egon, long time no see. i am still using JPCT for my hobby project , and i'm happy with it so far.
now i need to add/delete Object3D , like a lot. i see dispose() of Light , but no such thing of Object3D. does it mean it's safe to just remove it from World and set the field to null and let JVM do garbage collection?
and for other object types, are they all safe if there is no dispose() method?
18
Support / Re: Crash (native)
« Last post by AeroShark333 on October 25, 2018, 05:15:16 pm »
When you change Config.useVBO = true to false in the testcase's code
Would that help to reproduce the error on a physical device perhaps?
19
Support / Re: Crash (native)
« Last post by EgonOlsen on October 25, 2018, 02:31:24 pm »
I can't really use the emulator, because for me, it crashes like mad anyway no matter what I'm trying to do with it. That's not the app inside of the emulator, but the whole emulator instance.
20
Support / Re: Crash (native)
« Last post by AeroShark333 on October 25, 2018, 10:57:35 am »
Hmmm, it's a Nexus 5X with API-28 (x86)
(I think I installed it from the SDK but yeah)
I've had this one for a while now so probably a newer one might be a bit different
Pages: 1 [2] 3 4 ... 10