Difference between revisions of "Fixing facial texture on decompiled human models"
(New page: This tutorial has been ripped from the steampowered forums to be kept arcived. It was written by Wunderboy. The problem comes from the fact that when Cannonfodder's decompiler creates th...) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | This tutorial has been ripped from the steampowered forums to be kept | + | This tutorial has been ripped from the steampowered forums to be kept archived. |
It was written by Wunderboy. | It was written by Wunderboy. | ||
+ | [[Image:Problemfk7.jpg]] | ||
The problem comes from the fact that when Cannonfodder's decompiler creates the UV map, instead of keeping the values in the range 0 to 1, it moves the vertical, V, axis down into the -1 to 0 range. Effectively this makes your UV map appear below the normal UV mapping space. | The problem comes from the fact that when Cannonfodder's decompiler creates the UV map, instead of keeping the values in the range 0 to 1, it moves the vertical, V, axis down into the -1 to 0 range. Effectively this makes your UV map appear below the normal UV mapping space. | ||
Line 13: | Line 14: | ||
Now, normally in Source a texture will tile vertically and horizontally so this isn't too much of an issue. The face texture would be repeated vertically and line up with the misplaced UV so everything would appear normal. | Now, normally in Source a texture will tile vertically and horizontally so this isn't too much of an issue. The face texture would be repeated vertically and line up with the misplaced UV so everything would appear normal. | ||
− | However, if a texture has it's S and T clamp flags set, instead of tiling, it will repeat the edge pixels meaning anything not within the | + | However, if a texture has it's S and T clamp flags set, instead of tiling, it will repeat the edge pixels meaning anything not within the center 0 to 1 UV range gets the striped texture problem. |
The picture below explains what I mean: | The picture below explains what I mean: | ||
Line 19: | Line 20: | ||
[[Image:Clampedvsnonclampedgd3.jpg]] | [[Image:Clampedvsnonclampedgd3.jpg]] | ||
− | As you can see with a clamped texture and an out of bounds UV map your mesh gets covered with the repeated edge pixels a.k.a your "candy cane" | + | As you can see with a clamped texture and an out of bounds UV map your mesh gets covered with the repeated edge pixels a.k.a your "candy cane" problem. |
While removing the S and T clamp flags on the texture is a quick solution the proper way to fix it would be to move the UV map back up into the position it's meant to be in. | While removing the S and T clamp flags on the texture is a quick solution the proper way to fix it would be to move the UV map back up into the position it's meant to be in. | ||
Line 28: | Line 29: | ||
Hope that helps explain it! | Hope that helps explain it! | ||
+ | |||
+ | [[Category:Miscellaneous_Tutorials]] |
Latest revision as of 04:16, 3 May 2008
This tutorial has been ripped from the steampowered forums to be kept archived. It was written by Wunderboy.
The problem comes from the fact that when Cannonfodder's decompiler creates the UV map, instead of keeping the values in the range 0 to 1, it moves the vertical, V, axis down into the -1 to 0 range. Effectively this makes your UV map appear below the normal UV mapping space.
The diagram from 3DS Max shows what I mean:
The UV map should be within the blue bordered square as show on the right. The left shows what CF's importer does, it moves it down below the square.
Now, normally in Source a texture will tile vertically and horizontally so this isn't too much of an issue. The face texture would be repeated vertically and line up with the misplaced UV so everything would appear normal.
However, if a texture has it's S and T clamp flags set, instead of tiling, it will repeat the edge pixels meaning anything not within the center 0 to 1 UV range gets the striped texture problem.
The picture below explains what I mean:
As you can see with a clamped texture and an out of bounds UV map your mesh gets covered with the repeated edge pixels a.k.a your "candy cane" problem.
While removing the S and T clamp flags on the texture is a quick solution the proper way to fix it would be to move the UV map back up into the position it's meant to be in.
In 3DS Max is actually fairly easy to fix. You just select your entire UV map, switch to relative co-ordinates and set the V value to 1. This will push your UV map back up into the correct co-ordinate space.
Hope that helps explain it!