Hello,
Pardon me if I am jumping into the middle of this conversation, but
XRay rendering has been done before. Look at shader examples from
NVidia and others for volumetric fog and adapt them accordingly. The
basic approach is to use the depth buffer and subtraction to render
thickness as a bit field depth and then use that depth index for a
lookup into your "fog" texture (1D) to produce the desired visual
effect. Attenuation of the objects (different material parameters) can
be achieved by setting values in texture units 1, 2 or 3 of the model
(so you can still look at them visually). Modeling more advanced
features of X-Ray light (non-linear falloff, for example) can be
accomplished in the 1D lookup texture or it can be extended to a 2D or
even 3D texture. Very realistic effects that mix with "real" objects
can even be achieved.
Hope that helps,
- Paul
On Aug 11, 2009, at 1:15 PM, Art Tevs wrote:
Hello,
ryoumans wrote:
for the "thickness" it's actually a fixed data for the geometry
(not really thickness). It's only thickness in the analogue of the
x-ray model. It's geometry dependent data, and for starting out
adding this data item and/or having only the one value will do.
I'm just looking for the best design using osg. So with that,
maybe osgVolume is not necessary. I have userdata and/or node
callbacks to get this data for each geometry (e.g., Uniform
callback for the vertex shader all using the same var name).
OK, but your data must be view dependent. Otherwise how you would
imagine to have X-ray like view, if you just have per vertex data?
Or maybe I just don't really understand what you would like to have.
I found your slicing idea in osgppu interesting. So, given this
"thickness" as data and not requiring geometry calculation, how
would you see going at it?
Giving the thickness of data, I would render the object just as it
is and using a shader, I would compute the viewing direction for
each pixel (or vertex). Then having your view dependent data (so it
would be probably a 6D data, for each position in each viewing
direction. Or maybe 5D, for each position on surrounding sphere in
each viewing direction) I would just compute color based on this
thicknes.
I do not see currently any other way of rendering X-ray like 3D
models without having thickness data for each viewing direction and
viewing position. THe way I proposed, is the way how one could
compute this data on the fly. Maybe we can work out an example usng
osgPPU so that other people can profit from it ;)
cheers,
art
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=16110#16110
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org