hi there, i was once again trying to implement a displacementmapping and used tex2D(map,texCoord).x as a scaling factor. however, i get "Malfunction w1550 .. cannot map expression to vertex shader instruction set, ID3DXEffectCompiler::CompilerEffect.
this way of using a texture in the vertex shader (model 3.0) is shown all over in books so, why doesnt it work here?
another strange thing i found is the following code, which doesnt give any error, but doesnt work too,:
Code:
static float3 g[] =
{
1,1,0, -1,1,0, 1,-1,0, -1,-1,0,
1,0,1, -1,0,1, 1,0,-1, -1,0,-1,
0,1,1, 0,-1,-1, 0,1,-1, 0,-1,-1,
1,1,0, 0,-1,1, -1,1,0, 0,-1,-1
};
texture gradTexture
<
string texturetype = "2D";
string format = "q8w8v8u8";
string function = "GenerateGradTexture";
int width = 16, height = 1;
>;
float3 GenerateGradTexture (float p: POSITION) : COLOR
{
return g[p*16];
}
sampler gradSampler = sampler_state
{
texture = <gradTexture>;
AddressU = Wrap;
AddressV = Clamp;
MAGFILTER = POINT;
MINFILTER = POINT;
MIPFILTER = NONE;
};
when using the sampler lateron , something shoud be visible, but it isnt.
is this something i am doing wrong, or is shadermodel3.0 not fully supported by 3dgs?
if you feel this belongs to the shader forum, please move it over. i thought to put it here
thanks in advance for any info