Help needed with HLSL

Started by
5 comments, last by Schrompf 16 years, 3 months ago
Hi, Is there any way to displace vertices (in a vertex shader) based on texture colors sampled at that point? Plz reply. Thanks, Saranya
Advertisement
You can using vertex textures, but they require VS 3.0 support. Not sure how you would do it with earlier shader models.
The term you're looking for is "vertex diplacement mapping". It requires SM3 hardware or above. If you don't have access to that, you could always do it in software.
NextWar: The Quest for Earth available now for Windows Phone 7.
You need to be aware that only Nvidia supported vertex displacement mapping under Direct3D 9, ATI went their own route using "Render to Vertex Buffer" (R2VB).

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

tex2Dlod returns a vector, like all of the other texture functions. I've never used vertex textures in VS 3.0, but the documentation doesn't say anything about only retrieving a scalar value.
Thanks :). I just checked out that it returns a vector.
Keep in mind that it only works on NVidia Geforce6 cards or better and on ATI Radeon 2000 cards and better. Other cards don't support it, even though ATI Radeon X1000 series were supposed to support it due to the specification of SM3.0.
----------
Gonna try that "Indie" stuff I keep hearing about. Let's start with Splatter.

This topic is closed to new replies.

Advertisement