www.jpct.net

Bones - Skeletal and Pose Animations for jPCT/jPCT-AE => Bones => Topic started by: AGP on August 16, 2014, 06:42:45 pm

Title: Multiple Textures on Single-Part Model
Post by: AGP on August 16, 2014, 06:42:45 pm
Raft, could you help me out with this thread, please?

http://www.jpct.net/forum2/index.php/topic,4054.0.html (http://www.jpct.net/forum2/index.php/topic,4054.0.html)
Title: Re: Multiple Textures on Single-Part Model
Post by: AGP on August 17, 2014, 04:05:35 am
Actually, I have new information on this particular model: it seems that bones sees it as two parts, thankfully. But when I directly call setTexture on the individual parts, the following two textures produce the following render:

(https://dl.dropboxusercontent.com/u/93826015/QG1_body_Difuse.png)

(https://dl.dropboxusercontent.com/u/93826015/QG1_head-Difuse.png)


(https://dl.dropboxusercontent.com/u/93826015/TextureProblem.jpg)

As a matter of fact, I can only see non-black at all because I scaled the textured down from 2048x2048 to 1024x1024. It seems that either Bones or OgreMax is completely remapping the model. Any help would be appreciated.
Title: Re: Multiple Textures on Single-Part Model
Post by: raft on August 17, 2014, 03:57:32 pm
you cannot assign multiple textures to a single Animated3D. unless of course you know the polygon id's and set textures via PolygonManager.

for scaling the texture, try calling Object3D.recreateTextureCoords after assigning the scaling the texture.
Title: Re: Multiple Textures on Single-Part Model
Post by: AGP on August 17, 2014, 08:48:08 pm
I tried recreateTextureCoords(), but nothing changed. If I visually understood the problem I would just edit the texture itself. I don't even know whether it's Bones or OgreMax messing with the coordinates, but the coordinates have changed.

Did you read Egon's point that you in fact can assign multiple textures to a single Object3D? Obviously your loader doesn't do it, and it's possible that the information is lost by the time we create a .bones file, but wouldn't it be nice to recover this functionality for Bones? I think that it's worth a look at his loaders. At any rate, that's no longer the current issue.
Title: Re: Multiple Textures on Single-Part Model
Post by: AGP on August 17, 2014, 08:54:27 pm
I don't think that you understood my current problem at all. I would rather that the textures be at 2048x2048. But at that resolution, all I get is black (clearly because only the black part of the texture is being textured on the models). When I edit the textures to rescale them to 1024x1024, I get some of the non-black texture parts (albeit the wrong parts in the wrong places).
Title: Re: Multiple Textures on Single-Part Model
Post by: raft on August 18, 2014, 08:58:51 am
Did you read Egon's point that you in fact can assign multiple textures to a single Object3D? Obviously your loader doesn't do it, and it's possible that the information is lost by the time we create a .bones file, but wouldn't it be nice to recover this functionality for Bones? I think that it's worth a look at his loaders. At any rate, that's no longer the current issue.
yes i know core jPCT can load objects with multiple textures. but it cannot do so for example for MD2 models. i've no intention to add that for now. also i'm not sure if it's actually possible.

I don't think that you understood my current problem at all. I would rather that the textures be at 2048x2048. But at that resolution, all I get is black (clearly because only the black part of the texture is being textured on the models). When I edit the textures to rescale them to 1024x1024, I get some of the non-black texture parts (albeit the wrong parts in the wrong places).
if you call recreateTextureCoords scaling a texture shouldnt change what parts of texture is mapped and hence is visible.
Title: Re: Multiple Textures on Single-Part Model
Post by: AGP on August 18, 2014, 01:10:57 pm
As I said, I did call it. The problem IS NOT WITH THE SCALING. Somewhere along the line the texture coordinates got changed.
Title: Re: Multiple Textures on Single-Part Model
Post by: raft on August 18, 2014, 01:17:55 pm
ok, good luck with it ;)
Title: Re: Multiple Textures on Single-Part Model
Post by: AGP on August 18, 2014, 01:26:48 pm
That's not cool, man. Would you like to have a look at the model?
Title: Re: Multiple Textures on Single-Part Model
Post by: raft on August 18, 2014, 01:30:03 pm
no, i dont think it will help
Title: Re: Multiple Textures on Single-Part Model
Post by: AGP on August 18, 2014, 01:32:57 pm
Why wouldn't it help? Is there no way to write a tester that unwraps the coordinates? Something like the following image? This model is important to me.

(http://www.creativeobserver.com/img/5445_raylight_games_xrayunwrap_1.5_3ds_max_plug-in_lg.jpg)
Title: Re: Multiple Textures on Single-Part Model
Post by: raft on August 18, 2014, 01:36:39 pm
it wouldnt help since as you said there is something wrong with its texture coordinates. what am i supposed to do with a model with some inccoreect coordinates? from my point of view they are just some numbers instead of another numbers.

this doesnt happen with other models so i can assume this happens either because of your model or your exporter settings.
Title: Re: Multiple Textures on Single-Part Model
Post by: AGP on August 18, 2014, 01:41:26 pm
It's not OgreMax's settings, because I did nothing different than usual (I just set it to export XML and I synced to Mixer). But it COULD be OgreMax. I wouldn't know how to do it, but is there no way to write something like the above image? If I could see where the coordinates were I could edit the texture files to match them.
Title: Re: Multiple Textures on Single-Part Model
Post by: raft on August 18, 2014, 02:07:30 pm
just assign a texture with a grid, it would give an idea
Title: Re: Multiple Textures on Single-Part Model
Post by: AGP on August 18, 2014, 02:26:08 pm
No, I mean the right side of it (the unwrapped spaces). This is frustrating, because I've been looking for Ogre file viewers that can do this and none seem to. Then again, this would only be useful if all the textured areas are there to begin with. Do you use 3ds max? If so, would you be willing to see the problem for yourself? Because there's 50% chance that the problem occurs during importing. I know you use jME's importer, but it would be nice to verify the problem.
Title: Re: Multiple Textures on Single-Part Model
Post by: AGP on August 18, 2014, 02:33:21 pm
I meant, the left side of the above image.
Title: Re: Multiple Textures on Single-Part Model
Post by: raft on August 18, 2014, 02:35:02 pm
i dont have access to a 3d Max at the moment. have you tried loading your model into OgreMax viewer?
Title: Re: Multiple Textures on Single-Part Model
Post by: AGP on August 18, 2014, 02:41:04 pm
I had before, without textures. Just to reply  to you now, I copied the textures into the folder with the .mesh file, and loaded it. The textures look right in the viewer (I didn't think it would load the textures, for some reason). Which, I guess just leaves the importer (since Derek says that the XMLs are identical to the binary files).
Title: Re: Multiple Textures on Single-Part Model
Post by: raft on August 18, 2014, 02:49:33 pm
did you try your model in Bones' OgreSample?
Title: Re: Multiple Textures on Single-Part Model
Post by: AGP on August 18, 2014, 03:09:29 pm
No. How do I run that?
Title: Re: Multiple Textures on Single-Part Model
Post by: raft on August 18, 2014, 03:33:33 pm
if you import Bones into Eclipse, you can run inside Eclipse.
Title: Re: Multiple Textures on Single-Part Model
Post by: AGP on August 18, 2014, 03:40:39 pm
I finally ran it (I don't use Eclipse so it took me a little longer to do it).

Given what Egon just told me about the software renderer, I scaled the textures down to 256x256 and they now look perfect. It should be noted that I stated from the beginning that I was using the software renderer. Thanks for the help. I'm glad that it wasn't the importer, after all.