Request advice

Started by
4 comments, last by cmiskow 19 years, 6 months ago
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.
Gort...Klaatu, Barada Nikto!
Advertisement
I can't follow your situation.. Please explain it again?
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.
Gort...Klaatu, Barada Nikto!
Instead of clearing to black, could you clear using the same function that was used to create the gradient background?
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.
Gort...Klaatu, Barada Nikto!
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.

This topic is closed to new replies.

Advertisement