[osg-users] 回复: Re: multi translucent geometry

Rick Pingry rick at fringe-online.com
Tue Jul 15 08:07:38 PDT 2008


Thanks for the advice.  I will look into both of those options, I think they
will help.  Here is a picture of what I am working with so far.  It only
happens at certain angles so mostly it looks pretty good.  I know all of
these transparent images on top of each other seem to hit my framerate
pretty good.  Someday I would like to try out a shader and see if that helps
with all kinds of flares and light bloom effects and such (space games
are all about those kinds of effects).



2008/7/14 Peter Wraae Marino <osghelp at gmail.com>:

> Hi Rick,
>
> I agree with Paul.
>
> Turn off your z-buffer. If this effect is for thrusters then you should
> perhaps look into additive blending
> instead and this should create a better effect.. the more thrusters the
> brighter the become.
>
> A screenshot of your problem would help a lot (if possible).
>
> regards,
> Peter
> http://osghelp.com
>
>
> 2008/7/14 Paul Speed <pspeed at progeeks.com>:
>
> I'm no expert in this area but have had to do some pretty weird things
>> in the past to get transparency working right for some odd scenes...
>>
>> One thing you might try is to disable z-buffer writes (not tests) for
>> the flares.  Depending on your blending, this can add other types of
>> artifacts but I think in your case they will be very subtle... versus
>> the z-fighting you are seeing.  (You will obviously want them to be
>> drawn last just like normal transparency.)
>>
>> Just an idea...
>> -Paul
>>
>> Rick Pingry wrote:
>> > That reminds me of an issue I have not resloved yet.  Our space ships
>> > have thruster engines and I use an image map with transparency and point
>> > it back at the camera to make a pretty glow around it.  (First off, is
>> > this the best way to do it?  I have thought that perhaps a shader would
>> > work better, but I have not had a chance to learn about how to write
>> > shaders yet.  So much to learn, so little time).
>> >
>> > Anyway, In some ships there are banks of engines, and it is pretty easy
>> > to get the problem where these transparent images intersect with each
>> > other, and you get depth sorting issues that way.  I did work out a way
>> > to make these "engine flare images" point, rather than right at the
>> > camera, all along parallel lines with the camera's line of sight, and
>> > that helped tremendously, but you can still get in positions where the
>> > images happen to line up along the same depth, and you see some funky
>> > tearing and the like due to depth fighting.  Is there a way to handle
>> > this better? Should I try to apply other bins to the different engines?
>> > What are the rules wrt that?   It sounds like I need to read up on the
>> > glDepth and osg::Depth.  Any other recommendations?  I was running into
>> > problems rendering planet halos too.  Should the halo be in front of the
>> > planet or behind it?  probably the same kind of thing going on.
>> >
>> > Regards,
>> > -- Rick
>> >
>> > 2008/7/13 小 杨 <ygwbjut at yahoo.com.cn <mailto:ygwbjut at yahoo.com.cn>>:
>> >
>> >     Thanks! I'll try it!
>> >
>> >     */Peter Wraae Marino <osghelp at gmail.com
>> >     <mailto:osghelp at gmail.com>>/* 写道:
>> >
>> >         Hi ?? (can't see your name),
>> >
>> >         Are you sure zbuffer isn't falling for your 2nd geometry object?
>> >         Also
>> >         having equal depths is probably not a good idea? You need to
>> >         render your
>> >         objects from back to front order.
>> >
>> >         When you have transparent objects you should set the stateset
>> >         stateset->setRenderBinDetails(10,"DepthSortedBin");
>> >         this will render the objects from back to front order...
>> >         but note they will not sort the polygons for the individual
>> >         geometry.
>> >
>> >
>> >
>> >
>> >         2008/7/13 小 杨 <ygwbjut at yahoo.com.cn
>> >         <mailto:ygwbjut at yahoo.com.cn>>:
>> >
>> >             multi  translucent geometry   with equal depth but  alpha
>> >             value is not equal.
>> >
>> >             when i render these geometry ,i can not see all geometry!
>> Why ?
>> >
>> >             Can everyone give me some advice!
>> >
>> >             Thanks!
>> >
>> ------------------------------------------------------------------------
>> >             雅虎邮箱,您的终生邮箱! <http://cn.mail.yahoo.com/>
>> >
>> >             _______________________________________________
>> >             osg-users mailing list
>> >             osg-users at lists.openscenegraph.org
>> >             <mailto:osg-users at lists.openscenegraph.org>
>> >
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>> >
>> >
>> >
>> >
>> >         --
>> >         Regards,
>> >         Peter Wraae Marino
>> >
>> >         www.osghelp.com <http://www.osghelp.com/> - OpenSceneGraph
>> >         support site _______________________________________________
>> >
>> >         osg-users mailing list
>> >         osg-users at lists.openscenegraph.org
>> >         <mailto:osg-users at lists.openscenegraph.org>
>> >
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>> >
>> >
>> >
>> ------------------------------------------------------------------------
>> >     雅虎邮箱,您的终生邮箱! <http://cn.mail.yahoo.com/>
>> >
>> >
>> >     _______________________________________________
>> >     osg-users mailing list
>> >     osg-users at lists.openscenegraph.org
>> >     <mailto:osg-users at lists.openscenegraph.org>
>> >
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>> >
>> >
>> >
>> >
>> > --
>> >  >> Rick
>> > Check us out at http://fringe-online.com/
>> >
>> >
>> > ------------------------------------------------------------------------
>>  >
>> > _______________________________________________
>> > osg-users mailing list
>> > osg-users at lists.openscenegraph.org
>> >
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>> _______________________________________________
>> 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
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>


-- 
>> Rick
Check us out at http://fringe-online.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080715/3f61700e/attachment-0003.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ripped engines.jpg
Type: image/jpeg
Size: 45878 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080715/3f61700e/attachment-0003.jpg>


More information about the osg-users mailing list