-1

I render the object with off screen rendering and extract it back into the image. And draw it back on the screen. Then there are other objects underneath.

When I off screen render, I draw a cylindrical object with a hole, The circle has an alpha value of 0.5.

From a slight perspective, the moment you draw the front side, the side of the cylinder becomes alpha blending. However, the foreground background should not be alpha-blended.

The reasons are: off screen When rendering a rendered object as an image and redrawing it, there are other objects underneath.

Once again, describe my requirements. I do not want alpha blending with the first back ground and I want it to be sprayed right away. If the value of the depth buffer points to infinity, I would like to paint immediately without alpha blending.

Which way is better?

genpfault
  • 51,148
  • 11
  • 85
  • 139

1 Answers1

0

Ok what you need is called a clear color or skybox Just do

glClearColor( 0.2 , 0.4f , 0.3f ,1.f);

First three arguments are red green and blue change them depending on the color of your background

The last argument is alpha make sure its always 1.f to achieve what you described

Good luck !

tomer zeitune
  • 1,080
  • 1
  • 12
  • 14