Facepunch / sbox-issues

176 stars 12 forks source link

Trimsheet textures are not on hammer grid #1206

Closed VeeSaus closed 2 years ago

VeeSaus commented 2 years ago

What can't you do?

Trimsheet textures are not on hammer grid, making them useless. You will have to reduce the grid-size by quite a lot to hide the seams between the different trims, making the process very difficult, time consuming and tedious.

image

image

I had to reduce the grid size 3 times to get it aligned properly, and even that is not good enough for a lot of the trims

image

How would you like it to work?

In hla, they use trims that are on grid, making them both a lot more usable on more complicated meshwork, and significantly easier to work with.

image

image

What have you tried?

There is, of course, the pavement_trim_a_template model that you can convert to an editable mesh and use. This method is not compatible with Hammer’s toolset. As stated earlier, it is almost unusable with the fast texture tool. This method also forces you to use the model’s specific dimensions, making the textures considerably less flexible.

image

Also, converting the model makes the mesh use tris instead of quads.

image

QuackCola commented 2 years ago

Yea while that trim texture is nice it's a pain to get right without using the model. On another note I usually separate mesh components and dissolve some edges until I'm left with quads.

Jake-NSW commented 2 years ago

I agree, its a real pain to get working. Using a mesh to convert to editable mesh seems to be a cop out in my opinion. Should just be made to fit Source 2. The textures are really nice too

garrynewman commented 2 years ago

Agree, these things should all be made to work with Source 2's workflow

EzMeowFP commented 2 years ago

While I will probably split this texture and in the process realign some of the stuff. There is several issue to address here. First is the grid size, not everything can be a minimum size of 4 unit or more, so ultimately there will be instance where a small grid size will be necessary. Second is normal map accuracy for hard edges. Hard edges need split UV and at least 1 pixel separation; otherwise you end up trying to bake/read 2 different normal information onto the same pixel. Smooth edges can be merged but as soon as you you will move a vertex to a different position, you will have to keep the exact curvature or the normal will look wrong. The way to compensate for that is either support edge loops or weighted normal. (which I'm pretty sure will make people's life a living hell)

I had a look in HLA. Most instances where they use grid aligned texture with inaccurate normal (or even no normal map in some case) are areas where the player can't go near, covered by modesl, or saved with a dark or very moody lighting.

That said the best compromise I could think of is having the hard edges UV with a slight offset from the grid so people who don't care about the normal inaccuracy (or if it's used quite far from the playable area) can easily map it, but people who need a proper normal for the lighting will have to offset it slightly. (That's how "materials/trims/wall_concrete_low_a.vmat" was mapped)

Jake-NSW commented 2 years ago

https://youtu.be/CarefswACgs

EzMeowFP commented 2 years ago

the example isn't related with what I'm talking about, there is no baked angles here

VeeSaus commented 2 years ago

I feel that you are making this trimsheet more for models, rather then hammer meshwork. Trimsheets for hammer meshwork should in fact not even have soft normals baked onto the normal map for edges, since you can define soft normals in the editor. Having them baked into the normal map (in addition to creating a lot more issues) makes the sheet itself a lot less flexible.

Here is an example of a mesh using the trim texture with the soft normal baked onto it image

And here is the same mesh, with a different material using the editors soft normals image (Purple edges indicate soft edges) image

On this specific texture, soft normals are not baked onto the normal map image

But they achieve smooth edges through the use of the editors soft normals image

image

Yes, this means that you will have to create more edges onto the mesh, but that is a lot simpler and easier than having to deal with the current, off-grid solution. It is also more flexible, since you can define where you want smooth edges, and the extent of their “smoothness”

EzMeowFP commented 2 years ago

Yeah , that's what I meant. Every workflow is possible really, it's mostly down to what people prefer to work with, to me, both solution have their pro and con, if most people prefer to have flat normal and bevelling/adding support edge loop to every edges. It's fine with me (that's one of the way I mentioned in my previous post).

Out of curiosity, would you have the same texture screenshot of the normal map?

GunnarKafel commented 2 years ago

I feel like the Hammer workflow isn't possible right now since the textures are off grid, and the model to editable mesh solution feels really hacky compared to HLA Heres the normal map for that specific texture image

EzMeowFP commented 2 years ago

That's exactly why we are having the conversation here, to fix the issue on the existing, before more texture are created. Thanks for the texture. I'll do a pass on the texture, splitting the metal trim and tactile pavement onto their own texture at the same time (for physic material reason) And we'll see if people are happy with that.