[osg-users] Raytraced shader code

Robert Osfield robert.osfield at gmail.com
Fri Sep 15 02:29:08 PDT 2017


Hi Clement,

On 15 September 2017 at 02:57, <Clement.Chu at csiro.au> wrote:

>    I am using volume rendering with ray traced technique.  I saw black
> color along the edge of image.  I checked the shader code.  There is a
> variable called fragColor and initial value is set to  vec4(0.0, 0.0, 0.0,
> 0.0);.  I would like to know why this value is using black on initial.
> Should we use background colour for the initial?  Thanks.
>

Look at the shader - it accumulates the colour contributions along the ray
so you have to start with 0.  You wouldn't do a summation of sequence
without starting at zero, so it's the same for accumulating the colour.

Robert.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20170915/ad3263bd/attachment.htm>


More information about the osg-users mailing list