Posted 15 March 2003 - 12:35 AM
I try to implement something called Opacity Shadow Mapping by which it is possible to calculate shadows of semi-transparent
objects. In order to do this, I have to render the scene several times with special clipping parameters. After rendering,
I will read back the resulting alpha values from the color buffer. But unfortunately, all alpha values are one. I am using
the blending equation GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA. My question: How can I render the scene and
get back different alpha values at different positions? To get more precisely: When I render a quad textured with a bitmap
that has an alpha value of 0.6, I want this 0.6 appear in the color buffer again. When I render this scene again with another
quad lying over the other, I want the two alpha values properly accumulated and stored again in the color buffer.
Any help will be appreciated,
Posted 15 March 2003 - 08:34 AM
He who knows not and knows that he knows not is ignorant. Teach him.
He who knows not and knows not that he knows not is a fool. Shun him.
Posted 15 March 2003 - 02:04 PM
have no idea how to do this. The alpha values in the framebuffer are contstantly one after the rendering process.
Posted 15 March 2003 - 03:20 PM
All alpha values turn out to be 1.
Posted 15 March 2003 - 08:08 PM
Btw, read up on 'glReadBuffer()' to specify the buffer you want to read from.
Posted 15 March 2003 - 11:59 PM
I am using glReadBuffer(GL_BACK) to read from the back buffer (I'm using double buffering).
There is no alpha buffer from where I can read the intermediate alpha values.
Posted 16 March 2003 - 01:01 AM
I tried a demo program using GLUT. When I initialize GLUT with GLUT_RGBA and especially with GLUT_ALPHA,
it works. Unfortunately, I am not using GLUT, but Trolltechs Qt OpenGL component. I have to look for an
equivalent option there.
Posted 16 March 2003 - 01:52 AM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users