opengl - Computer graphics: how to draw this effect using computer programs? -


i wondering how draw effect using computer programs, either cpu or gpu?

enter image description here

you have 2 lines there. want pick closer line each pixel, , calculate distance it. intensity @ given point. furthermore fade black approach bottom of image (use pixel's y position this)

your lines seem @ @ 25% , 75% on x axis, therefore pseudode looks this:

for each pixel p: //p.x , p.y normalized 0-1 range!   intensity = ( 0.25 - min( abs(p.x-0.25) , abs(p.x-0.75) ) ) / 0.25; //intensity normalized 0-1 range   intensity *= intensity; //distance squared   intensity *= (1.0 - p.y); //top of image 0, bottom 1   display_intensity(); end 

depending on how want use this, can create texture on cpu, or use shader , calculate in glsl on gpu.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -