Re: [osg-users] bluring model edges

2010-03-25 Thread Allen Saucier
Harash, now I understand what you were talking about.  I am attempting to use 
the hdr example from osgPPU to perform the following procedure you outlined.  
However, I am having difficulty in breaking out the blur section of the hdr 
example provided with osgPPU.

Could you possibly tell me what I am missing from my code here?

Code:

#include stdafx.h
#include osgViewer/Viewer 
#include osgDB/ReadFile 
#include osg/ShapeDrawable 
#include iostream 

#include osg/Texture2D 
#include osg/Camera 

#include osgPPU/Processor.h 
#include osgPPU/UnitInOut.h 
#include osgPPU/UnitOut.h 
#include osgPPU/UnitTexture.h 
#include osgPPU/ShaderAttribute.h 
#include osgPPU/Unit.h
#include osgPPU/UnitInOut.h
#include osgPPU/UnitText.h
#include osgPPU/UnitInResampleOut.h
#include osgPPU/UnitInMipmapOut.h
#include osgPPU/UnitOutCapture.h
#include osgPPU/UnitBypass.h

#include osgDB/ReaderWriter
#include osgDB/ReadFile


osg::Texture* createRenderTexture3(int tex_width, int tex_height, bool depth) 
{ 
   // create simple 2D texture 
   osg::Texture2D* texture2D = new osg::Texture2D; 
   texture2D-setTextureSize(tex_width, tex_height); 
   texture2D-setResizeNonPowerOfTwoHint(false); 
   texture2D-setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR); 
   texture2D-setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR); 
   texture2D-setWrap(osg::Texture2D::WRAP_S,osg::Texture2D::CLAMP_TO_BORDER); 
   texture2D-setWrap(osg::Texture2D::WRAP_T,osg::Texture2D::CLAMP_TO_BORDER); 
   texture2D-setBorderColor(osg::Vec4(1.0f,1.0f,1.0f,1.0f)); 

   osg::Image *image = new osg::Image(); 

   image-allocateImage(tex_width, tex_height, 1, GL_RGBA, GL_FLOAT); 
   memset(image-data(), 0, image-getTotalSizeInBytes()); 

   texture2D-setImage(image); 
   texture2D-setUnRefImageDataAfterApply(true); 

   // setup float format 
   if (!depth) 
   { 
  texture2D-setInternalFormat(GL_RGBA16F_ARB); 
  texture2D-setSourceFormat(GL_RGBA); 
  texture2D-setSourceType(GL_FLOAT); 
   }else{ 
  texture2D-setInternalFormat(GL_DEPTH_COMPONENT); 
   } 

   return texture2D; 
} 


//-- 
// Quad 
//-- 

osg::Drawable* createSquare2(float textureCoordMax=1.0f) 
{ 
   // set up the Geometry. 
   osg::Geometry* geom = new osg::Geometry; 

   osg::Vec3Array* coords = new osg::Vec3Array(4); 
   (*coords)[0].set(-1.0f,0.0f,1.0f); 
   (*coords)[1].set(-1.0f,0.0f,-1.0f); 
   (*coords)[2].set(1.0f,0.0f,-1.0f); 
   (*coords)[3].set(1.0f,0.0f,1.0f); 
   geom-setVertexArray(coords); 

   osg::Vec3Array* norms = new osg::Vec3Array(1); 
   (*norms)[0].set(0.0f,-1.0f,0.0f); 
   geom-setNormalArray(norms); 
   geom-setNormalBinding(osg::Geometry::BIND_OVERALL); 

   osg::Vec2Array* tcoords = new osg::Vec2Array(4); 
   (*tcoords)[0].set(0.0f,0.0f); 
   (*tcoords)[1].set(0.0f,textureCoordMax); 
   (*tcoords)[2].set(textureCoordMax,textureCoordMax); 
   (*tcoords)[3].set(textureCoordMax,0.0f); 
   geom-setTexCoordArray(0,tcoords); 

   geom-addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,0,4)); 

   return geom; 
} 

//-- 
int main(int argc, char **argv) 
{ 
   // construct the scene 
   osg::Group* node = new osg::Group(); 
   osg::Drawable* quad = createSquare2(); 
   osg::Geode* geode = new osg::Geode(); 
   geode-addDrawable(quad); 
   node-addChild(geode); 

   // construct the viewer. 
   osgViewer::Viewer* viewer = new osgViewer::Viewer(); 
   unsigned int screenWidth; 
   unsigned int screenHeight; 
   
osg::GraphicsContext::getWindowingSystemInterface()-getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0),
 screenWidth, screenHeight); 
   unsigned int windowWidth = 640; 
   unsigned int windowHeight = 480; 
   viewer-setUpViewInWindow((screenWidth-windowWidth)/2, 
(screenHeight-windowHeight)/2, windowWidth, windowHeight); 
   viewer-setThreadingModel(osgViewer::Viewer::SingleThreaded); 

   // stateset 
   osg::StateSet *stateSet = quad-getOrCreateStateSet(); 

   // texture 
   osg::Texture2D* texture = new osg::Texture2D; 
   osg::Image* image = 
osgDB::readImageFile(C:\\projects\\exampleOsg1\\Data\\Images\\lz.rgb); 
   if (!image) 
   { 
  std::cout   couldn't find texture, quiting.  std::endl; 
  return 1; 
   } 
   texture-setImage(image); 
   osgPPU::UnitTexture* unitTexture= new osgPPU::UnitTexture(texture); 

   
//
 
   // First 
   osgPPU::UnitInOut* unitInOut= new osgPPU::UnitInOut(); 
   unitInOut-setInputToUniform(unitTexture,textureNameInShader,true); 
   osgPPU::ShaderAttribute* shaderAttribute= new osgPPU::ShaderAttribute(); 
   { 
  osg::Shader* shader= new osg::Shader(osg::Shader::FRAGMENT); 
  const char* shaderSource= 
 uniform sampler2D textureNameInShader;\n 

Re: [osg-users] bluring model edges

2010-03-24 Thread Allen Saucier
Hi,

does anyone know where the examples are for using osgPPU? I can not find any on 
his sight. And documentation, too, that is more than the class layout offered 
on the sight.  I need deeper explanations than just class/method blurbs. 

Thank you!

Cheers,
Allen

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=26073#26073





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] bluring model edges

2010-03-24 Thread Allen Saucier
Hi,
Thx! I found them.

Cheers,
Allen

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=26103#26103





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] bluring model edges

2010-03-24 Thread Allen Saucier
Guy and Julia
I still can not get this code snippet to work.

Would you please tell me what I might be missing?  I've provided my sample code 
and have commented out the code snippet below because I could never see any 
changes.


Guy wrote:
 Julia,
 
 I never tried it but you should enable GL_POLYGON_SMOOTH, and enable
 alpha blending for the object you want to 'blur'.
 
 For example:
 
   osg::StateSet * stateset = geode-getOrCreateStateSet();
   stateset-setMode(GL_POLYGON_SMOOTH, osg::StateAttribute::ON);
 
 
   osg::BlendFunc *fn = new osg::BlendFunc();
   fn-setFunction(osg::BlendFunc::SRC_ALPHA,  
   osg::BlendFunc::ONE_MINUS_SRC_ALPHA);
 
   
   stateset-setAttributeAndModes(fn,
   osg::StateAttribute::ON);
   stateset-setMode(GL_BLEND, osg::StateAttribute::ON);
   stateset-setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
 
 Good luck,
 Guy.
 
 Hi,
 
 Is it possible to blur the edges of a model in OSG with whatever is
 behind?
 Currently the edges of the models in my scene are too sharp and would
 look better if there was a translucent overlap at the edges.
 
 Is this possible to achieve in OSG, or is this kind of functionality
 more relevant to OpenGL?
 
 Thank you,
 Julia
 
 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=8918#8918
 
 
 
 
 
 ___
 osg-users mailing list
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
 g
 ___
 osg-users mailing list
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
  --
 Post generated by Mail2Forum


--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=26104#26104




Attachments: 
http://forum.openscenegraph.org//files/exampleosg1_185.cpp


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] bluring model edges

2010-03-18 Thread yann le paih
Hi,

Morphological Antialiasing (MLAA) is a Post Processing technique. you could
try with  osgPPU.

ie can this methodology be performed in milliseconds? :

Like other Post Processing technique, it's depend of your shader complexity
and your output resolution.

An example :

http://www.highdefforum.com/gaming-systems/107094-mlaa-technique-can-give-results-4x-better-than-16x-msaa.html



-- 
Yann Le Paih
Keraudrono
56150 BAUD
Portable: +33(0)610524356
lepaih.y...@gmail.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] bluring model edges

2010-03-18 Thread Allen Saucier
Guy, I have tried this code snippet, too, and I am not getting any results.  
None.  No changes in the look of my model or a constructed pyramid.  Could you 
perhaps tell me what I am missing?

I have attached my blend app, which is a direct copy of the blendequation app 
from the OSG website.  I commented out the blend equation code  dropped this 
snippet in.

Thanks.


Guy wrote:
 
 For example:
 
   osg::StateSet * stateset = geode-getOrCreateStateSet();
   stateset-setMode(GL_POLYGON_SMOOTH, osg::StateAttribute::  ON);
 
 
   osg::BlendFunc *fn = new osg::BlendFunc();
   fn-setFunction(osg::BlendFunc::SRC_ALPHA,  
   osg::BlendFunc::ONE_MINUS_SRC_ALPHA);
 
   
   stateset-setAttributeAndModes(fn,
   osg::StateAttribute:: ON);
   stateset-setMode(GL_BLEND, osg::StateAttribute:: ON);
   stateset-setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
 
 


--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=25799#25799




Attachments: 
http://forum.openscenegraph.org//files/main_blendexample_210.cpp


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] bluring model edges

2010-03-18 Thread Allen Saucier
Thank you Yann.

Does anyone know how to install osgPPU on windows?  I'm close but I am getting 
errors that gl.h can not be found, yet I've installed OSG by following the osg 
installation method given for windows xp.

I had to install cudatoolkit from nVida - I'm running on an nVidia card: 9600gt.

So, I used CMake on osgPPU to build an MSVS 2005 sln for osgPPU.  Well, all 
compiles well except for cudakernel, which seems to require the openGL  gl.h 
file.

Or is this question best asked in another thread all-together?


yann le paih wrote:
 Hi,
 
 Morphological Antialiasing (MLAA) is a Post Processing technique. you could 
 try with  osgPPU.
 
 ie can this methodology be performed in milliseconds? :
 
 Like other Post Processing technique, it's depend of your shader complexity 
 and your output resolution.
 
 An example : 
    
 http://www.highdefforum.com/gaming-systems/107094-mlaa-technique-can-give-results-4x-better-than-16x-msaa.html
  
 (http://www.highdefforum.com/gaming-systems/107094-mlaa-technique-can-give-results-4x-better-than-16x-msaa.html)
 
 
 -- 
 Yann Le Paih
 Keraudrono
 56150 BAUD
 Portable: +33(0)610524356
  ()
 
  --
 Post generated by Mail2Forum


--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=25845#25845





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] bluring model edges

2010-03-17 Thread yann le paih
Hi,

Morphological Antialiasing maybe an other solution :
http://visual-computing.intel-research.net/publications/publications.htm
http://visual-computing.intel-research.net/publications/mlaa.pdf
http://visual-computing.intel-research.net/publications/testMLAA.zip

Yann






On Tue, Mar 16, 2010 at 8:28 PM, Harash Sharma harashsha...@yahoo.comwrote:

 Hi Julia, Allen,



 I have one solution that most probably seems to be wht you are looking
 for. I have been using OSG for doing some image processing. Thanks to Mr.
 Art Tevs' osgPPU.



 Render the scene to a texture T1, High pass filter this image using a
 shader to extract the edges (store to T2), followed by a Gaussian filtering
 of T2. Overlay this processed image over the original with a weight factor.



 Scene -- T1 -- [HighPass] -- T2 -- [Gaussian(LowPass)] --
 T3-|

 |
 +-- T4 -- Output to Framebuffer

 ||

 Regards

 Harash
  --
 *From:* Allen Saucier allen.sauc...@itt.com
 *To:* osg-users@lists.openscenegraph.org
 *Sent:* Tue, March 16, 2010 8:27:51 PM
 *Subject:* Re: [osg-users] bluring model edges

 Hi,

 I am in need of this type of feature, too.  I need to be able to take a
 model  fuzz it's edges, though I must admit that I don't fully understand
 the code given, I'll try this.

 Thanks Guy for the ideas.

 Cheers,
 Allen

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=25726#25726





 ___
 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




-- 
Yann Le Paih
Keraudrono
56150 BAUD
Portable: +33(0)610524356
lepaih.y...@gmail.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] bluring model edges

2010-03-17 Thread Allen Saucier
Hi Harash.  Well, I truly do not know what you're talking about but I kinda 
understand in principle.  Would your methodology work in a real time simulation 
- ie can this methodology be performed in milliseconds?

2nd question: where would I start?
I've no idea how to render a scene to a texture let alone where to even find a 
high pass filter.  Would you explain how to do this in osg?

Thanks Harash. :)


Harash Sharma wrote:
 Hi Julia, Allen,
 
 
 I have one solution that most probably seems to be wht you are looking for. I 
 have been using OSG for doing some image processing. Thanks to Mr. Art Tevs' 
 osgPPU. 
 
 Render the scene to a texture T1, High pass filter this image using a shader 
 to extract the edges (store to T2), followed by a Gaussian filtering of T2. 
 Overlay this processed image over the original with a weight factor.  
 
 Scene -- T1 -- [HighPass] -- T2 -- [Gaussian(LowPass)] -- T3-|   
 | +-- T4 -- Output to Framebuffer
 ||
 
 
 Regards
 
 Harash
 
 From: Allen Saucier 
 To: 
 Sent: Tue, March 16, 2010 8:27:51 PM
 Subject: Re:  bluring model edges
 
 Hi,
 
 I am in need of this type of feature, too. I need to be able to take a model 
  fuzz it's edges, though I must admit that I don't fully understand the 
 code given, I'll try this.
 
 Thanks Guy for the ideas.
 
 Cheers,
 Allen
 
 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=25726#25726
 
 
 
 
 
 ___
 osg-users mailing list
  ()
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
  --
 Post generated by Mail2Forum


--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=25761#25761





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] bluring model edges

2010-03-17 Thread Allen Saucier
Yann, can this be perfomed in OSG?


yann le paih wrote:
 Hi,
 
 Morphological Antialiasing maybe an other solution :
 http://visual-computing.intel-research.net/publications/publications.htm 
 (http://visual-computing.intel-research.net/publications/publications.htm)
 http://visual-computing.intel-research.net/publications/mlaa.pdf 
 (http://visual-computing.intel-research.net/publications/mlaa.pdf)
 http://visual-computing.intel-research.net/publications/testMLAA.zip 
 (http://visual-computing.intel-research.net/publications/testMLAA.zip)
 
 Yann
 
 
 
 
 
 
 On Tue, Mar 16, 2010 at 8:28 PM, Harash Sharma  () wrote:
 
   Hi Julia, Allen,
  
    
      I have one solution that most probably seems to be wht you are looking 
  for. I have been using OSG for doing some image processing. Thanks to Mr. 
  Art Tevs' osgPPU. 
    
      Render the scene to a texture T1, High pass filter this image using a 
  shader to extract the edges (store to T2), followed by a Gaussian filtering 
  of T2. Overlay this processed image over the original with a weight factor. 
   
       
      Scene -- T1 -- [HighPass] -- T2 -- [Gaussian(LowPass)] -- 
  T3-|       
  |   
   +-- T4 -- Output to Framebuffer
      
  ||
  
   
  Regards
   
  Harash
  
  From: Allen Saucier  ()
  To:  ()
  Sent: Tue, March 16, 2010 8:27:51 PM
  Subject: Re:  bluring model edges
  
  
  Hi,
  
  I am in need of this type of feature, too.  I need to be able to take a 
  model  fuzz it's edges, though I must admit that I don't fully 
  understand the code given, I'll try this.
  
  Thanks Guy for the ideas.
  
  Cheers,
  Allen
  
  --
  Read this topic online here:
  http://forum.openscenegraph.org/viewtopic.php?p=25726#25726 
  (http://forum.openscenegraph.org/viewtopic.php?p=25726#25726)
  
  
  
  
  
  ___
  osg-users mailing list
   ()
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
  (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
  
  
  
  
  
  
  
  ___
  osg-users mailing list
   ()
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
  (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
  
  
 
 
 
 -- 
 Yann Le Paih
 Keraudrono
 56150 BAUD
 Portable: +33(0)610524356
  ()
 
  --
 Post generated by Mail2Forum


--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=25762#25762





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] bluring model edges

2010-03-17 Thread Harash Sharma
Hi Allen,

    Yes, This principle does work in real time. I do a more intense computation 
and am still able to get 60+ fps. For this you need to use osgPPU in your 
project. This library allows you to define your Post Processing pipeline. Mr. 
Art Tevs has provided some very good examples with the library. 

    Your Processing pipeline consists of a bypass unit (to bring the rendered 
frame into the pipeline), followed by an arrangement of I/O units where the 
processing of each unit can be defined by means of shader programs (like in 
your case the filters will have to be implemented as shaders) and finally an 
Out unit to display the result. 

    I will suggest that you kindly download and go thru osgPPU examples 
(especially osgPPUGlow) as this more or less works in the way you require.


Regards

Harash. 





From: Allen Saucier allen.sauc...@itt.com
To: osg-users@lists.openscenegraph.org
Sent: Wed, March 17, 2010 8:46:50 PM
Subject: Re: [osg-users] bluring model edges

Hi Harash.  Well, I truly do not know what you're talking about but I kinda 
understand in principle.  Would your methodology work in a real time simulation 
- ie can this methodology be performed in milliseconds?

2nd question: where would I start?
I've no idea how to render a scene to a texture let alone where to even find a 
high pass filter.  Would you explain how to do this in osg?

Thanks Harash. :)


Harash Sharma wrote:
 Hi Julia, Allen,
 
 
 I have one solution that most probably seems to be wht you are looking for. I 
 have been using OSG for doing some image processing. Thanks to Mr. Art Tevs' 
 osgPPU. 
 
 Render the scene to a texture T1, High pass filter this image using a shader 
 to extract the edges (store to T2), followed by a Gaussian filtering of T2. 
 Overlay this processed image over the original with a weight factor.  
 
 Scene -- T1 -- [HighPass] -- T2 -- [Gaussian(LowPass)] -- T3-|  
 | +-- T4 -- Output to Framebuffer
 ||
 
 
 Regards
 
 Harash
 
 From: Allen Saucier 
 To: 
 Sent: Tue, March 16, 2010 8:27:51 PM
 Subject: Re:  bluring model edges
 
 Hi,
 
 I am in need of this type of feature, too. I need to be able to take a model 
  fuzz it's edges, though I must admit that I don't fully understand the 
 code given, I'll try this.
 
 Thanks Guy for the ideas.
 
 Cheers,
 Allen
 
 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=25726#25726
 
 
 
 
 
 ___
 osg-users mailing list
  ()
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
  --
 Post generated by Mail2Forum


--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=25761#25761





___
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] bluring model edges

2010-03-16 Thread Allen Saucier
Hi,

I am in need of this type of feature, too.  I need to be able to take a model  
fuzz it's edges, though I must admit that I don't fully understand the code 
given, I'll try this.

Thanks Guy for the ideas.

Cheers,
Allen

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=25726#25726





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] bluring model edges

2010-03-16 Thread Harash Sharma
Hi Julia, Allen,
 
    I have one solution that most probably seems to be wht you are looking for. 
I have been using OSG for doing some image processing. Thanks to Mr. Art Tevs' 
osgPPU.
 
    Render the scene to a texture T1, High pass filter this image using a 
shader to extract the edges (store to T2), followed by a Gaussian filtering of 
T2. Overlay this processed image over the original with a weight factor. 
    
    Scene -- T1 -- [HighPass] -- T2 -- [Gaussian(LowPass)] -- 
T3-|  
    
|   
 +-- T4 -- Output to Framebuffer
    
||


Regards

Harash



From: Allen Saucier allen.sauc...@itt.com
To: osg-users@lists.openscenegraph.org
Sent: Tue, March 16, 2010 8:27:51 PM
Subject: Re: [osg-users] bluring model edges

Hi,

I am in need of this type of feature, too.  I need to be able to take a model  
fuzz it's edges, though I must admit that I don't fully understand the code 
given, I'll try this.

Thanks Guy for the ideas.

Cheers,
Allen

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=25726#25726





___
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] bluring model edges

2009-03-26 Thread Julia Guo
oh really so it is meant to just effect the edges? That is great to know that 
this functionality is supported. 
I wonder why it causes the skeleton of the model to show through (see attached 
screenshot for what Im talking about)

I am not very familiar with the OpenGL state settings - do you know of any 
potentially relevant settings that might help?

Julia

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=9259#9259



attachment: dumptruck.jpg___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] bluring model edges

2009-03-26 Thread Guy

Hi Julia,
 If you use pure OpenGL to render the model, with the polygon smooth
state enabled, does it have the same effect?

Guy.
--


oh really so it is meant to just effect the edges? That is great to know
that this functionality is supported. 
I wonder why it causes the skeleton of the model to show through (see
attached screenshot for what Im talking about)

I am not very familiar with the OpenGL state settings - do you know of
any potentially relevant settings that might help?

Julia

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=9259#9259



___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] bluring model edges

2009-03-24 Thread Julia Guo
hi Guy,

I tried this code and didn't notice any blurring, although for some reason the 
skeleton in my models became exposed (the same effect as the osgscribe 
example). 
If I understand right this example is meant to blur the entire model - is that 
right? Because I just want to blur the model edges while keeping the rest of 
the model clear. Is there a way to do that?

thanks for the example,
Julia

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=9048#9048





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] bluring model edges

2009-03-24 Thread Guy

Well,
 It should have given fractional alpha values only on the object
edges...

It would be interesting if you could check your object using a pure
OpenGL code. Maybe it's a card issue, maybe there are other modes that
interfere...

Sorry it didn't help,
 Guy.
--


hi Guy,

I tried this code and didn't notice any blurring, although for some
reason the skeleton in my models became exposed (the same effect as the
osgscribe example). 
If I understand right this example is meant to blur the entire model -
is that right? Because I just want to blur the model edges while keeping
the rest of the model clear. Is there a way to do that?

thanks for the example,
Julia

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=9048#9048





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] bluring model edges

2009-03-23 Thread Julia Guo
Hi,

Is it possible to blur the edges of a model in OSG with whatever is behind?
Currently the edges of the models in my scene are too sharp and would look 
better if there was a translucent overlap at the edges.

Is this possible to achieve in OSG, or is this kind of functionality more 
relevant to OpenGL?

Thank you,
Julia

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=8918#8918





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] bluring model edges

2009-03-23 Thread Guy

Julia,

I never tried it but you should enable GL_POLYGON_SMOOTH, and enable
alpha blending for the object you want to 'blur'.

For example:

osg::StateSet * stateset = geode-getOrCreateStateSet();
stateset-setMode(GL_POLYGON_SMOOTH, osg::StateAttribute::ON);


osg::BlendFunc *fn = new osg::BlendFunc();
fn-setFunction(osg::BlendFunc::SRC_ALPHA,  
osg::BlendFunc::ONE_MINUS_SRC_ALPHA);


stateset-setAttributeAndModes(fn,
osg::StateAttribute::ON);
stateset-setMode(GL_BLEND, osg::StateAttribute::ON);
stateset-setRenderingHint(osg::StateSet::TRANSPARENT_BIN);

Good luck,
Guy.

Hi,

Is it possible to blur the edges of a model in OSG with whatever is
behind?
Currently the edges of the models in my scene are too sharp and would
look better if there was a translucent overlap at the edges.

Is this possible to achieve in OSG, or is this kind of functionality
more relevant to OpenGL?

Thank you,
Julia

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=8918#8918





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org