DX11 - Wierd texture appearance combined with tessellation...

Started by
2 comments, last by Migi0027 10 years, 7 months ago

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

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

Advertisement

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

input.texcoord -> float2

uv_scale -> float

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

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!

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

This topic is closed to new replies.

Advertisement