GoldSource Model Texture UV Shift Fix

A Tutorial for GoldSrc Engine

1. Introduction:

An unfortunate side effect of compiling & recompiling GoldSrc models is that the model UVs get slightly shifted out of scale when compiled with studiomdl.exe. This can cause texture alignment problems on your newly made model or worse on an edited/recompiled model. 

1. UPDATE:  There is a new Studiomdl.exe that will not shift model UV's on compile and can be found here:

https://gamebanana.com/tools/6236

As of this new compiler, you will no longer need to shift for new models right out of the 3D editor.  However, this tutorial will still be useful for existing IMPORTED and decompiled older models that suffered shifting.

Furthermore, if you are still using mdldec.exe, ditch it for the latest version of Crowbar which supports goldsrc decompiling:
https://steamcommunity.com/groups/CrowbarTool

 Before attempting these fixes be sure to make a backup copy of your model or SMD.

2. Method For 3DSMAX:


1) For your newly created model put a unwrap UVW modifier on it. Go to face mode, CMD-A to select all faces, then put into script box:

$.modifiers[#unwrap_uvw].unwrap2.ScaleSelectedXY 1.007 1.007 [0,1,0]
then hit enter to scale your UV's. In your viewport it may look slightly off but the nature of this fix is compensating for the downscale that happens upon compiling the model. Export your model.


For IMPORTED models, we have the challenge of fixing UV's on geometry with explicit normals. 3DSMAX tends to break these normals on editing geometry & other modifiers. In addition imported SMD's from decompiled SMD's tend to have worse shifting so a higher compensation number than 1.007 may be needed.



1) Select the editable mesh, add a "edit normals" modifier to save a snapshot of the models normals

2) then select the editable mesh again, then put your UVW unwrap modifier (you will notice the smoothing breaks, but when done the edit normals modifier above fixes it due to stack hierarchy).

3) Proceed with the shifting method as above but this time I upped the number to 1.012 instead of 1.007 (because this particular model I had was badly shifted). This code will look like this:

$.modifiers[#unwrap_uvw].unwrap2.ScaleSelectedXY 1.012 1.012 [0,1,0]

4)Now with the stack in this order select the skin and go to export and be sure to make explicitly set.



As you can see here the fix is noticeable.

3. Method For Blender:

1)Go into Edit mode and open UVs view

2)Open display tab and check the "cursor location" & "normalized" boxes

3)Set the cursor location to X 0.00 Y 1.0

4)Make sure your pivot mode is set to cursor, then press "S" to scale and type in 1.007 and hit enter




4. Method For MilkShape3D



1)Select all groups, go into texture editor (Cmd-T) and press scale button.

2)Set factor:

1.007 1.007
press the S button to commit scale.

3)Repeat the same for any other textures.

Posts

  • Ring-A-Ding Rampage avatar
    Ring-A-Ding Rampage username pic Joined 7y ago
    In Extremis
    4,502 points Ranked 1143rd
    74 medals 9 legendary 20 rare
    • Submitted 60 Sprites Medal icon
    • Thanked 500 submitters Medal icon
    • 15+ Entries! GameBanana’s Christmas Giveaway 2015 Medal icon
    • Submitted 100 Skins Medal icon
    • Reached 100 subscribers Medal icon
    • 15+ Entries! GameBanana’s Christmas Giveaway 2016 Medal icon
    Ring-A-Ding Rampage avatar
    Ring-A-Ding Rampage
    (づ。◕‿‿◕。)づ
    10mo
    This is a great tut, how did you hit on that number 1.007?

    I am looking to recompile a few old 1.5 skins to 1.6 and arrived at this tut while looking for modern alternatives to old tools.

    What would you suggest apart from the other mdldec.exe?
    I'mma deck you in the schnoz. avatar
    Mantra
    I'mma deck you in the schnoz.
  • Ezequiel-TM avatar
    Ezequiel-TM username pic Joined 4y ago
    MUGEN Manager HL Manager SC Manager CS1.6 Manager CS:CZ Manager
    Life Tree Flag Affiliation: Life Tree
    545 points Ranked 9537th
    46 medals 4 legendary 13 rare
    • Submitted 100 Skins Medal icon
    • 30 submissions featured Medal icon
    • 2017 Top Contributor Medal icon
    • Returned 5000 times Medal icon
    • Submitted 50 Skins Medal icon
    • Returned 1000 times Medal icon
    Ezequiel-TM avatar
    Ezequiel-TM
    Life Tree Flag
    Affiliation
    Life Tree
    2y
    Finally someone is listening to my prayers.
    I needed a tutorial like this.

    10

    • Funny x 1
    • Agree x 1
    • Win x 1
    • Correct x 1
    Synonym of quality avatar
    Mantra
    Synonym of quality
  • The303 avatar
    The303 Joined 2y ago
    Offline
    2y
    Posted by CS PRO

    The best tutorial for UVs ! Thanks alot :D

    You're welcome!

    I hope the CS community takes notice since there is probably the highest amount of custom modellers for GoldSrc.
    REE3
  • CS PRO avatar
    CS PRO username pic Joined 5y ago
    HL Manager CS:CZ Manager
    wish me luck
    CS:GO Ports Flag Affiliation: CS:GO Ports
    10,753 points Ranked 446th
    38 medals 4 legendary 6 rare
    • Submitted 100 Skins Medal icon
    • 30 submissions featured Medal icon
    • Reached 100 subscribers Medal icon
    • 2017 Top Contributor Medal icon
    • Returned 1000 times Medal icon
    • 10 submissions featured Medal icon
    CS PRO avatar
    CS PRO
    CS:GO Ports Flag
    Affiliation
    CS:GO Ports
    2y
    The best tutorial for UVs ! Thanks alot :D

    10

    Still Alive.. avatar
    Mantra
    Still Alive..
  • D-Wanderer avatar
    D-Wanderer username pic Joined 4y ago
    Gone playing..
    1,655 points Ranked 3183rd
    25 medals 2 legendary 7 rare
    • 15+ Entries! GameBanana’s Christmas Giveaway 2015 Medal icon
    • 15+ Entries! GameBanana’s Christmas Giveaway 2016 Medal icon
    • GameBanana’s Christmas Giveaway 2015 Day Twelve Winner! Medal icon
    • GameBanana’s Christmas Giveaway 2015 Day Fourteen Winner! Medal icon
    • Returned 1000 times Medal icon
    • Returned 1000 times Medal icon
    2y
    Absolutely hate when that happens.

    10

    If only I wasn't so lazy.. avatar
    Mantra
    If only I wasn't so lazy..

Embed

Share banner
Image URL:
HTML embed code:
BB embed code:
Markdown embed code:

Credits

Original Authors
The303
The303 Joined 2y ago
Offline

Submitter

The303 avatar
The303 Joined 2y ago
Offline

The303
Creator
Sign up to access this!
Sign up to access this!
Sign up to access this!
  • Paypal Donate

Game

Sign up to access this!

Category

Details

Difficulty Level
Intermediate

Attributes

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • Share on Google+

Stats

  • 1,842 Views
  • 8 Posts
  • 2y Submitted
  • 9mo Modified

Scores

91 bScore
10 Rating

4 voters

Sign up to access this!

More from Submitter

More Modelling Tutorials

bcp.crwdcntrl.net tracking pixel