Re: [osg-users] [osgPPU] Blur artifacts in HDR effect
I don't think there are other textures involved to add MSAA to.. two other blur units before the UnitInResampleOut could help yes, also notice that the radius should be about 2.5 - 3 times sigma to make sure the entire kernel is used instead of cutoff by the radius. grtz, René 2011/11/24 Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com Hello René, maybe multisampling can reduce the problem. The screenshot was with 4x MSAA active (in the camera-attach(...) call of the HDR code, where we bind a texture to the main scene camera which is then passed to the first unit in the osgPPU pipeline). Perhaps you're suggesting I enable MSAA for one of the other stages in the pipeline? How would I do that? also you can add an additional gausian blur to the image before resampling to reduce the artifacts. Again using the same separable blur (x and y passes)? So I would add two other units before the UnitInResampleOut? Thanks for your suggestions, J-S -- __** Jean-Sebastien Guay jean-sebastien.guay@cm-labs.**comjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.**com/http://whitestar02.dyndns-web.com/ __**_ osg-users mailing list osg-users@lists.**openscenegraph.org osg-users@lists.openscenegraph.org http://lists.openscenegraph.**org/listinfo.cgi/osg-users-** openscenegraph.orghttp://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] [osgPPU] Blur artifacts in HDR effect
Hello René, also notice that the radius should be about 2.5 - 3 times sigma to make sure the entire kernel is used instead of cutoff by the radius. The default values in the osgPPU hdr example are sigma = 4.0 and radius = 7.0, however I have not seen a difference between radius = 7.0, 15.0 and 200.0... So there I wonder if the values are getting to the shaders correctly. What values would you suggest I use for good results? Thanks, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] Blur artifacts in HDR effect
the radius determines the pixel for which the sigma is used. once you are on the edges of the kernel (gauss curve approaches 0), you can stop blurring. this will be around 2.5 - 3 times sigma. the correct sigma depends on the effect intended, try different sigmas ranging from 2-15 and radius = 2.5 * sigma (maybe you can attach a slider to interactively determine the best value.) René 2011/11/24 Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com Hello René, also notice that the radius should be about 2.5 - 3 times sigma to make sure the entire kernel is used instead of cutoff by the radius. The default values in the osgPPU hdr example are sigma = 4.0 and radius = 7.0, however I have not seen a difference between radius = 7.0, 15.0 and 200.0... So there I wonder if the values are getting to the shaders correctly. What values would you suggest I use for good results? Thanks, J-S -- __** Jean-Sebastien Guay jean-sebastien.guay@cm-labs.**comjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.**com/http://whitestar02.dyndns-web.com/ __**_ osg-users mailing list osg-users@lists.**openscenegraph.org osg-users@lists.openscenegraph.org http://lists.openscenegraph.**org/listinfo.cgi/osg-users-** openscenegraph.orghttp://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] [osgPPU] Blur artifacts in HDR effect
Hi, maybe multisampling can reduce the problem. using osgPPU hdr I noticed small details with high frequency (distant lights) appearing and disappearing. mutlisampling reduced these artifacts. (It did however cause a one frame delay, which isn't very noticable until you use a request redraw viewer, or screencaptures) also you can add an additional gausian blur to the image before resampling to reduce the artifacts. grtz, René Molenaar 2011/11/23 Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com Hello all, I am using the osgPPU HDR effect, and I noticed some undesirable artifacts probably caused by the blur effect, or the resample of the original pass (before the blur). Using the default resample settings (resample by 0.25 in each direction) I get the result in the attached screenshot. Look at the edges of the black cables, there are regular artifacts along their length, they are supposed to be a smooth edge. If I change the resample to 0.5 or 1.0 in each direction, I don't get these artifacts, but of course then the glare effect is less interesting :-) I also saw these parameters which are related to the blur (their name implies it at least) but changing them doesn't seem to make a significant difference. float mHDRBlurSigma = 4.0; float mHDRBlurRadius = 7.0; Can anyone give me a hint as to what could help this situation? Perhaps OpenGL is already filtering the resampled unit and then the blur uses that badly-filtered image as input? Or perhaps the blur shaders have some error in them? Thanks in advance, J-S -- __** Jean-Sebastien Guay jean-sebastien.guay@cm-labs.**comjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.**com/http://whitestar02.dyndns-web.com/ ___ 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] [osgPPU] Blur artifacts in HDR effect
Hello René, maybe multisampling can reduce the problem. The screenshot was with 4x MSAA active (in the camera-attach(...) call of the HDR code, where we bind a texture to the main scene camera which is then passed to the first unit in the osgPPU pipeline). Perhaps you're suggesting I enable MSAA for one of the other stages in the pipeline? How would I do that? also you can add an additional gausian blur to the image before resampling to reduce the artifacts. Again using the same separable blur (x and y passes)? So I would add two other units before the UnitInResampleOut? Thanks for your suggestions, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org