Should be fixed in CVS now. Thanks for catching that.
hello,
i noticed that only the 1st texture can be change. this is due to a typo line 170 in glsl_program.cpp.
this line :
glUniform1i(m_loc[1], (GLint)m_param[i][0]);
should be change to this :
glUniform1i(m_loc[i], (GLint)m_param[i][0]);
now, it work ok here.
cyrille
chris clepper a écrit :
> CVS is updated. Hopefully this won't break anyone's compiles.
>
> The attached files are a test patch and the shaders. I will be out of
> town for a few days and not able to work on this again until next
> week.
>
> On 7/12/07, chris clepper <cgclepper@gmail.com> wrote:
>> I have multitexturing working with GLSL. While I upload the changes
>> to CVS I can explain how it works.
>>
>> GLSL shaders cannot directly talk to hardware like ARB ones can. The
>> application side code has to tell the shader which hardware texture
>> unit to use. Obviously when I compile GEM there is no way in hell to
>> know what the shader variables are going to be named, so another
>> method to tell the shader which unit to use needs to be in place.
>>
>> One solution is to hardcode the names of the sampler variables, but
>> that is kind of a hack. The one I put in place uses a message to the
>> glsl_program object with the name of the sampler and the texture unit
>> to use.
>>
>> How to use:
>>
>> 1) create gemwin and turn on rendering
>> 2) load shader
>> 3) send a [mySamplerName $1( message to glsl_program
>> 4) load two movies or images
>> 5) set one of the pix_texture units to upload to the same texture unit
>> you told the shader to use with a [texunit $1( message
>>
>> This change should be in CVS soon. I will post an example patch in a
>> bit.
>
>>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> PD-list@iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list