View topic - Alpha mapping for cutouts

Alpha mapping for cutouts

Post here questions about using YafaRay materials, texturing and procedural models.

Alpha mapping for cutouts

Post Sun Mar 15, 2015 6:29 pm


In YafaRay there is a "fake transparency" model which is enabled either when transparency is used in a shinydiffuse material or when "fake shadows" is enabled in a glass material. When fake transparency is used, shadow rays (blue) can get through fake transparent surfaces in order to sample light sources:

This model does not produce any of the realistic effects produced by transparents surfaces with IOR, yet it can deliver uniform or mapped color filtering:

Color filtering is the tinting of light that goes through a coloured transparent surface and it is done by multiplying the transparency factor for the value component of the HSV coordinates of the transparent surface color. It means that a white color on the material can be made fully transparent if Transparency=1 (1x1=1) while a black color can't be made any transparent even if Transparency=1 (1x0=0). This means that in order to produce alpha mapping for cutouts, we need to produce two textures in the following way:

Notice how the part meant to be transparent is white on both the base texture and the transparency mask. Remember as well that you have to enable transparent shadows with enought transparent shadows depth in the render section for fake transparency to work. You can achieve this effect as well by using a Blend material. Example file attached
(199.14 KiB) Downloaded 607 times
User avatar
Posts: 3110
Joined: Tue Dec 20, 2005 10:39 am
Location: Spain

Re: Alpha mapping for cutouts

Post Sun Mar 13, 2016 12:48 pm


Until David solves this, I think this is better solution:


Edit: It seems to work with some images and others not, needs testing.
Posts: 109
Joined: Sat Apr 26, 2014 6:37 am
Location: Spain

Return to Materials and Texturing

Who is online

Users browsing this forum: No registered users and 2 guests