What part of the equation am I missing here? I appreciate the suggestions! The following code is SharpDX, but the important parts should be easy to read.
[source lang="csharp"] Texture1DDescription textureDesc = new Texture1DDescription(); t1dDesc.ArraySize = 1; t1dDesc.Usage = ResourceUsage.Immutable; t1dDesc.Width = dataArray.Length; t1dDesc.Format = Format.R32_Float; t1dDesc.BindFlags = BindFlags.ShaderResource; t1dDesc.CpuAccessFlags = CpuAccessFlags.None; t1dDesc.OptionFlags = ResourceOptionFlags.None; t1dDesc.MipLevels = 1; DataStream ds = DataStream.Create(dataArray, false, false, false); dataTexture = new Texture1D(d3dDevice, textureDesc, ds); ds.Dispose(); this.dataTextureView = new ShaderResourceView(d3dDevice, dataTexture); this.dataSampler = new SamplerState(d3dDevice, new SamplerStateDescription() { Filter = Filter.MinMagMipLinear, AddressU = TextureAddressMode.Clamp, AddressV = TextureAddressMode.Clamp, AddressW = TextureAddressMode.Clamp });[/source]
HLSL:
float4 PS(PixelShaderInput input) : SV_TARGET
{
float4 color = float4(0,0,0,0);
float dataValue = data.Sample(dataSampler, input.texcoord.x);
if(input.texcoord.y <= dataValue)
{
color = dataValue;
}
return color;
}Edited by SquirrelPop, 13 June 2012 - 12:48 PM.






