Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Feature requests and bug reports
Packing Textures [BUG]

veganpete
Registered User
Quote
2021-10-04 11:09:50

When packing textures, coppercube often calculates the atlas/uv map incorrectly.

After clicking "pack all textures into 1", the static meshes (.obj) often look wrong (surface have the wrong texture applied/baked).

Any fix/workaround for this please? I've tried using different resolutions/texture sizes.

Thanks.


veganpete
Registered User
Quote
2021-10-04 14:53:37

Okay, figured it out...

I had several models using shared textures, this prevents you from packing the textures.

To successfully pack textures into a single file, I think every single texture must be unique for each model UV.

Will have to go back and try to re-texture all my models, then pack them again.

For example: If I have metal.png as a texture on a gun and on the floor - if I then pack the floor textures, the UZI will suddenly have the floor texture. To fix, the floor and the uzi need different metal textures before I can pack them.

Due to this, in my case, I'm not sure if packing the textures is actually more efficient than keeping them separate because there will be far less files if I keep them separate.


just_in_case
Moderator
Quote
2021-10-05 05:24:50

If you don't wanna retexture them, what you can do is you can open individual models in a new ccb then pack the texture from there and save the packed texture from that ccb, and now apply that texture to your original main game file, where all the model lies. It will prevent you from recreating textures from scratch.

hope that helps.


VP
Guest
Quote
2021-10-05 13:19:03

Oh that's a really good idea!

I'll do that instead. Definitely the easiest/quickest way to do it.

Thanks just_in_case !


veganpete
Registered User
Quote
2021-10-12 12:04:16

Just tried the individual models in separate ccb files and unfortunately it's still not working for me....

Here's before packing....
🔎︎


Here's after packing...
🔎︎


It's turned the wood texture to brass, even though I can see both the wood and brass textures in the packed atlas.

This is happening with almost all of my static models. Any ideas please?

Thanks.


Guest
Guest
Quote
2021-10-12 15:40:23

@VP

I am going to do some tests today with a cube and see what I can figure out. I ran into this issue with some buildings I converted from Unity prefabs. But I didn't have time to go into it.
Post in a bit.


Guest
Guest
Quote
2021-10-12 16:06:18

So I made a cube .obj in my 3D software and exported with one material and uv-mapped. I then used CC's default textures and assigned them to the faces of the cube. I then used the texture packer at default settings and it worked. My first idea is perhaps the texture packer is meant to only work with textures assigned inside of CC with the polygon tools. Now for a more complex model...


Guest
Guest
Quote
2021-10-12 16:25:41

Ok so I used a model from a pack that had two textures. I imported it into CC. Both textures showed up automatically. I scaled the model up and then used Modify Selection > Freeze Scale and Normalize Normals. I then used the texture packer on it, and it worked with no problems. Try doing what I did, VP, and let us know if it worked. Thanks.


VP
Guest
Quote
2021-10-12 16:51:03

Thanks for testing guest !

I tried again and followed your workflow...

imported model and 4 textures (they show up correctly in coppercube). Scaled up the model and froze the scale and normalised the normals. Then tried to pack the textures - same issue occurred.

Here's the ccb file with the model I made (textured) if you fancy testing it for me...

https://drive.google.com/file/d/...

Thanks again.


Guest
Guest
Quote
2021-10-12 16:55:12

Seems that was a false hope, as I tried again and this time without doing anything to the model but scaling it, and it worked. Hmm... The format of the model I used was FBX (converted to binary) from Unity. I will look at your model and see.


Guest
Guest
Quote
2021-10-12 17:04:16

I just opened your CCB, VP. The first thing I noticed was your textures are not in powers of 2. 256 x 256, 512 x 512, 1024 x 1024, etc. The fact that they are non-uniform may be your issue. I am going to scale your textures in a program and test.


Guest
Guest
Quote
2021-10-12 17:35:21

I scaled all your textures to a power of 2 and that didn't help at all, so I looked in your irrEdit/irrlicht properties and noticed your model has 26 materials. That is a huge amount considering you only have 4 textures. Now I am going to look at the mesh itself.


Guest
Guest
Quote
2021-10-12 20:43:29

https://ufile.io/u3f1kr1q

I merged the groups together for your model but it still came up as 22 groups when I only had 4 in Blender. No clue why. To fix the problem I had to scale the normal of the wood texture to fit on the uv map. If the normals are too big, they end up crossing over into another a texture. If anyone is going to use the packer, I suppose they should max the normals to the bounds of the uv map and go no further. If not, you can simply scale the offending normal in a 3D software and then try again to see if it looks right. Let me know if you have any questions and I will be glad to help. Cheers.


VP
Guest
Quote
2021-10-12 21:37:36

Thank you Guest !

So, just to confirm.... pack the textures, then stretch the UV until it fits the model. Perfect!

I recently learned that I can stretch UV's in coppercube (using the UV button in the polygon editor, then middle click to stretch) so I'll give it a go.

Really appreciate you takingthe time to figure it out.

Thanks.


Guest
Guest
Quote
2021-10-12 22:25:57

🔎︎


This is your model inside Blender. The window to the right is the UV editor. The normal is very large for your small texture (128 x 128).

So I scaled the normal down to fit inside the UV map like this:

🔎︎


Then I imported the model back into CC and packed the textures and it worked. I didn't use any of the tools in CC to move any of the normals.

The problem is you lose some resolution doing it this way, but that is mainly because you have such a small texture.

Hopefully this explains it better, and you are welcome--it is stuff I need to learn anyway.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internati?nal" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact