koerismo / PBR-2-Source

A Python-powered gui for converting pbr materials into Source Engine-compatible materials.
GNU General Public License v3.0
29 stars 2 forks source link

feature request: automatic scaling #12

Closed Fennecai closed 1 month ago

Fennecai commented 2 months ago

in source engine, more often than not, a standard brush texture should be about 128 in-hammer units big.

however, most pbr textures are much higher resolution than the typical 512-sized source engine texture (which is again 128 hammer units)

i propose that there should be a tick-box for automatic scaling in the VMT via the $basetxturetransform param, and a drop-down for how many in-hammer units the texture should equate to, in powers of 2 up to 4096.

what the program would do is detect the image dimensions and then add the parameter to the vmt based on the user-selected multiplier in the dropdown.

https://developer.valvesoftware.com/wiki/$basetexture#.24basetexturetransform

alternatively; the program could resize the images themselves rather than calculate the $basetexturetransform param. this would reduce quality slightly, however.

koerismo commented 1 month ago

Explicit resizing has been added - The basetexture output should be resized to half-width (as defined in the UI) to allow better fitting in hammer. As for $basetexturetransform handling, I'm afraid that that is not within the scope of this program.