Jump to content
  • Advertisement
Sign in to follow this  
Florian22222

AddressU/V ignored?

This topic is 2517 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi!

I´ve written an effect:

uniform extern matrix gWVP;
uniform extern Texture2D gHeightfieldTex;
uniform extern Texture2D gTileTex;
SamplerState TextureSampler
{
Filter = MIN_MAG_MIP_LINEAR;
AddressU = CLAMP;
AddressV = CLAMP;
};
//shader i/o structs
struct VS_OUTPUT
{
float4 Position : SV_POSITION; // vertex position
float2 TexCoord2 : TEXCOORD0; // vertex texture coords
};
VS_OUTPUT RenderSceneVS( float3 Position : POSITION, float2 TexCoord2 : TEXCOORD0 )
{
VS_OUTPUT Output = (VS_OUTPUT) 0;

Output.Position = mul(float4(Position,1.0f),gWVP);
Output.TexCoord2 = TexCoord2;

return Output;
}
float4 RenderScenePS(VS_OUTPUT Input) : SV_TARGET
{
return gTileTex.Sample(TextureSampler,Input.TexCoord2);
}
technique10 T1
{
pass P1
{
SetVertexShader( CompileShader( vs_4_0, RenderSceneVS() ) );
SetGeometryShader( NULL );
SetPixelShader( CompileShader( ps_4_0, RenderScenePS() ) );
}
}


But its worth it what i write into AddressU/V. It maps the texture the same way everytime.
Please help me! smile.png

EDIT: added screenshot!(it´s actually only a grid(i want to make a heightfield out of it))

Share this post


Link to post
Share on other sites
Advertisement
Your shader code looks fine. Perhaps you're not filling the vertex buffer correctly, or you're not setting up the input layout properly?

Share this post


Link to post
Share on other sites
Hmm the vertex buffer is fine. It looks good in wireframe-mode.
I think i should look at the input layout..Thank you for looking at this, you are really helpful :D

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!