From: bob kuehne (rpk++at++sgi.com)
Date: 01/24/2003 07:52:41
On Fri, 24 Jan 2003, Florian Berger wrote:
> however, when i use transparent objects in the same scene, the
> transparency is not correctly displayed when intersecting with the
> shaded object (transparent regions have sky color).
>
> so it seems to me that shader passes are generally drawn after all
> drawBins, because changing either drawBins of the shaded or unshaded
> geosets didnt take any effect.
i'm not sure if that is the case, perhaps someone from the performer team
can answer specifics about when pfShaders are rendered. however...
> is my suspect correct? and is there a way that shaders cope with
> transparencies?
transparent shaders, as you've noted, work correctly, however shaders
written in isl don't necessarily do anything with the existing contents of
the framebuffer. for example:
surface foo() { FB = color( 1,0,0,.5 ); }
will simply replace the contents of the fb with that shader's results. if
you want to do something with the existing contents of the framebuffer,
say, render a shaded appearance, and then blend with the existing fb
contents. you could do something like this:
surface bar()
{
varying color aa = FB;
foo();
FB = over( aa );
}
the reason for the wrapping is that if you do stuff in foo that requires
exclusive access to the framebuffer, your pre-existing contents may get
overwritten. but the above should allow you to blend contents of the
results of surface shader foo with the preexisting framebuffer contents.
please examine the shader spec (/usr/share/shader/doc/user/islspec.html)
for all the possible blend modes you can use within a shader.
so, it's still possible that pfShader objs are rendered before there are
other fb contents, and so all you see is the clear-color. but it's also
possible that your shader is obliterating the prev contents as well.
hope this helps!
bob
bob kuehne | there was coffee. | core
rpk++at++sgi.com | life would go on. | rendering
248/427-4465 | william gibson, the winter market | sgi
This archive was generated by hypermail 2b29 : Fri Jan 24 2003 - 07:52:46 PST