[Cogl] Creating sliced textures from data and framebuffer

Robert Bragg robert at sixbynine.org
Wed Jan 25 02:30:13 PST 2012

>>> Otherwise... Do you see another reasonable way to use multiple sliced
>>> textures for multitexturing than a cogl_meta_texture_foreach_in_region
>>> variant that accepts multiple CoglMetaTextures and sets of texture
>>> coordinates and iterates over regions that don't cross borders of any of
>>> the native GL textures involved?
>> Cogl doesn't currently support multi-texturing on textures that are
>> composed of multiple GL textures. So if you are trying to use sliced
>> textures to circumvent the maximum texture size limits (ie, it actually
>> needs slicing) then you won't be able to use Cogl's multi-texturing
>> support. I think this is a fairly tricky problem to solve. However if
>> you are just trying to create non-power-of-two textures then they can be
>> represented as either a single texture with padding or can be put in an
>> atlas so either way it will be a single GL texture so multi-texturing
>> should work fine.
> What do you think about my suggestion about a new "foreach" function?
> Should it not be possible to use that to allow multitexturing with
> sliced textures?

Yeah, potentially it could be useful for Cogl to also provide a
utility mechanism to help support multitexturing with multiple sliced
textures. We have a comment in cogl-primitives.c as I recall saying
that we should support this one day. It's something we've considered a
few times, but I think we'd only want to try handling cases where all
the textures are aligned and perhaps allowing an offset for each
layer. Often when multitexturing it can be desirable to use all kinds
of texture coordinate transforms for each of the textures (such as
rotations and scales) but I think it could very quickly get
out-of-hand if we tried to provide a general solution that tried to
handle multiple sliced layers with rotations too. I get the impression
you wouldn't need support for transformed layers when multitexturing
so hopefully that would be ok for you?

kind regards,
- Robert

I'm really jealous you have a Pandora device; I'm *still* waiting for
mine to be shipped (over a year now) :-)

More information about the Cogl mailing list