[GEM-dev] noise problem with glsl

chris clepper cgclepper at gmail.com
Thu Sep 14 15:13:12 CEST 2006


I haven't used the noise function becuase it does not run in hardware on ATI
or Nvidia (only 3DLabs).  You might have to use temporary variables or
explicitly cast like:

vx += (float) (0.1 * noise1())

On 9/14/06, cyrille henry <cyrille.henry at la-kitchen.fr> wrote:
>
> hello,
>
> i received my orange book few days ago. so i'm back with glsl.
>
> i give up for now with multitexture. my aim was to use 1 noisy texture
> to distord the other one.
> i discover the noise fonction of glsl, but i've got problem, trying to
> use it.
>
> by example, a simple vertex shader like this :
>
> void main(void)
> {
>         vec4 v = vec4(gl_Vertex);
>         vec4 pos = gl_ModelViewMatrix * v;
>         float LightIntensity = max(dot(normalize(vec3(0.,3.,3.) - pos.xyz
> ),
> gl_Normal), 0.0);
>         gl_FrontColor = gl_Color * LightIntensity;
>
>
>         v.x += 0.1 * noise1(v);  // commenting this line
>                                  // make the shader to work
>
>         gl_Position = gl_ModelViewProjectionMatrix * v;
> }
>
> gives me error :
>
> Vertex info
> -----------
> <stdlib>(3998) : warning C7011: implicit cast from "int" to "float"
> <stdlib>(3998) : warning C7011: implicit cast from "int" to "float"
>
> (same errore with noise1, noise2, noise3.., whatever vecter size of the
> input parametter)
>
> does anyone know where the problem came from?
> what should i try? etc
>
> should i ask this question in an other mailling list (as i don't think
> it's a gem problem)?
>
> does anyone interested in my working example: sould i upload my patch
> somwhere?
>
> thanks
> Cyrille
>
> _______________________________________________
> GEM-dev mailing list
> GEM-dev at iem.at
> http://lists.puredata.info/listinfo/gem-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/gem-dev/attachments/20060914/de593765/attachment.htm>


More information about the GEM-dev mailing list