ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Help with CopperCube
forum topic indicator How do I use the color palette for models?
person icon
azamaticon
Registered User
Quote
2024-01-08 18:42:57

Hello everyone Tell me please. I downloaded the car models, here is the link:
https://pavel-3d.itch.io/low-pol...

In the engine, all models are white. How do I load the color palette? She is the only one for all models.
The palette looks like this:
https://disk.yandex.ru/i/kZOhizh...

person icon
Guest
Guest
Quote
2024-01-08 18:45:45

Convert the models to .dae and then load them in blender, as per just_in_case .dae models import with vertex colors.
however I never tried that personally.

person icon
Guest2
Guest
Quote
2024-01-09 06:38:15

@OP

I have downloaded the pack you mentioned. You can use the OBJ files from it to import the car with colors (they are textured, not vertex colored). You need the OBJ and MAT files for each car, and you should have the palette in the same folder (e.g., your Assets folder) for the models to import with the texture on them.

person icon
okeoke
Registered User
Quote
2024-01-09 08:42:38

I never managed to get it work with mtl. Guest2 could you please provide a working example?

But it works with dae format, read through:
https://www.ambiera.com/forum.ph...

person icon
Guest2
Guest
Quote
2024-01-09 11:12:38

@okeoke

The model pack the OP was referring to doesn't use vertex colors but instead uses a texture/color atlas. The OBJ standard doesn't support per-vertex color, which is what CC uses. DAE isn't a good option either for working in CC with vertex colors, as the colors are different between your modeling software and CC from what I've seen (e.g., bright red turns to dark red). The best option is to assign materials to the parts of your model on which you want different colors, and then write code to apply vertex colors to those areas in CC's editor or use a shader at runtime if that is your preference. A while back, I wrote code here in the forums to apply the color to the material (aka related geometry) in the editor, but I can't recall the name of the post, unfortunately.

person icon
okeoke
Registered User
Quote
2024-01-09 11:43:20

The pack he provided also contains blend and fbx files which support vertex color.

Color in blender is exactly the same as in coppercube. Material rendering settings are different. You can disable reflections, roughness and etc in blender and receive exactly the same look.

This is not the point - I thought, you're saying that it's somehow possible to use obj with mtl, so I was asking how to do that. I also don't see a point to write a shader in case you still have to "assign materials to the parts of your model on which you want different colors, and then write code to apply vertex colors", since you can simply export to dae and import it with no additional work:)

Also it's not required anyway, since this pack actually uses UV mapping:
https://i.ibb.co/NN7N2Zc/uv-map....

You don't have to do anything with mtl, just apply a provided texture to the default coppercube material.

person icon
Guest
Guest
Quote
2024-01-09 21:50:01

@okeoke

Yes, as I have already mentioned, OP's pack uses a color atlas.

Make a full red vertex-colored cube in Blender and import it into CC. Remove the default white texture CC applies to models without textures. It's dark red. Not the same. Having to use that texture defeats the purpose of vertex colors. You might as well use 1x1 color textures and apply them as needed. Vertex colors really aren't a good thing to use in CC because CC's lighting is vertex-based. Of course, if you're not using lighting then it doesn't matter.

About the OBJ and MTL, you need the MTL file for CC to automatically apply the texture when you import the model. If you don't want that, then sure you can do without it. If you're importing a bunch of models, then it can be a pain to do it any other way. The OBJ standard doesn't work with per-vertex color at all, by the way.

The shader could be useful for specific use cases where you want to dynamically change the color at runtime, but you can do the same thing by switching out the color textures I mentioned earlier. Lots of ways to solve problems in this software, but some solutions are better than others.

person icon
okeoke
Registered User
Quote
2024-01-09 22:19:02

ok, I see. Thanks for the clarification!

person icon
just_in_case
Moderator
Quote
2024-01-10 05:29:58

Yeah, copper cube uses a default vertex color value If I remember correctly of around
(64,64,64), so you probably need to calculate your vertex color with that value for .dae models.

so yeah, using a color palette is good, you can also use the palette-swapping shader if you aren't using the inbuilt lighting of the engine. However, I can also update the shaders to work with the inbuilt lighting. I think that way it will be much better to use the palette-swapping shader. I found out how to have inbuilt lighting work a long time ago, but never updated any of my shaders with it.

I mean with that you can create variations of the same model by simply swapping the color.
let me know if anybody is interested in that.

person icon
Guest
Guest
Quote
2024-01-11 00:36:11

@jic

I think that shader working with the default lighting would be a great benefit to the community. I'm a fan of old school-looking, retro CGI. Colors play a huge part in that aesthetic. I tackled learning GLSL shaders a few months back but never got around to doing HLSL translations. If you happen to get the time to do it, I'd say go for it. emoji icon_grin


Create reply:










 

  

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


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






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