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

gcc - MinGW's ld cannot perform PE operations on non PE output file -

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

c# - Search and Add Comment with OpenXML for Word -