Author Topic: Multiple Textures on Single-Part Model  (Read 2509 times)

Offline AGP

  • quad
  • ******
  • Posts: 1515
    • View Profile
Multiple Textures on Single-Part Model
« 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

Offline AGP

  • quad
  • ******
  • Posts: 1515
    • View Profile
Re: Multiple Textures on Single-Part Model
« Reply #1 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:








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.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: Multiple Textures on Single-Part Model
« Reply #2 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.

Offline AGP

  • quad
  • ******
  • Posts: 1515
    • View Profile
Re: Multiple Textures on Single-Part Model
« Reply #3 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.
« Last Edit: August 18, 2014, 01:09:00 am by AGP »

Offline AGP

  • quad
  • ******
  • Posts: 1515
    • View Profile
Re: Multiple Textures on Single-Part Model
« Reply #4 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).

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: Multiple Textures on Single-Part Model
« Reply #5 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.

Offline AGP

  • quad
  • ******
  • Posts: 1515
    • View Profile
Re: Multiple Textures on Single-Part Model
« Reply #6 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.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: Multiple Textures on Single-Part Model
« Reply #7 on: August 18, 2014, 01:17:55 pm »
ok, good luck with it ;)

Offline AGP

  • quad
  • ******
  • Posts: 1515
    • View Profile
Re: Multiple Textures on Single-Part Model
« Reply #8 on: August 18, 2014, 01:26:48 pm »
That's not cool, man. Would you like to have a look at the model?

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: Multiple Textures on Single-Part Model
« Reply #9 on: August 18, 2014, 01:30:03 pm »
no, i dont think it will help

Offline AGP

  • quad
  • ******
  • Posts: 1515
    • View Profile
Re: Multiple Textures on Single-Part Model
« Reply #10 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.


Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: Multiple Textures on Single-Part Model
« Reply #11 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.

Offline AGP

  • quad
  • ******
  • Posts: 1515
    • View Profile
Re: Multiple Textures on Single-Part Model
« Reply #12 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.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: Multiple Textures on Single-Part Model
« Reply #13 on: August 18, 2014, 02:07:30 pm »
just assign a texture with a grid, it would give an idea

Offline AGP

  • quad
  • ******
  • Posts: 1515
    • View Profile
Re: Multiple Textures on Single-Part Model
« Reply #14 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.