Blender homepage link
header graphic
 

Texture Mapping

Achieving "ordinary" plain texture-mapping on a Verse object is perhaps not as easy as one would expect. This is because there is no special treatment of texture-mapping; nor is there a default material or surface shading system. If you want your surfaces to be texture-mapped, you will need to explicitly specify so, through a suitable material.

The same is true, by the way, for lighting. If you want your surface to care about incoming light, you need to say so in the material. This can be fairly easy, though.

Pure Texture Mapping


This figure shows, schematically, the definition of a material that maps a texture onto a surface, fetching the surface color from pixels in a Verse bitmap.

The material fragments are defined as follows:
  • The output has label="color".
  • The texture has layer_r="color_r", layer_g="color_g" and layer_b="color_b". These are the standard names for bitmap layers holding RGB color data.
  • The geometry fragment has layer_r="map_u" and layer_g="map_v". This means that it will emit colors whose values are fetched from the indicated UV mapping coordinate geometry layers. Such layers should be of type VN_G_LAYER_CORNER_REAL, and indicate the position in the texture for each polygon corner. Note that U and V coordinates are kept in separate layers.


Lit Texture Mapping


Typically, you will want your textured surface to also care about incoming light. The image to the right shows how the above material can be modified to add this feature. A blender fragment is simply added, and set to multiply the texture color with the incoming light, as represented by a light fragment.


Linking a Material to a Bitmap, in Connector

The Texture fragment contains a node reference, called "Texture". There is no immediate interface to set this when editing the fragment in Connector, but it still must be set to point at the proper bitmap node. The way to do this is to exit the node editor, and then (while in the view of "current" selected nodes), drag the little handle-icon that appears to the desired bitmap (which must also be selected).


Here is the view of the two selected nodes, the material (as per above) to the left, a bitmap node to the right.


And here is the view after the drag-handle has been dragged over to the bitmap node and dropped there. Connector inserts the ID of the target bitmap into the Texture fragment inside the material node, automatically.

About UV Coordinates

When texture-mapping, you also need to specify how the texture is supposed to be mapped onto the geometry. You do this by creating dedicated layers in the geometry, of type VN_G_POLYGON_CORNER_REAL, and storing the mapping data in there. When doing this, it is important to realize that the UV values really are associated with the polygon corners, not the vertices. This is good, since it makes it possible to have several UV coordinates per vertex, which is often needed at corner points.