Jump to content
  • Advertisement
Sign in to follow this  
Migi0027

DX11 DX11 - Wierd texture appearance combined with tessellation...

This topic is 1817 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 guys!

 

Thanks to you I got the tessellation working, and for now It's working great, but!

 

I'm having a small problem with textures, as the title suggests. What I do is that I send a simple variable to the shader, called uv_scale (float), which represents the, well, the uv scale. (texture_coordinate * factor). But, when I use this factor, the texture itself is ONLY visible when close up, and if I take the camera far enough away, it dissapears! 

 

With UVSCALE:

output.Diffuse = float4(saturate(t_map.Sample(ss, input.texcoord*uv_scale).rgb*10.0f), 1.0f); 

// I time by 10 so that the texture appears brighter, for now...

But without (just removing the *uv_scale), the texture appears all over the mesh, could it be the sampler state?

D3D11_SAMPLER_DESC sd;
sd.Filter = D3D11_FILTER_ANISOTROPIC;
sd.MaxAnisotropy = 2;
sd.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;
sd.AddressV = D3D11_TEXTURE_ADDRESS_WRAP;
sd.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;
sd.BorderColor[0] = 0.0f;
sd.BorderColor[1] = 0.0f;
sd.BorderColor[2] = 0.0f;
sd.BorderColor[3] = 0.0f;
sd.MinLOD = 0.0f;
sd.MaxLOD = FLT_MAX;
sd.MipLODBias = 0.0f;

Now I put the title "tessellation", because in fact I tesselate the sphere, and the actual tesselation works, but just not the texture sampling (well it's not good enough)...

 

Calculation of texCoords (Domain Shader, I believe this is good enough, but i'm not sure)

uvwCoord.x * patch[0].texcoord + uvwCoord.y * patch[1].texcoord + uvwCoord.z * patch[2].texcoord;

Pics:

 

CLOSE UP:

2en3jwi.png

 

FAR:

2ahfyh4.jpg

 

 

Thanks as usual!

-MIGI0027

Edited by Migi0027

Share this post


Link to post
Share on other sites
Advertisement

What are the types of the variables input.texcoord and uv_scale?  Perhaps you have a type mismatch which is causing unexpected behavior...

Share this post


Link to post
Share on other sites

Sorry for all the trouble I caused our little brains. happy.png

 

The problem was external, meaning that how the resource itself was filled.

 

But thanks!

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!