Re: [Paracomp-devel] Crash in pcSystemFinalize
Brought to you by:
shreekumar
|
From: Shree K. <shr...@hp...> - 2008-05-14 11:10:37
|
Hi Maxim, On Tue, 2008-05-13 at 15:18 +0000, Maxim Makhinya wrote: > Hello, > > I'm working with Stefan on equalizer, eVolve in particular. > Nice to see you here. And welcome :-) Thanks for the explanations. > Assuming that we have 1 background image (just "background" in the > text bellow) and several images (which contains alpha values) we want > to blend on to this background, there are two different strategies > in eVolve to obtain the result: > > 1) Blend sequentially all images back to front on to background (this > is our GPU based compositing at the moment); > > 2) Blend all images between each other and then blend resulted > image on to background (this is our CPU compositing; we have > background on GPU, so we blend images on CPU and then use GPU > blending once to get final result on GPU). > > For the first strategy glBlendFunc(GL_ONE, GL_SRC_ALPHA) is used, > and if final image is in main memory not on GPU, I guess, Paracomp > compositing could be used without changes. I'm puzzled by the destination factor of GL_SRC_ALPHA. Are you guys using alpha as an "opacity" value ? (As opposed to classical volume rendering which uses alpha as transparency) Paracomp implements back to front blending with glBlendFunc(GL_ONE, ONE_MINUS_SRC_ALPHA). > For the second strategy > if we have background on GPU (form previous rendering or so) the > compositing is different. > To be able to blend our images on CPU and then blend resulted image on > to some background > glBlendFuncSeparate( GL_ONE, GL_SRC_ALPHA, GL_ZERO, GL_SRC_ALPHA ) > has to be used. Using this function we get resulted image with > same properties as two input once: > 1) we can blend it on to any background with > glBlendFunc(GL_ONE, GL_SRC_ALPHA), result will be as if we would > blend two of them sequentially with glBlendFunc(GL_ONE, > GL_SRC_ALPHA) > and > 2) we can blend it with another slice using > glBlendFuncSeparate( GL_ONE, GL_SRC_ALPHA, GL_ZERO, GL_SRC_ALPHA ) > and resulted image will have same properties. > > glBlendFunc(GL_ONE, GL_SRC_ALPHA) cannot be used here to blend slices > one to another because such blending will not accumulate resulted > "amount of light which passes through the volume" correctly in our > case. > Yes, the problem with glBlendFunc() is that the final alpha value is incorrect. BlendFuncSeparate is the only one which can get you the correct alpha value at the end. So that leaves me thinking what we could do. I'm eager to here about your usage of GL_SRC_ALPHA before I can think of a solution. Regards -- Shree |