This project is about adding texture support for freestyle in blender. The design consists of two steps:
- Adding a BlenderTextureShader to the freestyle module taking a blender mtex as argument
- Adding a texture_slot type to linestyle
- I'm also adding a StrokeTextureStep(float) shader to affect the spacing of texture coordinates along the stroke.
The goal is being able to use more textures stacked one on the other, like blender classic shading system, and being able to map them with different coordinates (Generated, View, Along Stroke), map to color or alpha (or both), and use different blending options. Each texture mapped along stroke can be either a freestyle brush texture, like corpus, tip, tail, or just plain left to right texture.
We would also benefit a "texture step" parameter to control the span of the texture along the stroke,
it will be available soon. Unfortunately this is not going to be a per-texture attribute as coordinates are computed globally. It's an easy feature and will be likely be in the next patch. Procedural textures are also supported, their properties are found in the other textures tab.
Current issues are:
internally there is only one material for all strokes, wich means all linesets will have the same textures, I need to fix this immediately! Copy/Paste Texture button does not work. Textures are not linked. BlenderTextureShader takes a pointer as argument, would be nice to give a texture_slot instead. A material is created for each strokerep, I suppose we should reuse existing materials from a list. Texture Coordinates are always computed, despite weather they are used or not Texture preview does not update properly. New Image button creates a new image but does not assign it (probably related to the previous bug).
- BlenderTextureShader accepts LinestyleTextureSlot type only.
- Texture Spacing is LineStyle global, it would be nice having it as a per-texture parameter
Of course there's more, I hope we will find (and fix) most of the bugs.
Here's the diff
D246: Texture Marks for freestyle strokes