> I would like to display these BRLCAD models by ray trace in
> Openscenegraph (yes, it will be slow!). I have done some searches
> through the archives and have not found a lot of info. It appears that
> I am going to have to use glReadPixels and glWritePixels prior to the
> swapbuffers (I am not using osgViewer yet). Does anyone know of a
> better method to render via ray trace in Openscenegraph?
If all you need is to ray trace an image, you could use a textured quad
instead of glWritePixels. I would probably be faster, especially if you
can somehow render to the same memory buffer as you use for the OpenGL
texture. But in any case, displaying the result of the raytrace is not
likely to be your bottleneck...
Note that in that case (as with glWritePixels), all you get is a 2D
image of your render. So if the user changes the point of view, you have
to re-render. Whereas your previous method, rendering to a point cloud,
at least gave you some 3D positions which you could orbit around and
examine. As long as you don't need specular shading (reflections, etc)
and your scene doesn't change, you don't need to re-render. Diffuse
shading is view independent, and with static geometry, the resulting 3D
points would stay valid even if the viewpoint changes.
It's a case of what you want to do at a higher level. I guess I don't
see the point of rendering to an image to display that image in OSG...
What do you use OSG for in that case? Is the viewpoint fixed? (just
curious...)
Hope this helps,
J-S
--
______________________________________________________
Jean-Sebastien Guay jean-seba...@cm-labs.com
http://www.cm-labs.com/
http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
The viewpoint in the simulation is not fixed. The "point cloud" was for interactive mode with the mouse. One of the main demo functions of the simulation is to create avi's, that can directly incorporated in PowerPoint (ie. you can show bright, shiny objects to manager types during presentations). I have various view scripts that can be set up to move the view during the simulation run /movie capture. The reasoning behind raytrace rendering is that "point cloud" objects do not really fit in with other lit and/or textured objects in the scene. Since avi's are being created, horrific frame rates during the capture, are not that big of an issue. I was just looking for other techniques before I went ahead and brute forced it with glReadPixels and glDrawPixels.
Thanks
The viewpoint in the simulation is not fixed. The "point cloud" was for interactive mode with the mouse. One of the main demo functions of the simulation is to create avi's, that can directly incorporated in PowerPoint (ie. you can show bright, shiny objects to manager types during presentations). I have various view scripts that can be set up to move the view during the simulation run /movie capture. The reasoning behind raytrace rendering is that "point cloud" objects do not really fit in with other lit and/or textured objects in the scene. Since avi's are being created, horrific frame rates during the capture, are not that big of an issue. I was just looking for other techniques before I went ahead and brute forced it with glReadPixels and glDrawPixels. Thanks __________ Information from ESET NOD32 Antivirus, version of virus signature database 3172 (20080610) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com
_______________________________________________ osg-users mailing list osg-...@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
__________ Information from ESET NOD32 Antivirus, version of virus signature database 3172 (20080610) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com
Stephen Haithcock
General Dynamics Land Systems
38500 Mound Rd.
Sterling Heights, MI 48310
MZ 436-40-15
(586) 825-8573
"Watkins, Steven
M CIV NSWCDD,
G24" To
<steven.m.watkins <osg-...@lists.openscenegraph.org
@navy.mil> >
Sent by: cc
osg-users-bounces
@lists.opensceneg Subject
raph.org [osg-users] Ray Tracing a BRLCAD
model in Openscenegraph
06/10/2008 07:36
AM
Please respond to
OpenSceneGraph
Users
<osg-users@lists.
openscenegraph.or
g>
Hi All
Thanks
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
This is an e-mail from General Dynamics Land Systems. It is for the intended recipient only and may contain confidential and privileged information. No one else may read, print, store, copy, forward or act in reliance on it or its attachments. If you are not the intended recipient, please return this message to the sender and delete the message and any attachments from your computer. Your cooperation is appreciated.
I'm confused by what you are actually need to do on the OSG side. You
talk about ray tracing on the OSG side, point clouds, and then talk
about glReadPixels/glDrawPixels, to me they seem un-related so
obviously I'm missing something key to what you are trying to do.
Could you explain for a high level what steps you are taking to create
the scene graph, what operations you need to do on it on the CPU/GPU
and how you need to present/get the results.
Robert.
________________________________
Thanks for the overview, it kinda makes a but more sense.
As general notes, if you can avoid glReadPixels and glDrawPixels calls
as these are both very slow, if you can avoid glReadPixels in your
alogirithm - try to use an algorithm that doesn't require this. In
you explanation it's not clear why you are doing a glReadPixels, and
what is in the frame buffer before you do the glReadPixels, so I can't
really comment on whether this is doable. Secondly a glDrawPixels is
really expensive, you are better off using an
osg::Texture2D/TextureRectangle with an
osg::Image/osg::PixelBufferObject combination for maximizing copy rate
from CPU to GPU.
I can't reconcile the word "simulation" with using ray tracing, I
presume this isn't a simulator you are developing, and not expect a
solid 60Hz.
Robert.
On Mon, Jun 16, 2008 at 12:42 PM, Watkins, Steven M CIV NSWCDD, G24
I really can't tell what you really need, but the OSG does support
render to texture pretty seamlessly, but I'd be surprised if weren't
already familar with this support i.e. osg::Camera's RTT support is
used all over the place, and demonstrated by osgprerender example and
may more besides.
Robert.
On Mon, Jun 16, 2008 at 2:44 PM, Watkins, Steven M CIV NSWCDD, G24
Don
>
>
> This works, in that the BRLCAD model is displayed as a "lit" model in the OpensceneGraph scene. Close up views occasionally show some subpixel? error. I was looking for a "better" method than above. I do realize that I am out in the wilderness with this one!
>
> Thanks
>
>
>
_______________________________________________