Page 1 of 1

Camouflage Export

Posted: Sun Sep 29, 2024 12:17 pm
by Zoltis_toth_wotb
I just created camouflage but i can export it, because in game files is just red and green

Re: Camouflage Export

Posted: Mon Sep 30, 2024 1:13 am
by coffee
Can you show me what your camo looks like?
The camo in the game is created based on a base texture and mixture of colors and alpha.
I didn't figure this out, another coder did.
this is the code in the shader.

Code: Select all

// rextimmy gets full credit for figuring out how mixing works!
vec4 applyCamo(vec4 cc, vec4 camoTex) {
    vec4 ac = armorcolor;
    cc = ac;
    cc = mix(cc, c0, camoTex.r * c0.a);
    cc = mix(cc, c1, camoTex.g * c1.a);
    cc = mix(cc, c2, camoTex.b * c2.a);
    cc = mix(cc, c3, camoTex.a * c3.a);
    return cc;
}
co to c3 are game data colors for that camo., They are different for each one. It's complicated but allows something like 16,384 color patterns.
The blue channel in the GMM map is the paint mask. Camo and armor are painted were they are mixed based on the alpha of that channel.
consider it the alpha blend between the diffuse texture and the camo and body pain.
Body pain is the base color for each nation. Let me grab it from my Blender node builder.

Code: Select all

colors = [
    [82 / 255, 72 / 255, 51 / 255, 0.0],  # usa (0)
    [82 / 255, 72 / 255, 51 / 255, 0.0],  # uk (1)
    [61 / 255, 62 / 255, 42 / 255, 0.0],  # china (2)
    [15 / 255, 36 / 255, 36 / 255, 0.0],  # czech (3)
    [15 / 255, 36 / 255, 36 / 255, 0.0],  # france (4)
    [90 / 255, 103 / 255, 94 / 255, 0.0], # germany (5)
    [15 / 255, 36 / 255, 36 / 255, 0.0],  # japan (6)
    [15 / 255, 36 / 255, 36 / 255, 0.0],  # poland (7)
    [61 / 255, 62 / 255, 42 / 255, 0.0],  # ussr (8)
    [15 / 255, 36 / 255, 36 / 255, 0.0],  # sweden (9)
    [15 / 255, 36 / 255, 36 / 255, 0.0]   # italy (10)
]
The numbers are given as byte values so to converter them to decimal, I divide by 255. that gives me a range of 0.0 to 1.0.
These values are in the tanks XML in the item_defs in the scripts pkg.
If you want to have pre decal painted diffuse text textures with the proper masking by the blue channel in the GMM, I have an app for that.
It's called swizzler.
Fast forward to the part where i start adding the flame to the front of the tank. It will explain how to use Swizzler.
This is an older version of TE but swizzler hasn't changed at all.

Let me know about that camo.
YouTube..
https://youtu.be/fkTMXQiUsTY
Try this one too:
https://youtu.be/1HXSy-03OJA

Re: Camouflage Export

Posted: Mon Sep 30, 2024 11:16 am
by Zoltis_toth_wotb
its germany Polylines with edited colours for Blitztrager auf E220. I also need to rotate it, scale and tile.

Re: Camouflage Export

Posted: Mon Sep 30, 2024 2:32 pm
by coffee
Im looking at this now. Seem its not loading a lot of camo.
Looks like a problem with my C++ app to load textures.

Re: Camouflage Export

Posted: Mon Sep 30, 2024 11:00 pm
by coffee
Explain to me what you want to do like Im a 5 year old. Im old and usually stoned. LOL

Re: Camouflage Export

Posted: Tue Oct 01, 2024 7:19 am
by Zoltis_toth_wotb
Only what I need is when I edit camouflage in Camouflage Editor, it should be there little button to Export Camouflage. It should looks like how I edited. For Example when Polylines are not edited, its green with darker green. So I edit it to Grey and Yellow and I should be able export that Grey and Yellow Camouflage to be able use it in Blender on my vehicle as skin. Is that what you wanted to hear? I'm young and dumb so I don't understand scripting and reverse-engineering so I don't know if it's possible. I think lot of people would wellcome this feature.