Jump to content


How to camouflage map with final color.


  • Please log in to reply
20 replies to this topic

Coffee_ #1 Posted Sep 05 2017 - 23:23

    Sergeant

  • Players
  • 42618 battles
  • 247
  • Member since:
    06-17-2011

So... 

The camouflage maps are a strange color compared to how they render in the game.

I was wondering...

Does anyone know how to mix them with the AM map to get the correct colors?

I know that the AO maps alpha channel is the mask for the camouflage map.. but getting them to be the correct color.. I have no idea..
I'm using a OpenGL shader program to do the rendering and figuring out how this camouflage works will add a nice feature to my Tank Exporter program.

Thanks for reading :)

 



wookiee_monster #2 Posted Sep 06 2017 - 02:27

    Sergeant

  • Players
  • 19258 battles
  • 248
  • Member since:
    09-01-2011

Thisfile will give you an idea of what colours a camo pattern will be capable of displaying. Just unpack it and rename it then drag it to your res_mods directory, in the appropriate nation's camo folder and you will get something like this...

 

 

Only a handful of patterns use the alpha channel as a fourth colour. The AO map's alpha is just a mask and doesn't affect the actual colour (except maybe make it look a bit faded).

 

Awesome to hear you're working on your exporter again!



Coffee_ #3 Posted Sep 06 2017 - 04:48

    Sergeant

  • Players
  • 42618 battles
  • 247
  • Member since:
    06-17-2011

Hey Wookie :)
I looked at that file.. A color chart?.

I was poking around and in customization.xml (one for each nation) there are entries like this:
 

Spoiler

There are four color rows... 

I tried a few things like...

Cout = co * camocolor.r

Cout += c1 * camocolor.g

Cout += c2 * camocolor.b

Cout += c3 * camocolor.a

It doesn't give me the correct colors..
I tried reversing the order from rgba to abgr... that didn't work either.
I tried reversing the color in the rows.. co to c3 but that doesn't work.
You know rextimmy had this all figured out..I remember reading the code...  it was in one of his shaders that shipped with his Tank Viewer program.. rextimmy was a smart dude.. to bad he left and never looked back.. Last thing I heard was he was very upset over the lack of donations.. Not sure if it's true... Anyway I can't find a working link to his Tank Viewer program anywhere.

So.. 

If the colors are indices in to a color table.. that's not hard to do.. I wonder.. maybe there IS a color texture.. or more. could be as simple as (4x) 1 x 256 color textures or .. .(1x) 4 x 256 color texture...
I guess its time to dig some more...

Thanks for the help Wookie :)

EDIT: I can't find any color textures that look like they are used as lookup.

I'm assuming the color in camouflage texture is used to mix the four colors c0 to c3 together.. So far I haven't found the proper way to do it.

 

 


Edited by Coffee_, Sep 06 2017 - 05:43.


wookiee_monster #4 Posted Sep 06 2017 - 08:00

    Sergeant

  • Players
  • 19258 battles
  • 248
  • Member since:
    09-01-2011

Oh, I thought you were trying to make a camo pattern. So yeah that customization file, hmmm, whenever I try and mod it, WoT crashes so I leave it alone. Also, the problem I have with editing the customization.xml file is that you can't really upload it for anyone else to use because they have to accept all of your mods or none whereas if I just make a change to the camo files themselves, the colours might not be perfect but at least people can pick and choose which mods they want to apply.

 

But anyway, if you ignore the 4th value and just treat them as RGB not RGBA then the RGB values look about right. Maybe BigWorld can't recognize RGB and so they have to use RGBA but the A is just discarded. I dunno :/

 

Yeah RexTimmy's viewer was awesome, I used it to make a custom 4-colour MERDC camo scheme. Shame he left but I think he got too busy with work to put in the time to develop it. It got to the point where it would break with every patch. I'm sure you can appreciate. :)

 

It would be nice to think you couild make a little money doing mods but there's a few different factors that make it hard. One is the fact that mods are only client-side. If people knew that these mods would be seen by everyone else in the game then we'd be rolling in it. I am certain that some members of this community would pay top dollar for the ugliest anime skin you can imagine if they knew that everone in the game would have to look at it. Of course it would kill the game but they wouldn't care. Sorry i'm ranting a bit.

 

Anyway, good luck and keep us posted with your progress :)



Coffee_ #5 Posted Sep 06 2017 - 08:32

    Sergeant

  • Players
  • 42618 battles
  • 247
  • Member since:
    06-17-2011

Yeah.. I was fixing my tank editor program every week or two.. I stopped working on it because of that and pressing issues in the real world.

 

I don't plan on editing the customization.xml ...  I  just need to pull values from it. 

Anyway... I managed to find some old code i had stored away that Rextimmy wrote.. I only had some shader code and its very close to what I was tying to do.
I'll give Rextimmy credit for it.. he figured it out first :)

 

Here is the code to create the proper colors from the camouflage DDS file..
Its not compete code but any one that knows GLSL can finish this in a heart beat..
 

 

 

Here is an image of the camo working correctly..
There are still things to get programmed.. like UVs.. looking up things and... not putting camo on the chassis ! lol

http://tnmshouse.com...cace62260e0.png



Coffee_ #6 Posted Sep 12 2017 - 15:53

    Sergeant

  • Players
  • 42618 battles
  • 247
  • Member since:
    06-17-2011

I posted a link to the shader I'm using to render a tank in real time in the above post.
It does a pretty good job at getting the camouflage looking correct as well as metal.

It still needs a little work but I'm now busy trying to add the real tracks to the exporter in stead of the rubber band tracks.

Here is a pic of the shader in action.

http://tnmshouse.com...7a9c7b98a5a.jpg

 

There is one issue I'm having... the camouflage on the guns seems to be wrong on some of the models.
Some tanks have no information about UV scaling or shift in the XML files regarding the guns... 
It's not a game breaker as the tanks still look very good in Tank Exporter.



wookiee_monster #7 Posted Sep 13 2017 - 14:42

    Sergeant

  • Players
  • 19258 battles
  • 248
  • Member since:
    09-01-2011

View PostCoffee_, on Sep 12 2017 - 15:53, said:

I posted a link to the shader I'm using to render a tank in real time in the above post.
It does a pretty good job at getting the camouflage looking correct as well as metal.

It still needs a little work but I'm now busy trying to add the real tracks to the exporter in stead of the rubber band tracks.

Here is a pic of the shader in action.

http://tnmshouse.com...7a9c7b98a5a.jpg

 

There is one issue I'm having... the camouflage on the guns seems to be wrong on some of the models.
Some tanks have no information about UV scaling or shift in the XML files regarding the guns... 
It's not a game breaker as the tanks still look very good in Tank Exporter.

 

I downloaded the exporter from your github page (hope that's OK) and I had a problem when installing (missing DLL) and then I try exporting it crashes. Apart from that It looks really promising, especially as I thought you had given up working on the exporter. It seems to only have thew option to export as FBX at the moment not WG's format, are you going to add the ability to export .visual, .primitive etc? If I could make a request. It would be great if I could export all the modules as one combined model. It would be easier to take into painter that way. Anyway NICE!

 

Also, I noticed in Swizzler that whn you make a RGB normal map you are able to retain the height information which I don't think I was able to do before when making them manually so thanks for that :)



Desyatnik_Pansy_NA #8 Posted Sep 13 2017 - 18:47

    Sergeant

  • -Players-
  • 20 battles
  • 115
  • Member since:
    10-05-2016

View Postwookie_monster, on Sep 06 2017 - 08:00, said:

Oh, I thought you were trying to make a camo pattern. So yeah that customization file, hmmm, whenever I try and mod it, WoT crashes so I leave it alone.

 

Only the US and USSR Ones should cause crashes, which is to do with the Panther M10 and T-55A Lines respectively. You can edit them out (change it from "<G78_Panther_M10>5 5 0.2 0.22</G78_Panther_M10>" to "<!--<G78_Panther_M10>5 5 0.2 0.22</G78_Panther_M10>-->&quot;), though it screws up the camo scaling for those vehicles in particular of course, but it means no more crashing. For me that's a willing price to edit them, though I won't of course upload that stuff anyway.



Coffee_ #9 Posted Sep 15 2017 - 01:46

    Sergeant

  • Players
  • 42618 battles
  • 247
  • Member since:
    06-17-2011

View Postwookie_monster, on Sep 13 2017 - 08:42, said:

 

I downloaded the exporter from your github page (hope that's OK) and I had a problem when installing (missing DLL) and then I try exporting it crashes. Apart from that It looks really promising, especially as I thought you had given up working on the exporter. It seems to only have thew option to export as FBX at the moment not WG's format, are you going to add the ability to export .visual, .primitive etc? If I could make a request. It would be great if I could export all the modules as one combined model. It would be easier to take into painter that way. Anyway NICE!

 

Also, I noticed in Swizzler that whn you make a RGB normal map you are able to retain the height information which I don't think I was able to do before when making them manually so thanks for that :)

EKK!! Which DLL is missing???

I wonder if its the FBX.. I need to know because I have a lot of stuff installed that the exporter might be depending on and though it installs and runs HERE.. it may not THERE.

Glad you like it so far.. I'm still working on  it.. Trying to get the REAL tracks to draw correctly... I'm having all kinds a problems and will post about it shortly in a new thread.

Swizzler is sorta cool....

You can swap the G and Alpha channels using the reassignment functions if the converted normal map looks backwards.. . You can change this using the swizzler function. To shut of a channel altogether, double click on its name..  Red, Blue, Green or Alpha



wookiee_monster #10 Posted Sep 15 2017 - 12:16

    Sergeant

  • Players
  • 19258 battles
  • 248
  • Member since:
    09-01-2011

I tried re-installing and didit get any errors. It still crashed when I tried to export though.

 

Here's the crash message if it helps

 

Block Quote

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.FileLoadException: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
   at Tank_Exporter.modFBX.export_fbx()
   at Tank_Exporter.frmFBX.Start_Export_btn_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2110.0 built by: NET47REL1LAST
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
!_Tank Exporter
    Assembly Version: 1.0.0.3
    Win32 Version: 1.0.0.3
    CodeBase: file:///C:/Program%20Files%20(x86)/Coffee_/Tank%20Exporter/!_Tank%20Exporter.exe
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 10.0.0.0
    Win32 Version: 14.7.2053.0 built by: NET47REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2110.0 built by: NET47REL1LAST
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2106.0 built by: NET47REL1LAST
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2106.0 built by: NET47REL1LAST
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2053.0 built by: NET47REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2053.0 built by: NET47REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2102.0 built by: NET47REL1LAST
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Runtime.Remoting
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2114.0 built by: NET47REL1LAST
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
Ionic.Zip
    Assembly Version: 1.9.1.8
    Win32 Version: 1.9.1.8
    CodeBase: file:///C:/Program%20Files%20(x86)/Coffee_/Tank%20Exporter/Ionic.Zip.DLL
----------------------------------------
System.Data
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2102.0 built by: NET47REL1LAST
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
Tao.DevIl
    Assembly Version: 1.6.8.3
    Win32 Version: 1.6.8.3
    CodeBase: file:///C:/Program%20Files%20(x86)/Coffee_/Tank%20Exporter/Tao.DevIl.DLL
----------------------------------------
Tao.Platform.Windows
    Assembly Version: 1.0.0.5
    Win32 Version: 1.0.0.5
    CodeBase: file:///C:/Program%20Files%20(x86)/Coffee_/Tank%20Exporter/Tao.Platform.Windows.DLL
----------------------------------------
Tao.FreeGlut
    Assembly Version: 2.4.0.2
    Win32 Version: 2.4.0.2
    CodeBase: file:///C:/Program%20Files%20(x86)/Coffee_/Tank%20Exporter/Tao.FreeGlut.DLL
----------------------------------------
Tao.OpenGl
    Assembly Version: 2.1.0.12
    Win32 Version: 2.1.0.12
    CodeBase: file:///C:/Program%20Files%20(x86)/Coffee_/Tank%20Exporter/Tao.OpenGl.DLL
----------------------------------------
System.Numerics
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2053.0 built by: NET47REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
System.Data.DataSetExtensions
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2053.0 built by: NET47REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Data.DataSetExtensions/v4.0_4.0.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll
----------------------------------------
System.Xml.Linq
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2053.0 built by: NET47REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

 

 

 



Milkym4n #11 Posted Sep 15 2017 - 12:21

    Staff sergeant

  • Players
  • 37 battles
  • 373
  • Member since:
    01-13-2014

I'll add my report as well, might help.

 

Spoiler

 



Coffee_ #12 Posted Sep 15 2017 - 18:20

    Sergeant

  • Players
  • 42618 battles
  • 247
  • Member since:
    06-17-2011

OK... Try version 4... EDIT.. I forgot to add the new shaders and button textures to the build list.. It should run OK now.
What is happening is the FBXSDK.DLL is a DLL I got from someone else.. (Sorta figured this might be the problem .dll) Its a wrapper for FBX for the .NET language.
Its written for use in old 2.0 of .NET.. I'm using 4.0. The newest version of .NET is 4.7... My version of Visual Studio does not support it but .NET 4.0 is very common now.
Microsoft in its not so wise wisdom removed OpenGL and many do not support the language.

AutoDesk does not... so in order to use FBX a "wrapper" has to be written to pass function calls to .NET. (if that makes sense?)
It's a shame because tho .NET is not quite AS fast as C++, It is easy to use and regardless of programming in VB.net or C#, the code compiles to exactly the same .exe.
 

EDIT: Thanks for the feed back guys.. With out it, I can NOT make this a better tool :)


Edited by Coffee_, Sep 15 2017 - 20:14.


Coffee_ #13 Posted Sep 15 2017 - 20:15

    Sergeant

  • Players
  • 42618 battles
  • 247
  • Member since:
    06-17-2011

Try this link.. 
https://github.com/m...xporter_006.msi

 

Here is a pic of where I am with the project...

Spoiler

 

 


Edited by Coffee_, Sep 18 2017 - 09:02.


Coffee_ #14 Posted Sep 15 2017 - 20:32

    Sergeant

  • Players
  • 42618 battles
  • 247
  • Member since:
    06-17-2011

Here is another pic...

Spoiler

 


Edited by Coffee_, Sep 15 2017 - 20:34.


Coffee_ #15 Posted Sep 15 2017 - 21:10

    Sergeant

  • Players
  • 42618 battles
  • 247
  • Member since:
    06-17-2011

I should explain a few things... 

0. This program accesses the Dev API online site.. It needs data from there as well as the .PKG files
1. This was originally written for creating the short file version of the tanks used in Terra. The format is binary, compact and fast to load.

2. If you go to the File menu ----> load .. this loads the list of tanks I'm using with Terra. You will see that it highlights a bunch of tanks in the tier 8-10 groups.

3. There are a few short cut keys.. "L" shows the light positions.. "F3" will orbit one of the lights around the model. "N" shows the surface normals. Its a debug tool. There are 2 modes.. summed and by vertex.

4. You can turn on and off the visibility of parts of the tank.. On the menu bar there are 4 letters.. C H T G.. click one to hide/show that part.
5. Right clicking a name on the tank list is how you LOAD or EXPORT a tank.
6. The format for the FBX is 2009 and wont work with Blender.. BUT.. you can get AutoDesk's FBX converter for free to convert it to a newer version or a OBJ file.
7. You can look at and edit the shader programs.. BE CAREFUL! Messing up a shader can force you to download and install the app again.

8. If you set the path to the 'CURRENT' res_mods folder, the app will look there for tank skins and use them if they exist when the tank is loaded.

9. The camouflage has one or two extra patterns that are award or specials.. Other than that, it works the same as the game.



Milkym4n #16 Posted Sep 15 2017 - 21:15

    Staff sergeant

  • Players
  • 37 battles
  • 373
  • Member since:
    01-13-2014

The exporter works now, thank you very much!

 

While exploring the latest version there are a few things I noticed.

 

Spoiler

 

Hope this is helpful feedback. :)



Coffee_ #17 Posted Sep 16 2017 - 03:14

    Sergeant

  • Players
  • 42618 battles
  • 247
  • Member since:
    06-17-2011

Thanks.. I'll need to disable the list so a tank cant be loaded if one is in the process of loading.

I'll look in to the SD camo issue.. Not sure whats going on there yet...
I'll check the czech tanks.. Not sure whats up with that either but i'll check in to it.

 



Coffee_ #18 Posted Sep 17 2017 - 19:12

    Sergeant

  • Players
  • 42618 battles
  • 247
  • Member since:
    06-17-2011

I need an image of the Czech  as it looks in the garage as well for reference.. I don't have it and can't camo in preview mode.

 

I think I know how to fix that.. I can use the alpha channel of the mixed texture X the mask value to get it working correctly.. EDIT: Doesn't work.. It trashes the camouflage mix on many tanks.
I have most everything fixed but the camouflaged tanks... that's an easy fix.

I'm having a bit of an issue with the metal refection amount. some tanks seem to have a lot brighter metal reflecting in the game but my app is constant.
I looked at the values in the .visual files and the are the same... like the T-92 has bright metal but the Karnvagn has much less refection to the metal.. Its not a show stopper but it'd be nice to have them exactly the same.


I found this : GMM Map Info It was very useful in getting the detail texture worked in to the final specular mix. Now if I can figure out this metal issue.. I searched.. I didn't find anything. Maybe some one info some where??

I'm not worried about the missing tanks yet.. I have to find a good method to deal with the ones that are in the shared content packages.

How it works now is I have an array that is 10 in size.. one for each tier... in each of these I store the package info. There is no tier information in the shared packages so I will need to do coding to look up what tier they are in their matching .XML in the scripts package. After, I can add them to the list and keep track of where their data is located in the packages.
 

I should be be updating this later today once I get the transparent camo working and the fix with the precamouflaged tanks..

 


Edited by Coffee_, Sep 23 2017 - 13:43.


Coffee_ #19 Posted Sep 18 2017 - 01:39

    Sergeant

  • Players
  • 42618 battles
  • 247
  • Member since:
    06-17-2011

Uploaded version 6 to GitHub.

The SD tanks are too dark.. It's a thing with the shader I need to work on. I just wanted to get this version out for more testing.

I added a control for setting ambient. specular and total level.

 


Edited by Coffee_, Sep 18 2017 - 09:02.


Coffee_ #20 Posted Oct 05 2017 - 01:11

    Sergeant

  • Players
  • 42618 battles
  • 247
  • Member since:
    06-17-2011

I have been working on this steadily..
Tank Exporter is at version 12.
It now can view textures, plot the UVs and save the uv for an overlay for painting.

It loads the BSP2 and its Tree and is can be view.

I change the UI a lot.. It looks much better.
It now can import the FBX but can not save in .primitive yet.

You can get the latest version and my other tools here:
https://github.com/mikeoverbay






1 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users