Facepunch / sbox-issues

173 stars 11 forks source link

Weapon Camos #5810

Open RickGreeve opened 2 months ago

RickGreeve commented 2 months ago

For?

S&Box

What can't you do?

early on during the development of weapons I spoke with @trwb about guns having a 2nd UV channel for camos. Call of Duty does this a lot (not sure about current day, but I remember making 2nd UV channels on guns for CoD WWII). Could be a great addition for customization in HC1 and any other similar first person shooter in the future.

I understand if something like this is at the back of the priority list, but if there is time it could be worth a discussion. And of course I'm happy to provide any art related assets needed (2nd UV channels, camos etc.) and work together on anything else

How would you like it to work?

the shader would need a couple things:

  1. main thing is being able to access the 2nd UV channel which I believe Compex already does.
  2. a mask input with a Black and White or RGB map to mask of where the camo actually goes (RGB would allow us to have multiple wear states like CS has for example, altough I believe they handle it differently).
  3. a input for camo's themselves (color, roughness and metalness).
  4. maybe an input for how many camo options so we can have multiple options on the same gun.

What have you tried?

not a lot, enabling secondary Uv in the shader doesn't have many options besides AO

Additional context

No response

RickGreeve commented 2 months ago

I am realising that making a 2nd UV channel for every material on the Viewmodel and every Worldmodel and LOD would be way to much manual labour. Thankfull @bakscratch pointed out to me that we have triplanar projection working so we can use that instead. Then it's just a matter of making the masks and some camo options and we're good to go without a second UV channel as triplanar does everything I would require of a 2nd UV channel. For more complex skins I can make something bespoke instead and use material sets instead so that works out too.

I'll see if I make something of decent quality with what Louie provided me with sofar.

bakscratch commented 2 months ago

https://github.com/user-attachments/assets/43ed1973-85e1-43d5-aa6b-96d84b9caeed

Some of the progress

bakscratch commented 2 months ago

image

Pushed with a test material

RickGreeve commented 1 month ago

@trwb We have been making some progress with this over hackweek

using a tileble made in Designer (screenshots are from sbox) image (7)

using tintable tilebles image (9) image (8)

graph and the first tiling texture from above weapon_camo_spraynet_color image (10)

I don't know if I can find the time to work on this much after hackweek. I think documentation and finishing the LODs for the sniper and scope take priority and then I really should finish off the rest of those grenades we need in Nicked I think, by that point its probably a good idea to start working on the missile launcher before doing camo's.

But some good progress made over hackweek, there are some kinks i'm working out with louie but I am confident we are getting some good results with this workflow!

trwb commented 1 month ago

Sounds good to me. Is there plans to refine the scratch mask for the camos? Have you tried some softer falloff in some areas so it doesn't look such a sharp transition?

RickGreeve commented 1 month ago

@trwb Yeah still a lot of back and forth on the mask front, I'll make sure to ask for feedback once I am at a good point with the entire gun and post ref as well, but that might be a while from now