Hi Franz.

I hit this problem too.

There are two reason this may not be working for you,
as far as I can tell.

1. Not all graphics hardware supports Sampler2D input
to a vertex shader
2. There's a but in QC that means only still images
can be input to a vertex shader.

I tried to get an answer on whether this was ever
likely to be fixed, but nobody responded,
unfortunately.

There is a more universally-compatible way of doing
something similar, using something called VBOs (Vertex
Buffer Objects), but I'm not sure that method can be
implemented in GLSL. You'd probably have to write a
custom QC plugin using OpenGL commands.

You could also try compiling the GLHeightfield plugin
example XCode project in the Developer examples
folder. This is able to generate a mesh from an input
image. The only problem is, you can't texture the mesh
with the image, or light it effectively with the
Lighting patch. Vade has tried altering the plugin to
allow for texturing of the mesh, but I don't think he
managed to get it to work, sadly.

Hope this helps,


alx
QC blog: http://machinesdontcare.blogspot.com
Music projects: http://www.toneburst.net



--- "".François WUNSCHEL"" <[EMAIL PROTECTED]> wrote:

> Hi,
> I'm having a real problem when using a GLSL shader
> and feeding a  
> Sampler2D with animated images.
> It works nicely with regular static images, but
> leads to a QC crash  
> when connecting a  Render to Texture based image, or
> even when adding  
> a CIfilter like BoxBlur into the image chain.
> 
> Here's the shader code (based from some discussions
> into this list):
> 
> //VS:
> uniform sampler2D DisplacementMap;
> uniform float blend;
> 
> void main(void)
> {
>       vec4 newVertexPos;
>       vec4 dv;
>       float df;
>       vec4 vari = gl_Vertex;
>       
>       gl_TexCoord[0].xy = gl_MultiTexCoord0.xy;
>       dv = texture2D(DisplacementMap,
> gl_MultiTexCoord0.xy);
>       df = blend*dv.x + blend*dv.y + blend*dv.z;
>       
>       vari.z += df;
>       gl_Position = gl_ModelViewProjectionMatrix * vari;
> }
> 
> //PS:
> uniform sampler2D Diffuse;
> 
> void main(void)
> {
>     gl_FragColor = texture2D(Diffuse,
> gl_TexCoord[0].xy);
> }
> 
> Any help would be really appreciated.
> Thanks
> Franz / EXYZT
> 
>  _______________________________________________
> 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]
> 



      __________________________________________________________
Sent from Yahoo! Mail - a smarter inbox http://uk.mail.yahoo.com

 _______________________________________________
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