Hi Zach,

Yep this sounds like software rendering.  Check you pixel formats on the
texture.

Robert.

On 4/30/07, Zach Deedler <[EMAIL PROTECTED]> wrote:

Hi Paul,

Yes I could've been more descriptive.  "renders horribly", like 1fps.  The
texture I'm using is 512x256.  The draw time is 1128ms.  I'm up to date
with
my drivers.

Zach


> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Paul Speed
> Sent: Sunday, April 29, 2007 21:29
> To: osg users
> Subject: Re: [osg-users] Height map vertex shader
>
> Can you describe what you mean by "renders horribly"?
> Perhaps that will provide a clue.
>
> Is this just a flat shaded shape?  I noticed you aren't
> giving it texture or color or anything.
>
> -Paul
>
> Zach Deedler wrote:
> > Hello osg-users,
> >
> > I'm trying to implement dynamic terrain displacement using
> a shader.
> > I am trying to just edit a texture to cause the vertex
> shader to look
> > at the texture, and modify the vertex displacement.  But, when I
> > implemented it, it renders horribly.  Anybody see what I
> did wrong in my vertex shader?
> >
> > uniform sampler2D heightMapSampler;
> > void main()
> > {
> >    vec3 vertex;
> >
> >    gl_TexCoord[0] = gl_MultiTexCoord0;
> >    vec4 heightMap = texture2D( heightMapSampler,
> gl_MultiTexCoord0.st );
> >    vertex.xy = gl_Vertex.xy;
> >    //Add displacement to vertex.
> >    vertex.z = gl_Vertex.z + heightMap.r;
> >    gl_Position = gl_ModelViewProjectionMatrix * vec4(vertex,1.0); }
> >
> > I have a feeling I'm supposed to be using texture2DLod in
> the vertex
> > shader, or that this just isn't a viable way to do vertex
> displacements.
> >
> > Thanks.
> >
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> > http://openscenegraph.net/mailman/listinfo/osg-users
> > http://www.openscenegraph.org/
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to