x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

FMod and Frac material functions cause seam in texture

Is there any way to get rid of the interpolation seam caused by using Frac or FMod? Coming from writing actual fragment shaders, I find it odd that this seam even exists (why is interpolation happening in the pixel sampling?)

Example, say we have this super simple texture

Simple Texture

And we want the top right corner to loop instead of the whole texture, something that's easy to accomplish with an FMod.

Artifact

As you can see, an artifact is now present from when the UV jumps from 0.25 to 0 and I'm not sure why. Is there a way I can disable this interpolation? With the power of MSPaint, here's what I expected to see:

Artifact removed

Product Version: UE 4.15
Tags:
more ▼

asked Apr 12 '17 at 06:05 PM in Rendering

avatar image

JonPearl
16 1 2 3

avatar image nickpetersonfx Apr 15 '17 at 12:34 AM

You'd be better off just making a texture that has this set up the way you want, I think.

Alternatively, make a texture that is using up the full UV 0 - 1 space, and then just set your UV tiling to 2.

avatar image JonPearl Apr 15 '17 at 12:58 AM

I think you're looking into the example a bit too far. I made that example to show the issue I'm talking about in its simplest form. My actual use case is far more nontrivial but is being hampered by the artifacts caused by fmod and frac -- basically anything that causes a hard seam of uvs between two nearby fragments will cause it to do a weird interpolation artifact on the boundary between them.

You are right, though. If I needed to do what is in the example, I would just tile it as you described. The question itself is to avoid the artifacts from fmod and frac

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

I've found an okay temporary solution. If you disable mip-mapping (via the properties on the texture themselves) then the artifacts disappear. Would love to have another answer that describes how to do this while maintaining mipmaps.

more ▼

answered Apr 13 '17 at 12:56 AM

avatar image

JonPearl
16 1 2 3

avatar image KabraBoja May 11 '18 at 10:52 AM

I can confirm this solution works. I had a similar problem when using the Flipbook material node in conjunction with the use of absolute world position. Thank you very much.

avatar image Deathrey May 11 '18 at 12:13 PM

You don't need to disable mips, it is pretty bad in all respects. Instead, use an option to provide explicit derrivates, and use DDX DDY, on coordinates, that do not contain frac expression.

(comments are locked)
10|2000 characters needed characters left

Maybe ComputeMipLevel node will help. This worked for me...unfortunately, i don't understand why :) alt text

noseams.png (152.6 kB)
more ▼

answered May 18 '18 at 06:14 PM

avatar image

Osiris2000
86 6 8

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question