[osg-users] Drawing to Texture2D

Peter Wraae Marino osghelp at gmail.com
Sat Jul 12 23:04:15 PDT 2008


Hi James,

I believe you have to:

texture->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::NEAREST);

texture->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::NEAREST);
-- 
Regards,
Peter Wraae Marino

www.osghelp.com - OpenSceneGraph support site


On Sat, Jul 12, 2008 at 11:29 PM, James Dickson <james.dickson at gmail.com>
wrote:

> I decided to go down the route of writting my own line, circle etc
> algorithms as I only need a few, but I have hit a slight snag. :-( I have
> attached an image to show the effect I am getting, ideally I would like the
> Texture2D which is projected onto the billboard to be sharper? I.e the lines
> drawn on the white billboard not to have blurred edges. The texture
> resolution is 256x256, and increasing it only partially helps, are there any
> filters I can turn on\off for the texture to help fix it?
>
> Many thanks,
> James
>
> 2008/7/11 Jean-Sébastien Guay <jean-sebastien.guay at cm-labs.com>:
>
>> Hi James,
>>
>> I was wondering if it is possible to draw on a Texture2D instance. I know
>>> this isn't possible, but I am wondering if you can do the equivalent of:
>>> Texture2Dinstance->DrawCircle(x,y,r);
>>>
>>
>> OSG does not do 2D drawing to images. You can do your own by getting the
>> data pointer from an osg::Image and drawing pixels into that (if you feel
>> the need to write your own line, circle, flood-filling etc. algorithms :-)
>> ), or you can use an imaging library (ImageMagick, etc.) to make the image
>> and then get the data from that library and copy it into an osg::Image (or
>> perhaps even use the same pointer if it's a raw format). No need to save the
>> image to disk and re-read it with OSG.
>>
>> Hope this helps,
>>
>> J-S
>> --
>> ______________________________________________________
>> Jean-Sebastien Guay    jean-sebastien.guay at cm-labs.com
>>                               http://www.cm-labs.com/
>>                        http://whitestar02.webhop.org/
>>
>> _______________________________________________
>> osg-users mailing list
>> osg-users at lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
>
> --
> James Dickson
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>


-- 
Regards,
Peter Wraae Marino

www.osghelp.com - OpenSceneGraph support site
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080713/96372f27/attachment-0003.htm>


More information about the osg-users mailing list