Oh, no texture array support in QC? Well, it's still possible with
conditionals, maybe with some performance expense. Something like:

vec4 pixel = gl_Color.r == 1.0 ? texture2D(texture1,
gl_TexCoord[0].xy) : texture2D(texture2, gl_TexCoord[0].xy);

Chris


On 17 March 2010 10:34, Alex Drinkwater <[email protected]> wrote:
> You'd need to store the texture array as a single texture, though (like an 
> old-style 2D computer game 'sprite sheet'), then you could use the colour 
> input to each geometry instance to offset texture coordinates to select the 
> desired cell of the grid, to show the correct texture.
>
> a|x
>
>
>
> --- On Wed, 17/3/10, Chris Wood <[email protected]> wrote:
>
>> From: Chris Wood <[email protected]>
>> Subject: Re: single GLSL shader with multiple texture
>> To: "thomas pachoud" <[email protected]>
>> Cc: [email protected]
>> Date: Wednesday, 17 March, 2010, 10:06
>> Just to be clear, you can have one
>> shader applied to multiple objects
>> but it will apply the same texture/effect/whatever to every
>> object.
>> Fine if you want say lighting applied to everything, but
>> not if you
>> want separate textures.
>>
>> One solution: give each object a unique colour, and use the
>> colour to
>> select a texture from an array by index.
>>
>> Chris
>>
>> On 17 March 2010 09:51, thomas pachoud <[email protected]>
>> wrote:
>> > Hi,
>> > not 100% sure, but I don't think you can use one
>> single GLSL for multiple
>> > objects. You should use one GLSL applied to each
>> objects. In this way, each
>> > objects will apply the same GLSL with his textures and
>> 3D positionning and
>> > lighting information. And if you need to act on full
>> scene, you should add
>> > one GLSL at the end of your pipeline, playing on your
>> 2D final rendering.
>> > On Tue, Mar 16, 2010 at 9:35 AM, George Toledo <[email protected]>
>> wrote:
>> >>
>> >> I may be wrong, but I don't believe that is
>> possible in QC. What you would
>> >> need to do is use a separate shader for each
>> object. GLSL in QC does support
>> >> multiple textures, but I don't think one can
>> assign them to arbitrary
>> >> objects in the scene.
>> >> I'm curious about this as well... I've
>> successfully used GLSL in QC to
>> >> send many different image sources to a shader, and
>> to use the shader to
>> >> crop, translate and dissolve, but that is in the
>> context of a 2D surface.
>> >> Is there a downside to putting each object in a
>> separate GLSL macro, and
>> >> using distinct textures for each in your scenario?
>> You can always connect
>> >> the join the lighting of each (or any other
>> parameter) with insert
>> >> splitters, so your multiple shaders can look
>> cohesive in the scene when you
>> >> move a light source (or whatever).
>> >> -George Toledo
>> >>
>> >> On Mon, Mar 15, 2010 at 7:11 AM, luca palmili
>> <[email protected]>
>> wrote:
>> >>>
>> >>> Hi to all,
>> >>> my scene is composed by N objects (o1, o2...,
>> oN), each of them has got
>> >>> one different texture (t1, t2, ..., tN). How
>> can I render all the objects in
>> >>> a single GLSL shader? I mean: if I pass my N
>> texture as uniform parameters
>> >>> to the GLSL shader, how can I tell to the GLSL
>> shader to use texture_1 for
>> >>> object_1, texture_2 for object_2, etc...?
>> >>> Thank you!
>> >>>
>> >>>
>>  _______________________________________________
>> >>> Do not post admin requests to the list. They
>> will be ignored.
>> >>> Quartzcomposer-dev mailing list      ([email protected])
>> >>> Help/Unsubscribe/Update your Subscription:
>> >>>
>> >>> http://lists.apple.com/mailman/options/quartzcomposer-dev/gtoledo3%40gmail.com
>> >>>
>> >>> This email sent to [email protected]
>> >>
>> >>
>> >>  _______________________________________________
>> >> Do not post admin requests to the list. They will
>> be ignored.
>> >> Quartzcomposer-dev mailing list      ([email protected])
>> >> Help/Unsubscribe/Update your Subscription:
>> >>
>> >> http://lists.apple.com/mailman/options/quartzcomposer-dev/thomas.pachoud%40gmail.com
>> >>
>> >> This email sent to [email protected]
>> >
>> >
>> >
>> > --
>> > Thomas Pachoud
>> > ingénieur multimédia IMAC
>> > www.creapach.fr
>> >
>> >  _______________________________________________
>> > Do not post admin requests to the list. They will be
>> ignored.
>> > Quartzcomposer-dev mailing list      ([email protected])
>> > Help/Unsubscribe/Update your Subscription:
>> > http://lists.apple.com/mailman/options/quartzcomposer-dev/psonice%40gmail.com
>> >
>> > This email sent to [email protected]
>> >
>>  _______________________________________________
>> Do not post admin requests to the list. They will be
>> ignored.
>> Quartzcomposer-dev mailing list      ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/quartzcomposer-dev/the_voder%40yahoo.co.uk
>>
>> This email sent to [email protected]
>>
>
>
>
>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to