Forum

Gradual transparency of elements into the backgroud - dx11


#1

hi guys, how to make these quads disappear into background as these 2 gradients are positioned?

gradient transparency.v4p (9.8 kB)


#2

hey u need to enable blend first, add blend render state set to blend, then, if u don’t have alpha on gradient u need to do something like
if (col.r<0.001) {col.a = 0;} in ur shader

or just col.a = col.r, if u need softgradient
or u can try to use set alpha on ur gradient color…

the problem also u have black border where u have white border that makes it not obvious what cha wanna do.


#3

oh i mean this, pink is transparency


#4

idk’ m8 if u need some one to do it for u post a patch.
but if u want to learn how to do that urslef go ahead doublle click ur quad, select template dx11.effect and do ctrl click too copy.

anyways if u want to mask 4 balck quads u have, u need to do that bit different:
render quads with gradient as a separate texture size of ur render, then specify on shader rendering ur quads, that u have new texture 2d mask, the u need to convert ur coords for mask texture as screen space cords (witch prolly gona be uv1 = pos.xy if camera not moving)… then u just do “col.a = col1.a” or col.a = 1 - col1.a since ur mask is actually have to put trnasperacy only on un transparent parts…

i can also sure u there is muuuuch more easy way to do that witch is also 3 lines of code and caled softedge.


#5

well i am basically asking if there is a thing in vvvv which can do it in one render pass, and if not if i need to look at shaders, i know it is probably pretty simple thing to do in shader so i will try


#6

enjoy… bit messy on controls tho

soft.rar (2.1 kB)


#7

thanks! it is kinda what i want with one exception, i am not sure what the gamma should do, these quads fade into black color, but i want them to fade into color with alpha=0 and i cant find where should i put it in shader, i suspect it might be the gamma part :3


#8

made it to fade alpha

soft.rar (2.2 kB)


#9

oh this is really awesome thing, you should make a contribution out of this, its kinda necessary to make a lot of modern menu designs

gods will repay you with strong children