1
$\begingroup$

I have an image with an alpha channel that I am using for a texture. Right now I just use its alpha channel (that's the only thing checked in the influence panel).

I'd like to give it a "halo"/border. Consider the following image where I take the outline of japan (from http://en.wikipedia.org/wiki/Template:Japan_football_clubs_map_2011), and give it a black border (this uses an intermediate image from the compositor of a separate scene, very awkward):

have a medal, Japan

My first instinct is to create a second plane underneath with a second version of the texture where I dilate (add pixels around the edge, ⟏ for those of you familiar with Image Algebra) the alpha channel for a dark material. Unfortunately, I can't seem to find a node which performs dilation in the texture Node Editor.

I welcome suggestions of how to achieve this effect using blender. (I am using BI, but if you want to answer with a screenshot of a node setup for Cycles I won't complain).

$\endgroup$
  • $\begingroup$ Vector>Mapping node and scale field to scale the UV map, and then just use it as a texture $\endgroup$ – someonewithpc Aug 26 '14 at 17:54
  • $\begingroup$ There is no Vector>Mapping node in the texture node editor. And if you're proposing to use it in a material node, you're going to have to provide a screenshot of the node setup. $\endgroup$ – Mutant Bob Aug 26 '14 at 18:40
  • $\begingroup$ Are you using BI or cycles? $\endgroup$ – gandalf3 Aug 26 '14 at 20:05
  • $\begingroup$ @MutantBob For texture nodes, there Distort>Scale $\endgroup$ – someonewithpc Aug 26 '14 at 20:16
  • $\begingroup$ @someonewithpc That would work in some cases, but not for a shape with holes in it (like the outline of japan). $\endgroup$ – gandalf3 Aug 26 '14 at 20:20
3
$\begingroup$

Use a Dilate/Erode node on the alpha channel in the compositor

enter image description here enter image description here

with background the node setup would be something like this: enter image description here enter image description here

$\endgroup$
  • 2
    $\begingroup$ I thought the OP specifically wanted to do this in a texture (without rendering, saving, and reloading an image), but perhaps I'm wrong.. $\endgroup$ – gandalf3 Aug 27 '14 at 6:18
  • $\begingroup$ I used the Dilate/Erode node in the compositor to create the outline in the sample picture embedded in the question. Your example goes further and includes the flag element. I'm even optimistic that you could include the gold disk (which is a 3D mesh) using render layers. However, the compositor alone could not work for a texture on a non-orthographic mesh. Fortunately, that isn't part of my mission. $\endgroup$ – Mutant Bob Aug 27 '14 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.