[GEM-dev] glsl and texture

james tittle tigital at mac.com
Sat Aug 26 19:08:19 CEST 2006


hi,

On Aug 25, 2006, at 12:00 PM, cyrille henry wrote:
> i still don't understand how to load a jpg file to MyTex.
>
> attachement is my test patch.
> it does not render any texture.

...I've attached a modified version of your patch that works here,  
just reduces the brightness by half...

> chris clepper a écrit :
>> Use a texture sampler in your shader.  GLSL has a sampler for 2D  
>> and RECT texutres, so make sure you have the right one for the  
>> texture type (OSX defaults to RECT while Win/Linux are probably 2D).

...in other words, when using sampler2D, your texture needs to be  
dimensionally square (ie. 256x256)...also, [pix_texture] usually  
defaults to loading in "mode 1", which means rectangle textures:   
make sure you send [mode 0< to it before loading the texture...

...you'll also notice that I rearranged the ordering of operations  
within the gemchain:  this is because we want the program to affect  
the entire operation of drawing...

...I'll definitely try to work up some other examples while I'm still  
in hospital, but feeling well...

jamie

-------------- next part --------------
A non-text attachment was scrubbed...
Name: glsl_texture.pd
Type: application/octet-stream
Size: 3519 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/gem-dev/attachments/20060826/7fb21d8f/attachment.obj>


More information about the GEM-dev mailing list