[osg-submissions] 2D Array Textures (EXT_texture_array for osg)
Art Tevs
stud_info2 at yahoo.de
Fri Sep 7 04:11:31 PDT 2007
Hi Robert.
Thank you. I agree with the fact that we do not have
to support non competent users ;-)
Yesterday I submitted integer texture patch. Take a
look. They seems wo work fine for me.
However I have not tested if there is a problem when I
generate them dynamicaly (so by creating an empty
texture and then rendering to it). This require some
changes to the osg::Program to support
glBindFragDataLocation, so that shaders can output
integer fragments to certain MRTs.
The changes to the osg::Program and osg::GL2Extensions
are already implemented by me. I am going now for the
lunch afterwards I will test it. So I will submit the
new patch probably in couple of hours to the list.
This would just implement two new features from the SM
4.0 glBindFragDataLocationEXT and
glGetFragDataLocationEXT.
Cheers,
Art
--- Robert Osfield <robert.osfield at gmail.com> schrieb:
> Hi Art,
>
> I have now merged and submitted your changes to SVN.
>
> I had to add an extension check to Image.cpp to
> protect the check
> against the image enable otherwise this will
> generate and GL error on
> non 8 series class hardware.
>
> Modifications to prevent apply texture array when
> using fixed function
> pipeline is not required as users can only access
> texture arrays from
> shaders, if they aren't using shaders then won't (if
> they know what
> they are doing) attach texture arrays. Its a bit
> like attaching
> Uniforms - one simply doesn't attach them if you
> don't need them.
> Also trying to implement such nanny approach to
> prevent some users
> from apply state inappropriately would be add
> complexity, slow the OSG
> down all for avoiding a problem that is really is a
> case of garbage in
> garbage out - we don't want to penalize the
> competent because others
> less competent might screw up.
>
> I haven't yet been able to test the new class, so an
> example that
> tests it out would be very welcome. Also still
> missing is .osg and
> .ive support for the new Texture2DArray. I also
> wonder if one might
> be able reuse more of the Texture3D implementation
> in the
> Texture2DArray implementation, as alot of the code
> is common.
>
> Robert.
>
> On 7/24/07, Art Tevs <stud_info2 at yahoo.de> wrote:
> > Hi Robert,
> >
> > OK, thanks.
> >
> > P.S. As soon as you get the G80 you will love it
> ;-)))
> >
> > --- Robert Osfield <robert.osfield at gmail.com>
> schrieb:
> >
> > > Hi Art,
> > >
> > > I don't yet have a 8800, so can't yet test any
> of
> > > the new extensions.
> > > I have an 8800GTS on order and when it arrives
> and I
> > > have a quiet
> > > spell I'll sit down review the extension docs
> and
> > > your submissions.
> > > Right now I can't test or know enough about the
> new
> > > extensions to
> > > attempt a review.
> > >
> > > I might be a week or so before I can get this
> > > review.
> > >
> > > Robert.
> > >
> > > On 7/24/07, Art Tevs <stud_info2 at yahoo.de>
> wrote:
> > > > Hi folks, Hi Robert.
> > > >
> > > > Here is my submission for the osg.
> Description:
> > > >
> > > >
> > >
> ----------------------------------------------------
> > > >
> > > > A new texture class Texture2DArray derived
> from
> > > > Texture extends the osg to support the new
> > > > EXT_texture_array extensions. Texture arrays
> > > provides
> > > > a feature for people interesting in GPGPU
> > > programming.
> > > >
> > > >
> > > > Faetures and changes:
> > > >
> > > > - Full support for layered 2D textures.
> > > >
> > > > - New uniform types were added
> (sampler2DArray)
> > > >
> > > > - FrameBufferObject implementation were
> changed to
> > > > support attaching of 2D array textures to the
> > > > framebuffer
> > > >
> > > > - osgUtil/RenderState is changed to enable
> render
> > > to
> > > > texture mode for array textures.
> > > >
> > > > - StateSet was slightly changed to support
> texture
> > > > arrays. NOTE: array textures can not be used
> in
> > > fixed
> > > > function pipeline. Thus using the layered
> texture
> > > as a
> > > > statemode for a Drawable produce invalid
> enumerant
> > > > OpenGL errors.
> > > >
> > > > - Image class was extended to support handling
> of
> > > > array textures
> > > >
> > > > Tests:
> > > > I have used this class as a new feature of my
> > > > application. It works for me without problems
> > > (Note:
> > > > Texture arrays were introduced only for
> shading
> > > > languages and not for fixed function
> > > pipelines!!!).
> > > > RTT with Texture2DArray works, as I have
> tested
> > > them
> > > > as texture targets for a camera with 6
> > > layers/faces
> > > > (i.e. replacement for cube maps). I am using
> the
> > > array
> > > > textures in shader programming. Array textures
> can
> > > be
> > > > attached to the FBO and used as input and as
> > > output.
> > > >
> > > > Must be done:
> > > > - Restrict user to bind an Texture2DArray to
> any
> > > > "Geode" (i.e. by setting up StateSet), such
> that
> > > they
> > > > can not be used for fixed function pipeline.
> > > Probably
> > > > a warning should be ok, when user call
> > > > osg::StateSet::setTextureAttributeAndModes(0,
> > > > texture2Darray, osg::StateAttribute::ON); with
> > > > texture2Darray as an instance of
> Texture2DArray
> > > class.
> > > >
> > > >
> > > > Should be done:
> > > > - Adding of Texture1DArray class.
> > > > - Support for integer texture
> EXT_texture_integer
> > > >
> > > >
> > > >
> > >
> ----------------------------------------------------
> > > >
> > > > Since I am working on an Shader Model 4.0
> > > application,
> > > > I will probably make more contributions to the
> > > osg,
> > > > which implements the new extensions. I was not
> > > able to
> > > > find out, if some one already working on them
> :-(
> > > Next
> > > > one is the EXT_geometry_shader4 and
> > > EXT_gpu_shader4.
> > > >
> > > > Thanks.
> > > >
> > > > Cheers, Art
> > > >
> > > > P.S. Please let me know if you add this
> > > contribution
> > > > to the svn or not. This would be very helpfull
> for
> > > > future developments.
> > > >
> > > >
> > > > __________________________________
> Alles
>
=== message truncated ===
________
Yahoo! Clever: Stellen Sie Fragen und finden Sie Antworten. Teilen Sie Ihr Wissen. www.yahoo.de/clever
More information about the osg-submissions
mailing list