prerogative

Author Topic: Decal uv channel  (Read 2047 times)

lauris47

  • Jr. Member
  • **
  • Posts: 55
  • Karma: 2
  • laurynaslubys.com
    • View Profile
Decal uv channel
« on: May 05, 2021, 07:07:32 am »
Hi, I am learning about decals and how they work in Source.
Is it correct that via Wall Worm decals are extracted to meshes and then this decal is applied to it? While in Source, decal is embeded on the model, using the second UV channel?

When importing the map of CSGO, I can see that some models have this second UV channel, but all UVs are squeezed to the bottom left corner. Was this intended, under-implementation or something else that I do not understand?

What about round objects, like Silo's in De_Nuke, they have decals on top. When decal is converted from UV space to mesh, there is no way to wrap around that decal around the silo.

I might got some info wrong, but I guess it is clear what I want to do - use second uv channel for decals.

Any input appreciated.
Thanks.

Joris Ceoen

  • Global Moderator
  • Full Member
  • *****
  • Posts: 237
  • Karma: 27
  • WallWorm Ambassador
    • View Profile
Re: Decal uv channel
« Reply #1 on: May 07, 2021, 04:39:25 pm »
Hey!

I'm not sure what your specific issue is, but CS:GO itself has a material parameter that allows any kind of texture (known as $decaltexture) to be displayed on top of the $basetexture through, as you mentioned, a second UV-channel. This will really only be displayed correctly in-game (and not even in hammer in some cases, making models look black in the editor but correct when you're in the map). As far as I can tell, in 3DS Max when you import the model from either an .smd or .mdl the information for that second UV-channel is lost. Currently there exists no fix for that and I believe it is Valve only who can add support for this. I even think it was already requested several times, but I don't know if they are willing to provide this support  :-\

If you need to recompile an existing Valve model (from any game, really, since the second UV-channel info gets lost regardless upon import), you will be required to reconstruct a second UV-channel and see for yourself how it displays in the viewport inside 3DS Max. What you see is then what you'll get if you export your materials correctly. To do this, however, you will need to tag the 'Export FBX' flag in the WWMT settings for your object, else the second UV-channel will simply not export.

More detailed answer to your question can be given by Shawn, but hopefully this somewhat answered a few of your concerns! 

lauris47

  • Jr. Member
  • **
  • Posts: 55
  • Karma: 2
  • laurynaslubys.com
    • View Profile
Re: Decal uv channel
« Reply #2 on: May 10, 2021, 08:07:12 am »
Thanks. That actually answers the part that I wanted to hear - currently not possible, dependent on Valve.


wallworm

  • Administrator
  • Hero Member
  • *****
  • Posts: 3706
  • Karma: 103
  • Behind me?
    • View Profile
Re: Decal uv channel
« Reply #3 on: September 20, 2021, 10:36:52 pm »
Sorry it took so long for me to actually reply. Lauris, it is possible to export the decals. You must use UV channel 2 the decals, and you must export the model using the FBX option in the WWMT floater UI.

lauris47

  • Jr. Member
  • **
  • Posts: 55
  • Karma: 2
  • laurynaslubys.com
    • View Profile
Re: Decal uv channel
« Reply #4 on: May 25, 2022, 09:55:36 am »
Hi, some maps rely a lot on details, hence I tried to do this again. I couldn't

When I import whole map, secondary channel UVs are squeezed into one corner,
and when I import separately via Model Importer Wall Worm "Import MDL", it only has one channel.

In either case second channel is destroyed.

Any update on this?

wallworm

  • Administrator
  • Hero Member
  • *****
  • Posts: 3706
  • Karma: 103
  • Behind me?
    • View Profile
Re: Decal uv channel
« Reply #5 on: May 26, 2022, 05:56:52 pm »
You can export that channel, but it's not currently imported.

lauris47

  • Jr. Member
  • **
  • Posts: 55
  • Karma: 2
  • laurynaslubys.com
    • View Profile
Re: Decal uv channel
« Reply #6 on: May 30, 2022, 03:26:15 am »
Is it possible for you to do the update on WallWorm plugin?
I know you are probably busy with Autodesk and stuff.

There are probably other ways I can try to get this channel out, but it would be most comfortable via WallWorm.
I tried MilkShape, MESA for Maya, also Valve's Model Viewer . No luck. I will try HammUEr for Unreal now. There is also some Blender method, that I am not familiar with yet.

wallworm

  • Administrator
  • Hero Member
  • *****
  • Posts: 3706
  • Karma: 103
  • Behind me?
    • View Profile
Re: Decal uv channel
« Reply #7 on: May 31, 2022, 01:30:28 am »
It's on my list. I'll try to find time to do this.

lauris47

  • Jr. Member
  • **
  • Posts: 55
  • Karma: 2
  • laurynaslubys.com
    • View Profile
Re: Decal uv channel
« Reply #8 on: May 31, 2022, 02:47:09 am »
That would be great, thank you!

Joris Ceoen

  • Global Moderator
  • Full Member
  • *****
  • Posts: 237
  • Karma: 27
  • WallWorm Ambassador
    • View Profile
Re: Decal uv channel
« Reply #9 on: June 10, 2022, 11:36:59 am »
Is it possible for you to do the update on WallWorm plugin?
I know you are probably busy with Autodesk and stuff.

There are probably other ways I can try to get this channel out, but it would be most comfortable via WallWorm.
I tried MilkShape, MESA for Maya, also Valve's Model Viewer . No luck. I will try HammUEr for Unreal now. There is also some Blender method, that I am not familiar with yet.
I know it's been a while since you replied, but do I understand it correctly that you are still trying to get the original second UV-channel from official Valve models? I'm really not sure if it's possible. You could actually do an update that allows this, Shawn?

wallworm

  • Administrator
  • Hero Member
  • *****
  • Posts: 3706
  • Karma: 103
  • Behind me?
    • View Profile
Re: Decal uv channel
« Reply #10 on: June 10, 2022, 12:15:11 pm »
Yes, it's something I can add. It's just time. I am one of world's top MAXScript people, but not the best C++ people. The WW plugin for MDL Loading is all C++. It's now been a few years since I did any serious looking into that code. So it would take some time. I very much intend to add Morph, Animation and 2nd UV support ... but whether I will actually get to find the time for that is another issue. I've toyed with hiring someone to help update some of the C++ plugins, but finding someone knowledgeable about Source engine coding and also Max SDK is hard--and those I know are too busy right now to take up any side gigs.

lauris47

  • Jr. Member
  • **
  • Posts: 55
  • Karma: 2
  • laurynaslubys.com
    • View Profile
Re: Decal uv channel
« Reply #11 on: June 22, 2022, 04:27:35 am »
I just started doing c++, it is so complex and broad in comparison to c# (which I was doing work with, the last 7 years).

lauris47

  • Jr. Member
  • **
  • Posts: 55
  • Karma: 2
  • laurynaslubys.com
    • View Profile
Re: Decal uv channel
« Reply #12 on: July 26, 2022, 03:32:51 am »
Hey, did you have time looking into this?
I saw Wall Worm 5.1.41 was released, the update log is not yet updated.

Edit: Just found out you have Discord channel, the update log is there.

« Last Edit: July 26, 2022, 03:41:08 am by lauris47 »