Material tiles cracks

I got this problem with the tiles in the material:

I not sure but i think this is a problem by the Frac node, is there an other way to do this ?

*Well looks like in mesh 3d planes this work without the Frac node, but in the BSP brush faces don’t work.

This is caused by large jumps in the UV coordinates which the GPU hardware automatically assumes means there needs to be a mip map transition. Due to the frac. The GPU uses the slope of the UVs in screen space to determine mips, so when it sees the UVs go from 0 to 1 suddenly it thinks that pixel has a steep slope (ie, the same as a wall almost perpendicular to you).

You can work around this using ComputeMipLevel but thats a pain since you need to enter the texture size.

A better way is to use the code “SampleGrad”. First make a Custom expression node.

Add an input called “Tex” and hook up your texture there as a texture object. Also add an input called “UV”.

Then add this line:

return Tex.SampleGrad(TexSampler,UV,DDX(UV),DDY(UV));

I will probably make this a material function at some point but I have been trying to get the rendering guys to make it a proper code node first. It’s like a game of chicken “Do it right or I will do it crappy at which point you will have to do it”.

Thanks you for reply, you say something like this ?

I got the same result with this using the Frac i got the cracks and without the Frac i got a stretch texture, what i done bad ?

Hey RyanB thanks you, after search in the network about that function i find this 3D Modeling & Texturing: [UE4 Quick Tip] Removing Frac Artifacts looks like your node but with the use of the 2 uv and now this work for me without cracks ^.^ this is okay ?

The only problem is change now the tileset texture because i can’t change that from the instance material but its okay

Thanks your your help!

I forgot to mention that you do need 2 UVs.

One should be the actual UVs to use on the texture (with your frac) and the other should be the same tiling factor but without frac, and that is the one to sample DDX and DDY on.

So something like this:

return Tex.SampleGrad(TexSampler,UV,DDX(UV_nofrac),DDY(UV_nofrac));

so you’d have input UV and input UV_nofrac

Also if you convert your texture to a “texture object parameter” you can still override it using a material instance. There should be no limitation there.

Then like in the photos ^^

Yeah its true is here, but the “Texture Object” need in the drop list box an option to convert to parameter like the “Texture Sampler”.

谢谢楼上各位 但是我遇到了一个和它一样的问题 请问?