Hi,

I've used quite a lot vertex texturing this year to do display 4D simulations 
(earthquakes, tsunamis).
I was working on NVIDIA Quadro NVS and 6800GTX.
If you stick with Pixel format used in osgsimulation 
(osg::Texture::MIN_FILTER,osg::Texture::NEAREST); 
(osg::Texture::MAG_FILTER,osg::Texture::NEAREST); 
setInternalFormat(GL_RGBA_FLOAT32_ATI); or 
setInternalFormat(GL_LUMINANCE_FLOAT32_ATI);
The results should by good.
I was surprised to have good results on Quadro NVS which is more a 2D card but 
OpenGL 2.0 compliant, 
even with multiple vertex texture fetch.
However, if you try to use something else, you will use software rendering and 
it will be disastrous.
Not using  osg::Texture::NEAREST => black pixels
Not used GL_RGBA_FLOAT32_ATI or GL_LUMINANCE_FLOAT32_ATI => software rendering

osg::Texture::NEAREST will make things a bit blocky if you use small textures, 
but it is then possible to interpolate "by hand", through a vertex shader 
(beware of performance loss).
You will also have to recompute normals if you want your lighting to stick with 
your displaced vertex (with a bad performance impact too).
I used textures up to 1Mo with a framerate of 60Hz

    Luc



Luc FRAUCIEL - BRGM
Unité Calcul, 3D et réalité virtuelle
Service Systèmes et Technologies de l'Information
3, av C. Guillemin BP 6009 - 45060 Orléans Cedex 2, France
Tél. 02 38 64 35 65
Fax 02 38 64 39 70
-----Message d'origine-----
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Wojciech 
Lewandowski
Envoyé : mercredi 2 mai 2007 10:29
À : osg users
Objet : Re: [osg-users] Height map vertex shader

Few more hints:

Make sure texture format is one of hardware accelerated  for Vertex Fetch on 
your gpu.
Make sure texture filtering options are supported as well.

Few months ago I tried to do the same to learn that these matters are very 
delicate.  I used NVIdia 7800 GTX. It had texture vertex fetch support only for 
float luminance, float rgba formats and point filter only (sometimes it worked 
with bilinear but sometimes texels were black)

I finally gave up. Ended up with render to texture image and modifying vertices 
by CPU. Hope you will have more luck ;-)

Cheers,
Wojtek Lewandowski


----- Original Message -----
From: "Mike Weiblen" <[EMAIL PROTECTED]>
To: "osg users" <[email protected]>
Sent: Tuesday, May 01, 2007 4:11 AM
Subject: Re: [osg-users] Height map vertex shader


> Hi,
>
> Various thoughts:
>
> What graphics card?  Not all support vertex textures in hardware, and may 
> have
> different capabilities when they do.
>
> Check the InfoLog outputs from the compile and link, they may provide 
> hints (ATI
> says when the shader forced a slow path.)
>
> FYI texture2DLod is only necessary when using a mipmapped texture.  Are 
> you?
> That could also have a performance impact.
>
> cheers
> -- mew
>
>
>
> Zach Deedler 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.
>
>
> -- 
> Mike Weiblen -- Austin Texas USA -- http://mew.cx/
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
> -------------------------------------------------------------
> This mail was scanned by BitDefender
> For more informations please visit http://www.bitdefender.com
>
>
> -------------------------------------------------------------
>
> 


-------------------------------------------------------------
This mail was scanned by BitDefender
For more informations please visit http://www.bitdefender.com


-------------------------------------------------------------


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
**********************************************************************************************
Le contenu de ce mél et de ses pièces jointes est destiné à l'usage exclusif du 
(des) destinataire(s) expressément désigné(s) comme tel(s). En cas de réception 
de ce 
 mél par erreur, le signaler à son expéditeur et ne pas en divulguer le 
contenu. 
L'absence de virus a été vérifié à l'émission du message. Il convient néanmoins 
de 
vérifier l'absence de contamination à sa réception. 
The contents of this email and any attachments are confidential. They are 
intended for 
the named recipient(s) only. If you have received this email in error please 
notify the 
system manager or the sender immediately and do not disclose the contents to 
anyone or make copies. eSafe scanned this email for viruses, vandals and 
malicious 
content.
**********************************************************************************************

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

Reply via email to