Archived

This topic is now archived and is closed to further replies.

duhroach

plotting pixels in fragment program?

Recommended Posts

duhroach    225
From what I''ve read, being able to directly plot a pixel at an arbitrary location in a fragment program is impossible. What I''m asking though, is if there''s an alternative way to do it. Essencially I''d like to take a pixel, and calculate where offset location would be (given some stimulus) in window coords. The solution I''ve derrived so far requires a 3 step system. First step: Fragment program calculates offset locations, and stores the locations into the frame buffer Second Step: the CPU takes the frame buffer and rebuilds the texture based upon the true offset values Third Step: The created texture is placed on a screen aligned quad and sent back down the pipeline for final rendering (lighting etc is done here) The reason I have to do the reconstruction on the CPU, is because I''ve found it impossible for a fragment shader to directly handle an array of such size (Worst case, 640x480x4 array). Has anyone run into this problem? Or does anyhow have a viable solution to a work around? Thanks ~Main == Colt "MainRoach" McAnlis Programmer www.badheat.com/sinewave

Share this post


Link to post
Share on other sites
Trienco    2555
the only thing coming to my mind (and i probably didnt get what exactly you try to do) is drawing a screen sized quad to make sure every pixel is passing your shader and then work the other way round, drawing whatever should be there or killing the fragment (as early as possible). though if you cant do it "backwards" just forget what i said ,-)

Share this post


Link to post
Share on other sites