These lines work (compile fine):
float4 offset = HeightMap.Sample(HeightSampler, input.Texcoord);
input.Position.xyzw += float4(0, 1, 0, 0);
These do not (any use of offset together with input/output Position causes the error):
float4 offset = HeightMap.Sample(HeightSampler, input.Texcoord);
input.Position.xyzw += offset;
No matter what I try to do to use the offset values to change the positions it breaks:
float4 offset = HeightMap.Sample(HeightSampler, input.Texcoord);
matrix<float, 4, 4> offs = {
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
offset.x, offset.y, offset.z, 1
};
output.Position = input.Position;
output.Position = mul(output.Position, offs);
Debug output:
(32,9): error X4532: cannot map expression to vs_5_0 instruction set
(62,19): There was an error compiling expression
(49): Error compiling effect hr=S_OK (0x00000000)
Anyone have an idea why?