[osg-users] Support for sampler arrays
Lionel Lagarde
lionel.lagarde at oktal-se.fr
Tue Mar 22 02:47:17 PDT 2016
Hi,
The OpenGL command used to update a sampler* uniform is glUniformi[fv].
Sampler* uniforms are int uniforms.
An uniform of type 'array of INT' works (It works for me).
On 22/03/2016 10:36, Sebastian Messerschmidt wrote:
> Hi Chris,
>> Hi,
>>
>> Working on an app that is going to be doing a lot of work with large
>> texture processing, and will need to squeeze as much data into
>> graphics memory as possible and allow many textures to be referenced
>> programmatically.
>>
>> I've got texture arrays working, but can't use this for all
>> requirements since all layers in a texture array have to be the same
>> size.
>
>>
>> It looks like I could use sampler arrays (e.g. sampler2D
>> myTextures[20]; ), but osg::Uniform doesn't seem to support such a
>> thing.
> Arrays of samplers is used almost by no one any more. I usually use
> TextureArrays and simply resize the textures to a common size (usually
> the "biggest"). Texture arrays are efficient and easy to use.
> I'd like to see the "array of sampler"-support in OSG anyways, since
> there might be situations where texture arrays are not efficient.
> Another alternative are bindless textures, but we would need to add
> support to OSG too.
> Last alternative could be a texture atlas.
>
> Since you mentioned "texture processing", you might want to look into
> BufferTextures. They don't have any filtering (only texelfetch), but
> IIRC they support large amounts of texels.
> So if you don't need HW-filtering/mipmapping you can use them as atlas
> textures.
>
> Cheers
> Sebastian
>>
>>
>> I'm also wondering if there's an easy way to easily run your own
>> OpenGL commands in case something isn't supported yet and you just
>> want to use GL directly instead of waiting for the OSG implementation?
>>
>> Thank you!
>>
>> Cheers,
>> Chris
>>
>> ------------------------
>> http://www.hrwallingford.com/facilities/ship-simulation-centre
>> (http://www.hrwallingford.com/facilities/ship-simulation-centre)
>>
>> ------------------
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=66577#66577
>>
>>
>>
>>
>>
>> _______________________________________________
>> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160322/528a99e4/attachment-0003.htm>
More information about the osg-users
mailing list