[Cogl] Creating sliced textures from data and framebuffer

Tobias Hansen tobias.hansen at physik.uni-hamburg.de
Wed Jan 25 05:27:54 PST 2012


Robert Bragg wrote:
>>>> 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?
>
>
>   
We don't need rotations, but we do need scales. Would it get out of hand 
implementation or API wise?
API wise you could allow scales by just replacing most parameters of the 
current meta texture API with array pointers.
> P.S
> I'm really jealous you have a Pandora device; I'm *still* waiting for
> mine to be shipped (over a year now) :-)
>   

I don't have a Pandora. I just figured the Pandora forums would be a 
good place to look for testers for SLUDGE with gles2. After one day 
someone had it working, only the background textures are not shown, 
because they are too large.

Best regards,
Tobias


More information about the Cogl mailing list