Jump to content
  • Advertisement
Sign in to follow this  
Klaatu

Request advice

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

I'm requesting advice for the following situation: I have an app that draws geometry onto a gradient background. When the app 'deletes' the geometry it typically draws the deleted portion in the background color. This works fine for a solid background. How do I 'delete' the geometry with a gradient background? Do I need to interrogate pixels? Any help would be appreciated.

Share this post


Link to post
Share on other sites
Advertisement
Ok, here goes a simple example...

The user can specifiy he/she wants a solid or gradient background. For this example, I've got a gradient background. On the background I draw a green line. The existing (can't be changed) code 'deletes' the line by drawing it in the background color (for example, black). On a gradient background, the existing code draws a black line when the line is 'deleted'. I'd like to come up with a way to remove ('delete') the line by restoring the original gradient pixels at that location.

Share this post


Link to post
Share on other sites
Instead of clearing to black, could you clear using the same function that was used to create the gradient background?

Share this post


Link to post
Share on other sites
Vaalean: I'm not clearing a buffer. I'm removing a piece of geometry (eg. a primitive) from the screen. The current code supports OpenGL and DirectX. It wants to 'delete' the geometry by re-writing it in black. If I allow this, I get a black colored primitive on top of a gradient background. What I'd like is just the gradient colors where the geometry once existed.

Share this post


Link to post
Share on other sites
You could rebuild the gradient into a temporary buffer, and in the temp. buffer mask out all pixels except those the line covers, and then merge it with your main buffer.

Share this post


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

  • Advertisement
×

Important Information

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

GameDev.net 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!