Material bug. Material blinking when use SphereGradient-2D

It seems that composition (on the image) of Time + SphereGradient-2D.Diameter + Add (with some nonzero value) leads to blinking of material. When I pin Radius or 0-1 to Add.B it works well. Also there is no problems if I use Diameter as result without Add node.

Win 8.1, NVIDIA GeForce GTX 970

Can’t reproduce bug on Win 8.1, ATI Radeon HD7880

Try using a node “Max” and for A put a constant 0.0001 and for "B put in what you currently have for Radius.

The problem is that sine is passing by 0 and a 0 radius sphere is probably returning a divide by 0 that is not checked for, causing the circle to be infinitely large for one frame.

No idea why doing that add after the result fixed it. Weird :slight_smile:

Also bonus: there is a function called “pythagorean theorum” in engine that for some reason I forgot to expose to the library (just search in content browser). It can actually give you a result like this for cheaper if you just want the 0-1 gradient.

You can just feed it anything linear and it turns it into a round curve. So the result of spheremask could be the input to that since spheremask makes a “cone” normally.

Hi Ryan,
Unfortunately it does not help, blinking somehow connected with radius changing. Even if I use Max and radius is changing from 0.1 to 0.5 the result is blinking when new value of Radius comes to SphereGradient-2D. I found another solution. I use Radius result multiplied by 2. It is the same value as Diameter.

hmm I find that odd, since inside of the material function it does exactly that already. The radius and diameter outputs all come from the same math. I did notice some unnecessary math that could be optimized to save a few instructions (that is if the compiler isn’t already figuring that out which it probably is).

So far I am unable to reproduce any blinking even without the “max” node.

btw you probably just want to use “result 0-1” unless you actually need the exact radius. i dont think thats what you want though.

I wanted to mention that I was having this exact issue in 4.10 and even pulled apart the SphereGradient-2D function and tracked it down to the final clamp statement that was somehow getting a zero value. I changed the minimum to 0.001 and it fixed it. I later restarted the editor and couldn’t reproduce the issue.

Any chance to get this fixed in UE 4.11? :slight_smile:

It feels odd, but… This only happens when there’s is a parameter attached to Radius(S) input. If there is a constant there, it does not happen (or at least I couldn’t make it happen).

I should add that I"m getting this flickering problem on the ResultDiameter output.

Also, it does only happen when I use a parameter. I couldn’t make it happen when I use a constant.

This is still broken for me in 4.11 and fixed the same way. We’ve made a custom SphericalGradient2D with the fix above.