shader - How to create a texture alpha, with white and black colors only, in GLSL? -


i looking reproduce glow effect tutorial, if understand well, convert first image "alpha texture" (black , white), , blur (rgb * a) texture.

how possible create alpha texture, colors go white, , other go black? found : how render texture alpha? don't know how use these answers.

enter image description here

enter image description here

thanks

it appears misunderstanding diagram showing you. 1 texture, (a) shows rgb color , (b) shows alpha channel. (c) shows happens when multiply rgb a.

alpha not "black , white", abstract concept , amounts range of values between 0.0 , 1.0. human brain make sense out of it, interprets black (0.0) , white (1.0). in reality, alpha whatever want , unrelated color (though can used color).

typically alpha channel generated post-process image filter, looks areas of texture above average luminance. in modern graphics engines hdr used , part of scene color bright displayed on monitor candidate glowing. intensity of glow derived how brighter lighting @ point monitor can display.

in case, however, appears human created. think of alpha channel mask, artist looked @ ufo , decided areas appear non-black in figure (b) supposed glow non-zero alpha value assigned (with alpha = 1.0 glowing brightest).


incidentally, should not blurring alpha mask. want blur result of rgb * a. if blurred alpha mask, not resemble glowing @ all. idea blur lit parts of ufo supposed glow , add on top of base ufo color.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -