The Game Modding Community - Since 2001

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

  • 5mo
    Ring-A-Ding Rampage avatar
    Ring-A-Ding Rampage username pic Joined 7y ago
    In Continuum
    2,730 points Ranked 1790th
    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
    (づ。◕‿‿◕。)づ
    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.
  • 1y
    Ezequiel-TM avatar
    Ezequiel-TM username pic Joined 4y ago
    MUGEN Manager HL Manager SC Manager CS1.6 Manager
    you see
    ?
    Life Tree Flag Affiliation: Life Tree
    4,891 points Ranked 1009th
    45 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
    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
    say what you want, I'm crazy! avatar
    Mantra
    say what you want, I'm crazy!
  • 1y
    The303 avatar
    The303 Joined 1y ago
    Offline
    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
  • 1y
    CS PRO avatar
    CS PRO username pic Joined 4y ago
    HL Manager CS:CZ Manager
    Catch Me L8r
    CS:GO Ports Flag Affiliation: CS:GO Ports
    10,853 points Ranked 424th
    37 medals 4 legendary 5 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
    The best tutorial for UVs ! Thanks alot :D

    10

    Still Alive.. avatar
    Mantra
    Still Alive..
  • 1y
    D-Wanderer avatar
    D-Wanderer username pic Joined 4y ago
    Back tomorrow?
    181 points Ranked 20332nd
    23 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
    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 1y ago
Offline

Submitter

The303 avatar
The303 Joined 1y ago
Offline

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

Category

Details

Difficulty Level
Intermediate Difficulty

Share

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

Stats

  • 1,456 Views
  • 8 Posts
  • 1y Submitted
  • 4mo Modified

Scores

91 bScore
10 Rating

4 voters

Sign up to access this!

SEX! Ok, we got your attention. Mascot

GameBanana is one of the oldest mod sites on the net. Sign up and maximize your browsing experience.

  • Subscribe: Get notified of new submissions like this.
  • Say Thanks: Show your appreciation - send modders points.
  • Post: Give modders your thoughts on their work.
  • Vote: Help your favorite modders win monthly awards.
  • Rate: Rate mods and help them stand out.
  • Flag: Alert moderators and warn members of problems with mods.
  • Watch: Get notified when mods are updated.

Sound fun? Sign up now!

Already a Bananite? Login

bcp.crwdcntrl.net tracking pixel