float4x4 xWorldViewProjection;
Texture xColoredTexture;
int time;
sampler ColoredTextureSampler = sampler_state
{
texture = <xColoredTexture>;
magfilter = LINEAR;
minfilter = LINEAR;
mipfilter = LINEAR;
AddressU = mirror;
AddressV = mirror;
};
struct VertexIn
{
float4 position : POSITION;
float2 textureCoordinates : TEXCOORD0;
};
struct VertexOut
{
float4 Position : POSITION;
float2 textureCoordinates : TEXCOORD0;
};
VertexOut VertexShaderFunction(VertexIn input)
{
VertexOut Output = (VertexOut)0;
float sinarg = mul(input.position.x, 0.5) + time;
input.position.y = mul(0.5, sin(sinarg));
Output.Position = mul(input.position, xWorldViewProjection);
Output.textureCoordinates = input.textureCoordinates;
return Output;
}
float4 PixelShaderFunction(VertexOut input) : COLOR0
{
float4 color;
float4 maskcolor;
color = tex2D(ColoredTextureSampler, input.textureCoordinates.xy);
return color;
}
technique Textured
{
pass Pass0
{
VertexShader = compile vs_2_0 VertexShaderFunction();
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
The problem is that sin waves only get me so far. Can someone point me in the direction of a better algorithm to calculate the y values for my verticies in my vertex shader? Preferably something that isn't too math heavy?
Short video of where I am right now:






