From: bob kuehne (rpk++at++sgi.com)
Date: 03/13/2003 08:46:16
On Thu, 13 Mar 2003, Florian Berger wrote:
> well, actually it seemed to me as if the pfShader didnt care about bins
> at all. i tried to assign the bins of the GeoSets by hand, but it didnt
> change anything. still the pfShaded objects were drawn last.
hi florian,
i think you're correct - the pfShader is not really sortable, cause a
particular shader may use lots of strange state, etc. but the behaviour
you're seeing is expected. opengl shader uses the framebuffer to perform
shading computations, so unless an isl shader preserves the existing
contents of the buffer, they may be overwritten. what you can do to avoid
this is:
surface yourfunction()
{
// whatever your shader really does
}
surface blendWithExistingFrameBufferShader()
{
varying color prevfb = FB;
FB = yourfunction();
FB = over( prevfb );
}
what that should do is:
1) save the existing fb contents beneath your new shaded object
2) draw your shaded object
3) blend the shaded object over (using alpha) the previous results
(other blend modes exist, in case this isn't exactly what you want,
see /usr/share/shader/doc/islspec.html for a complete list)
i think that's what you need...
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 : Thu Mar 13 2003 - 08:47:21 PST