Archive

Posts Tagged ‘textures’

GSoC final deadline

The final GSoC deadline is tomorrow, or rather the firm ‘pencils down’ date, so I have decided to make a really short self-evaluation of the features I’ve managed to implement.

Done :

  • Generate geometry – iFurMaterial (until the midterm)
  • Animate geometry – iFurPhysicsControl (until the midterm)
  • Write specific shaders – iFurStrandGenerator (until the midterm)
  • External parameters – density and height maps, 3D textures, etc.
  • LOD system and optimizations – iFurMesh inherits from iMeshObject
  • Extend from hair to fur – thanks to Frankie the squirrel

There is still some code rearranging to be done, but nothing much, really: deciding what classes should inherit from what interfaces, making loaders and savers for the mesh, just better organizing the code.

I leave you with this footage of the CS fur plugin as it is now (the FPS is actually double than in the video and above 60 on release settings and ~30 FPS on debug):

Advertisements
Categories: Crystal Space Tags: , , ,

Textures

In order to obtain really nice visuals adding texture support to the hair plugin was a must do.

However if we think about it, a hair mesh texture might have up to three dimensions, rather than just two. This is because hair strands can vary from root to tip (especially if you dye your hair) and can vary from strand to strand (like hair stripes). But having in mind that it is much easier to specify just a 2D texture (UV map of the base mesh) and extremely useful for fur, which don’t tend to vary from root to tip at all, I made two ways of defining textures for the fur plugin.

  • 2D textures

For this type of textures only a UV map is needed, so fur strands will have the same color for the whole length of the strand. The color is of course equal to the value of the RGB pixel specified by the UV coordinates. Here is an example in CS of such a 2D texture used for Frankie (from Yo Frankie!):

  • 3D textures

This is not a usage of 3D textures per se, but rather a simulation of using such textures. In order to keep things simple for the user, only two 2D textures have to be specified. A grayscale UV map that will be scaled from (0, 255) to (0, 1) and whose value will be used as the X coordinate of the second texture, while the Y coordinate is the length of the hair. An example of such textures for Krystal are:

Having the following result: