Difference between revisions of "Texturing"

(Document decal shader)
m (Slight correction)
Line 49: Line 49:
 
With the new UV map selected, switch to '''Edit mode''' on the mesh and texture the object with the decal texture wherever you want. Be sure to select "Keep UV and edit mode mesh selection in sync" and only select faces you want to add the decal to. If you aren't careful, the decal will tile all over the place.
 
With the new UV map selected, switch to '''Edit mode''' on the mesh and texture the object with the decal texture wherever you want. Be sure to select "Keep UV and edit mode mesh selection in sync" and only select faces you want to add the decal to. If you aren't careful, the decal will tile all over the place.
  
{{Popup-warning|content=The decal shader does not work with textures that include a normal map or gloss map.}}
+
{{Popup-warning|content=The decal shader does not work with textures that include a normal map. Whether it works with gloss maps is unknown.}}
  
 
{{ArtPortalNav}}
 
{{ArtPortalNav}}

Revision as of 03:16, 15 January 2017

Texturing is the process of applying images to 3D objects so that they appear more realistic. Use UV texturing in Blender for your objects for them to appear in-game, but don't waste time with Blender materials or cycles materials. They don't get exported into the game—instead, use SuperTuxKart's own materials system. More information can be found on the Materials page.

In fact, don't even bother with the Texture section of Blender's Properties window. Simply applying a UV map is enough.

Sources of Textures

The Media Repository

The SuperTuxKart media repository should be the first place you look for textures. They're included in the game, so you don't have to distribute copies with your object and they use advanced graphical effects like gloss and normal maps to take advantage of all the features of SuperTuxKart's engine. They are in the textures folder. Simply choose one of these textures when you open an image in the UV/Image Editor window.


Don't like the default color of the textures? No problem! Just use vertex coloring (see below). Vertex color lets you paint different colors on an object so that you don't need a new texture. Gran Paradiso Island, for example, uses vertex color to make the sea floor greenish-blue, even though the original texture is a tan color rock texture.


Free Online Sources

There are many sources of free images that can be used as textures. Several are listed on the Reusable Artwork Resources page. Just be sure they fit the texture guidelines.

Making Your Own Textures

Making your own textures gives you the most freedom to customize your textures. However, it will take quite a bit of time. If you're interested, however, you can see the Making Textures page.

Vertex Coloring

Vertex coloring lets you modify the color of objects by vertex. The coloring is then applied on top of any textures. (This is why we require most textures included in the game to be of a semi-neutral color.) Vertex color is extremely efficient in terms of processing, and is a much better option in most cases than using a separate texture for gradients or using splatting. A short tutorial follows below, since (surprisingly) very few tutorials are available on the internet. (A good video tutorial is available here, however the first part about materials is not relevant for STK.)

Getting started

Select the object you want to color. In the Properties window, under Data, click the plus button next to the box under Vertex Colors. Now, in the 3D View window header, switch to Vertex Paint mode (rather than Object or Edit modes). Several new options will appear in the toolshelf at the left of the 3D View window.

Painting

Choose a color with the color picker at the left, adjust the radius (size) of the brush, change the strength if you want to, and choose a blending mode (Mix is the default). Then, left-click on vertices to color them. You'll notice that you can't paint in the middle of a face. That's because vertex coloring works per-vertex—you can't assign colors to the middle of a face, because there's no vertex to assign it to. It's one of the limitations of vertex coloring, and you may have to work around it by using subdivision (shortcut: w > Subdivide) on a face.

Viewing your work in Object Mode

To make your painting visible in Object Mode when not in Textured view, enable Textured Solid under Shading in the 3D View window properties panel (shortcut: n).

Decals

SuperTuxKart provides a "decal shader" which allows you to mix textures just like layers in a photo editing program. To use decals, first select the target mesh in Blender. In Blender's Properties window, under Data, click the + button next to the box under UV Maps.

With the new UV map selected, switch to Edit mode on the mesh and texture the object with the decal texture wherever you want. Be sure to select "Keep UV and edit mode mesh selection in sync" and only select faces you want to add the decal to. If you aren't careful, the decal will tile all over the place.