Re: [osg-users] Antialiasing in Volume rendering
HI Clement, On 26 June 2012 00:15, clement@csiro.au wrote: If I extended the RayTracedTechnique and override the default VERTEX and FRAGMENT glsl codes to replace my own glsl code, which will measure distance along the ray. Are you talking about this case to overcome the aliasing artifact ? You could implement your own VolumeTechnique which subclasses from RayTrayTechnique or just directly from VolumeTechnique. The shaders will need to do the computation of the distances and sampling - the current shaders can be found in OpenSceneGraph-Data/shaders and also as source code in OpenSceneGraph/src/osgVolume/Shaders. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Antialiasing in Volume rendering
Hi Clement, On 24 June 2012 18:14, clement@csiro.au wrote: I got aliasing problem on volume rendering. I tried to set parameter samples to 8 in class osg::GraphicsContext::Traits, but I still can see aliasing. Does anyone have an solution to stop aliasing. Thanks. Volume rendering won't tend to be too sensitive/responsive to full screen anti-aliasing, rather then the way to improve visual quality with volume rendering is to increase the number of samples taken along the ray path when sampling the 3d texture. Could you post an example of the aliasing you are seeing, this will probably point to the problem. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Antialiasing in Volume rendering
Thanks, Robert. I attached two screen shots. I found that aliasing would only appears on the side of the cube that has not been filled. For example, the cube size is 100 x 100 x 20. If the cube is fully filled colour on all voxels, there is no aliasing on each surface. Once there is a section of voxels has not been filled colour, you can see aliasing from this section. I tried to increase the sample density, the colour becomes darker but the aliasing problem has not gone. Regards, Clement From: osg-users-boun...@lists.openscenegraph.org [osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield [robert.osfi...@gmail.com] Sent: Monday, 25 June 2012 6:29 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Antialiasing in Volume rendering Hi Clement, On 24 June 2012 18:14, clement@csiro.au wrote: I got aliasing problem on volume rendering. I tried to set parameter samples to 8 in class osg::GraphicsContext::Traits, but I still can see aliasing. Does anyone have an solution to stop aliasing. Thanks. Volume rendering won't tend to be too sensitive/responsive to full screen anti-aliasing, rather then the way to improve visual quality with volume rendering is to increase the number of samples taken along the ray path when sampling the 3d texture. Could you post an example of the aliasing you are seeing, this will probably point to the problem. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Antialiasing in Volume rendering
Hi Clement, On 25 June 2012 13:29, clement@csiro.au wrote: Sorry, I forget to attach the images. Top image: there is no aliasing. Bottom image: aliasing appears on the side that has not been filled colour. As I suspected the aliasing is down to under sampling of the ray, so up the sample ratio. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Antialiasing in Volume rendering
Hi Clement, The datasets you are working of will always challenge a ray traced sampler as there is sudden cutoff to a flat face so that any small change in adjacent pixels can result in a enough of different sampling as to result in a visible step. Increasing sample density will usually reduce the step and make it less obvious but unless you go sub pixel it will likely remain visible. Another route one could go is to use a different shader that samples at texel centers rather than just a measured distance along the ray as is done with the present shaders. Also I think you'll find that this aliasing artefacts will be far less noticeable on more normal volume datasets so it may be worth just making a judgment call about whether these datasets are meaningful and worthy of trying to optimize for. Robert. On 25 June 2012 17:55, clement@csiro.au wrote: Hi Robert, Thanks for your advice. It looks better if I increased sample density. When I tried on another case, see the attachment. If colour is filled in center section only and increased the sample density, the aliasing became much worse. If I decreased the sample density, it looks better. Dp you know when should I adjust the sample density to reduce aliasing? Regards, Clement From: osg-users-boun...@lists.openscenegraph.org [osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield [robert.osfi...@gmail.com] Sent: Tuesday, 26 June 2012 1:34 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Antialiasing in Volume rendering Hi Clement, On 25 June 2012 13:29, clement@csiro.au wrote: Sorry, I forget to attach the images. Top image: there is no aliasing. Bottom image: aliasing appears on the side that has not been filled colour. As I suspected the aliasing is down to under sampling of the ray, so up the sample ratio. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Antialiasing in Volume rendering
Hi Robert, If I extended the RayTracedTechnique and override the default VERTEX and FRAGMENT glsl codes to replace my own glsl code, which will measure distance along the ray. Are you talking about this case to overcome the aliasing artifact ? Regards, Clement From: osg-users-boun...@lists.openscenegraph.org [osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield [robert.osfi...@gmail.com] Sent: Tuesday, 26 June 2012 4:41 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Antialiasing in Volume rendering Hi Clement, The datasets you are working of will always challenge a ray traced sampler as there is sudden cutoff to a flat face so that any small change in adjacent pixels can result in a enough of different sampling as to result in a visible step. Increasing sample density will usually reduce the step and make it less obvious but unless you go sub pixel it will likely remain visible. Another route one could go is to use a different shader that samples at texel centers rather than just a measured distance along the ray as is done with the present shaders. Also I think you'll find that this aliasing artefacts will be far less noticeable on more normal volume datasets so it may be worth just making a judgment call about whether these datasets are meaningful and worthy of trying to optimize for. Robert. On 25 June 2012 17:55, clement@csiro.au wrote: Hi Robert, Thanks for your advice. It looks better if I increased sample density. When I tried on another case, see the attachment. If colour is filled in center section only and increased the sample density, the aliasing became much worse. If I decreased the sample density, it looks better. Dp you know when should I adjust the sample density to reduce aliasing? Regards, Clement From: osg-users-boun...@lists.openscenegraph.org [osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield [robert.osfi...@gmail.com] Sent: Tuesday, 26 June 2012 1:34 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Antialiasing in Volume rendering Hi Clement, On 25 June 2012 13:29, clement@csiro.au wrote: Sorry, I forget to attach the images. Top image: there is no aliasing. Bottom image: aliasing appears on the side that has not been filled colour. As I suspected the aliasing is down to under sampling of the ray, so up the sample ratio. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Antialiasing in Volume rendering
Hi, I got aliasing problem on volume rendering. I tried to set parameter samples to 8 in class osg::GraphicsContext::Traits, but I still can see aliasing. Does anyone have an solution to stop aliasing. Thanks. Regards, Clement ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org