Jump to content
  • Advertisement
Sign in to follow this  
yk_cadcg

[dx10]getting blended color where mouse clicked

This topic is 3754 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

same Q&A here: http://forums.xna.com/forums/t/3484.aspx i adopt plan 4's CopySubresourceRegion, still have bug now, fixing ------------------------------------ Hi, Where the mouse clicked on the dx10 window, i want to display the 4-channel color info of that pixel as fonts. The special thing is, i utilize blendings (add/max/min), so i need final pixel color be an aggregated result, which could be out of [0,1] range. So i have to read texture rather than directly read screen color. Besides, it seems there's no way to directly read screen color. Below's my plan, i don't know if there're better solutions. 1, After the mouse is clicked, allocate a 1x1 texture T, set the viewport to be 1x1. Move the eye to the mouse's screen position P, and lookat in the same direction of the original camera (i don't know how to implement this move..lookat..). Redraw the scene to this texture. 2, read back the texture to main memory, use DXUT's font sprite to display a line of text near the mouse's position. Another solution will cost a whole drawing: 3, After the mouse is clicked, allocate the screen-sized texture T, redraw the scene to T. 4, stage this screen-sized texture and seek for the mouse position in the main memory. Or, use CopySubresourceRegion() to copy the related texel to another 1x1 texture first, then stage it back to main memory. Above solutions are both vague and seems troublesome. Thanks a lot for suggestions! [Edited by - yk_cadcg on June 11, 2008 7:34:00 PM]

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!