Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


DX11 - Wierd texture appearance combined with tessellation...


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Migi0027 (肉)   Crossbones+   -  Reputation: 2622

Like
0Likes
Like

Posted 27 August 2013 - 02:43 PM

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, 27 August 2013 - 02:44 PM.

Hi! Cuboid Zone
The Rule: Be polite, be professional, but have a plan to steal all their shaders!

Sponsor:

#2 Jason Z   Crossbones+   -  Reputation: 5824

Like
0Likes
Like

Posted 27 August 2013 - 04:11 PM

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



#3 Migi0027 (肉)   Crossbones+   -  Reputation: 2622

Like
0Likes
Like

Posted 27 August 2013 - 10:14 PM

input.texcoord -> float2

uv_scale         -> float


Edited by Migi0027, 27 August 2013 - 10:14 PM.

Hi! Cuboid Zone
The Rule: Be polite, be professional, but have a plan to steal all their shaders!

#4 Migi0027 (肉)   Crossbones+   -  Reputation: 2622

Like
0Likes
Like

Posted 29 August 2013 - 02:45 PM

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!


Hi! Cuboid Zone
The Rule: Be polite, be professional, but have a plan to steal all their shaders!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS