Vertex colour and paintjobs [SOLVED]

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

BaStFan
Posts: 5
Joined: Sun, 15. Mar 20, 17:01
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by BaStFan » Mon, 30. Mar 20, 05:06

If so than I guess the only way to get a sharp color edge on a smooth surface is to use textures. A uniform color can be sourced from just a couple of pixels on the UV map. The texture size can be minimal.
Will get into it my self soon.
Good informations here, thanks :)

User avatar
Axeface
Posts: 2943
Joined: Fri, 18. Nov 05, 00:41
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by Axeface » Mon, 30. Mar 20, 16:38

Thanks for the info guys.

aurumgallente
Posts: 121
Joined: Sun, 14. Jun 20, 14:45
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by aurumgallente » Thu, 29. Oct 20, 16:10

Alexface, can you explain how to properly use default hulltexture and hullpattern materials? When I use those materials and part has 2 channels, it always becomes rusty as old bucket. So I have to remove all channels except 1st one and I can't apply paint jobs for this par of the ship.

User avatar
Axeface
Posts: 2943
Joined: Fri, 18. Nov 05, 00:41
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by Axeface » Fri, 30. Oct 20, 13:29

aurumgallente wrote:
Thu, 29. Oct 20, 16:10
Alexface, can you explain how to properly use default hulltexture and hullpattern materials? When I use those materials and part has 2 channels, it always becomes rusty as old bucket. So I have to remove all channels except 1st one and I can't apply paint jobs for this par of the ship.
I remember this happening on my ships too but I cant remember exactly what caused it, I cant check right now but I THINK that happens when the vertex colour for any particular mesh is pure white (cant remember whether it was in the control channel or the colour channel). Its probably in the shader for when the devs want rust?

BrummBear02
Posts: 308
Joined: Fri, 3. Oct 08, 20:43
x3ap

Re: Vertex colour and paintjobs [SOLVED]

Post by BrummBear02 » Fri, 30. Oct 20, 22:14

aurumgallente wrote:
Thu, 29. Oct 20, 16:10
Alexface, can you explain how to properly use default hulltexture and hullpattern materials? When I use those materials and part has 2 channels, it always becomes rusty as old bucket. So I have to remove all channels except 1st one and I can't apply paint jobs for this par of the ship.
if the second channel is white your ship appears rusty. just paint everything black if u dont want to use paintjob areas.

viewtopic.php?f=181&t=414599 check this out maybe
Gebt mir einen Spiegel dann schlage ich ihn mit seinem eigenen Gesicht

aurumgallente
Posts: 121
Joined: Sun, 14. Jun 20, 14:45
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by aurumgallente » Sat, 31. Oct 20, 14:54

I asked Linolafett and he said that rust is a blue channel. Blue color adds rust.

User avatar
Axeface
Posts: 2943
Joined: Fri, 18. Nov 05, 00:41
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by Axeface » Sat, 31. Oct 20, 16:45

I dont think ive ever coloured anything blue.

Max Bain
Posts: 1461
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: Vertex colour and paintjobs [SOLVED]

Post by Max Bain » Tue, 8. Dec 20, 20:02

Hi,

I have a question. I want to give a ship paintmods but the problem is that the ships normal teture is already a vertex color. Its the Red Knight from my XR Ship Pack. Dont know the XR name, but its a split ship.

So now I have 2 vertex colors:

meshId10-color0
meshId10-color1

0 has only green (the green from your first post)
1 has only red

In game the ship is green now and adding paint jobs has no effect. Is something missing?

Would be cool if you can hep me :)
Last edited by Max Bain on Tue, 8. Dec 20, 20:40, edited 1 time in total.
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

User avatar
Axeface
Posts: 2943
Joined: Fri, 18. Nov 05, 00:41
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by Axeface » Tue, 8. Dec 20, 20:18

If you painted the whole ship the green from the 1st post then the games default paint schemes (empire menu) should be working? If the second channel is all pure red (FF0000) then paintmods should be working too, try making something black too in the 2nd channel (engine or greeble or something you dont want paintmods on), perhaps the presence of both colours is needed.
Also, the diffuse texture itself is red? Might be a good idea to make that greyscale instead - the vanilla x4 textures are all white/greyscale.

Edit: I just thought, could it be that the XR ship pack materials might need to be set up for paintmods? Ive only used x4 vanilla materials

Max Bain
Posts: 1461
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: Vertex colour and paintjobs [SOLVED]

Post by Max Bain » Tue, 8. Dec 20, 21:24

Axeface wrote:
Tue, 8. Dec 20, 20:18
Also, the diffuse texture itself is red? Might be a good idea to make that greyscale instead - the vanilla x4 textures are all white/greyscale.
Adding some black areas does not help.

Where can I see the diffuse texture?

When I go into the UV map I dont see any UV map or texture.
the material is completely empty (white ball). This might be the problem? Do I need one? I dont know how to import a diff.gz texture from X4 into blender -.-
Last edited by Max Bain on Tue, 8. Dec 20, 21:36, edited 1 time in total.
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

User avatar
Axeface
Posts: 2943
Joined: Fri, 18. Nov 05, 00:41
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by Axeface » Tue, 8. Dec 20, 21:35

The material would need to be edited in the xmls, I dont think what you see in blender matters at all, only the name of the components (its the name of the object that tells the game which material to use).

Max Bain
Posts: 1461
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: Vertex colour and paintjobs [SOLVED]

Post by Max Bain » Tue, 8. Dec 20, 21:37

Axeface wrote:
Tue, 8. Dec 20, 21:35
The material would need to be edited in the xmls, I dont think what you see in blender matters at all, only the name of the components (its the name of the object that tells the game which material to use).
No I think its the other way round, the materials in xmls dont matter. I have tried to edit textures many times in xml with no effect. Or what exactly do you mean with name of object defines name of material?
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

aurumgallente
Posts: 121
Joined: Sun, 14. Jun 20, 14:45
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by aurumgallente » Thu, 10. Dec 20, 03:45

He means it's not important what texture you will load in Blender, you need texture only because converter refuses to convert if it can't resolve path to the texture image. And for work with UV map if you need to do it. Diffuse texture is defined in material library.

Code: Select all

<property type="BitMap" name="diffuse_map" value="extensions\x2shippack\assets\textures\teladi16" />
I can change my texture at any time without any help of Blender or converter and texture will be changed in the game. If you tried to change textures with no effect it means you do something wrong. In Blender you can only specify collection of material and name of its collection. And vertex colors, of course.

Code: Select all

anim_mainXlod0Xp1Xparanid_01
this part should have material with name

Code: Select all

p1Xparanid_01
which means the game will search paranid_01 material in p1 collection.

Max Bain
Posts: 1461
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: Vertex colour and paintjobs [SOLVED]

Post by Max Bain » Fri, 11. Dec 20, 13:17

Thank you for your explanation.

I checked the texture name and the material library and the path and file exists. So the problem must be something else.

Maybe someone has the time to check the model for me? The model should be very simple to add paintjobs. It has only one main part where I want to add a paint job on the whole texture for:

part_mainXlod0XsplitXsp_hulls_01
part_mainXlod1XsplitXsp_hulls_01
part_mainXlod2XsplitXsp_hulls_01
part_mainXlod3XsplitXsp_hulls_01

https://www.dropbox.com/s/w0qcjebx4gxjv ... l.dae?dl=0
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

aurumgallente
Posts: 121
Joined: Sun, 14. Jun 20, 14:45
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by aurumgallente » Fri, 11. Dec 20, 14:59

Here is your .dae file. And here is a .blend file. I work in Blender 2.8 so backup everything before replacing. Model of the ship has dark red color in the first vertex color channel (it's not me, I added only second channel), it adds visible color to your ship, not the texture. In fact, texture can be white or gray but parts will remain red. Also keep an eye on names of parts and materials, Blender loves to add .002 and .003 to everything, converter will reject period in names, I cleaned it up.

I didn't check how it will look like in game when something has dark red in first channel and red in second one but painting will be visible after you will install one.
Spoiler
Show
Image
Here you can see the ship before I edited it. Dark red color in the single vertex channel "meshid10-color0", it is visible in the game. To add paintjobs I added second one and colored it in pure red in "Vertex Paint" mode (shift+k to paint hole mesh), it is selectable in the top left corner.
Last edited by aurumgallente on Fri, 11. Dec 20, 15:26, edited 2 times in total.

User avatar
Axeface
Posts: 2943
Joined: Fri, 18. Nov 05, 00:41
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by Axeface » Fri, 11. Dec 20, 15:03

The model only has 1 vertex channel and the red isnt even pure red? You need to add a second vertex channel to the lods and paint it pure red in the second channel.
https://i.imgur.com/QhU42vW.png

edit: Aurum got there first.

1st vertex channel should be painted BEFFD0 too (can add pure red in parts if you want the 2 colour setup like vanilla ships). You can leave it dark red if you want but it will tint paintmods that have any opacity. If it were me I would make the diffuse texture greyscale and paint the 1st channel all BEFFD0 green, and add stripes and shapes of red.

Max Bain
Posts: 1461
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: Vertex colour and paintjobs [SOLVED]

Post by Max Bain » Fri, 11. Dec 20, 17:21

Oh sorry guys. I uploaded the model before adding the paint job maps.

I did added red ff0000 on the sec map and the green from your first post on separate vertex map and tried that out. But that did not worked.

I will retry with aurums file and see if something is different.
Thx u both.

Edit: still in game there is no paint job visible on the ship :( (I used your dae file)
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

User avatar
Axeface
Posts: 2943
Joined: Fri, 18. Nov 05, 00:41
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by Axeface » Thu, 17. Dec 20, 12:35

Still not got this fixed Max Bain? If not it must be the material, did you check the materials file to see if there is any differences between your custom mat and the vanilla ones?
Its possible its hardcoded, I'm just not sure. If it is then you could change the ships material to a vanilla SV one and change the UVs.

Max Bain
Posts: 1461
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: Vertex colour and paintjobs [SOLVED]

Post by Max Bain » Thu, 17. Dec 20, 19:36

Axeface wrote:
Thu, 17. Dec 20, 12:35
Still not got this fixed Max Bain? If not it must be the material, did you check the materials file to see if there is any differences between your custom mat and the vanilla ones?
Its possible its hardcoded, I'm just not sure. If it is then you could change the ships material to a vanilla SV one and change the UVs.
No, I couldnt make the paintmods to work. I think it is the material, but I wasnt able to add a X4 split texture (they are all in .gz files) into the blender ship model. I also cant see the UV map in this model. Maybe something is broken with it.
I wasnt able to test the renaming of the nodes for texture changes yet because my PC has crashed. Hopefully its just the power suply, but I will see that when the new one arrived.
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

User avatar
Axeface
Posts: 2943
Joined: Fri, 18. Nov 05, 00:41
x4

Re: Vertex colour and paintjobs [SOLVED]

Post by Axeface » Thu, 17. Dec 20, 21:01

I made a quick vid showing how to change the vertex colours and how to make the split texture show up in blender (how its setup doesnt matter, its just to see it). Hope that helps.
https://youtu.be/V_KucItRMMc

PS, thats the SV split texture. Looks like it wont be much work to make the UV's play nicely with that model.

Post Reply

Return to “X4: Foundations - Scripts and Modding”