Advertisement Jump to content


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


plotting pixels in fragment program?

This topic is 5480 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post

Link to post
Share on other sites
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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!