• Create Account

### #ActualQNAN

Posted 01 July 2013 - 11:00 AM

EDIT:

Thanks, it was something like this I needed

Your code makes sure, that values are included right away. Can't believe what a mess I ventured into with the other code (which I took over from a far-range fadeout of instancing with too little tthought).

Just for the record, the final shader code will look like this:

float l_dissolvemap_result = tex2D(g_dissolvemap_sampler, a_texcoord0).r;
if(g_alpha < l_dissolvemap_result)

l_final_color.a = l_original_alpha;


In this way alpha-testing (or alpha-to-coverage, which is very similar, just with nicer edges and antialiasing) will still work for the original alpha of the object texture, as the g_alpha is not factored in.

### #3QNAN

Posted 01 July 2013 - 10:44 AM

EDIT:

Thanks, it was something like this I needed

Your code makes sure, that values are included right away. Can't believe what a mess I ventured into with the other code (which I took over from a far-range fadeout of instancing with too little tthought).

Just for the record, the final shader code will look like this:

float l_dissolvemap_result = tex2D(g_dissolvemap_sampler, a_texcoord0).r;
if(g_alpha < l_dissolvemap_result)
else
l_final_color.a = l_original_alpha;


In this way alpha-testing (or alpha-to-coverage, which is very similar, just with nicer edges and antialiasing) will still work for the original alpha of the object texture, as the g_alpha is not factored in.

### #2QNAN

Posted 01 July 2013 - 10:09 AM

EDIT:

Thanks, it was something like this I needed

Your code makes sure, that values are included right away. Can't believe what a mess I ventured into with the other code (which I took over from a far-range fadeout of instancing with too little tthought).

### #1QNAN

Posted 01 July 2013 - 09:48 AM

Thanks for the input. your calculation does look faster. Although it will not solve my distribution problem.

Alpha-to-coverage I see essentially as the same as alpha-testing (with better edge result and antialias).

The last technique sounds interesting. Do you have any resource on that? I have tried to google with no luck.

PARTNERS