Download

Distance Field in material weird

Hey,

Here is what it looks like:

http://i.imgur.com/7RUda9Xm.jpg

As you can see, there is big plus shape in the gradient. Further more, the egdes are hard, brighter than near the mesh - particulary on the yellow part.

Thanks in advance,

I would guess that the box is because the distance field shape is simplified to be somewhat boxy in the lower resolution global distance fields. If the shape of the field makes a flat surface at any point, the distance will increase perpendicular to that point.

I am not sure what the edge artifact is there, but I wouldn’t multiply times 50. I would instead try normalizing the value. By multiplying like that you actually risk losing range which could explain some of what you see.

It is probably just another strange artifact of sampling such a low resolution field from so far away. You can improve this yourself by taking a few samples at offset locations and averaging them. That will really break up the strange cone like artifacts at the corners as well. I would talk to DanielW about this but he is out on vacation right now. I will make sure to bring this up when he gets but, but I expect it to just be an inherent artifact of low res distance fields.

If you want a soft mask on the gradient, normalize the gradient and then multiply by a mask using the distance to surface (not gradient) node. Or you could use that mask to lerp to a desired gradient (or normal) direction; it all depends on what you are trying to do.

Thanks I’ll try this out!