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"

GUI Material with smooth outliner/border effect

Please help a math cripple in need :(

I want to make a material function that returns a value between 0..Max..1 depending on UV value and some other variables.

I'm pretty sure I could figure out, if I had the power of code at my disposal, but the material editor lacks even the most basic bool-operations and I quickly lose track of what I'm doing when I start putting "if"s together and whatnot.

I think it's best explained with pictures. 0 is the outer edge where the border should fade out completely. 1 is the alpha at the center (factor 1, so it doesnt change from the brush). Max is the boost-factor that gets applied at the core of the border.

I want to make this a material function, so I can easily re-use it and modify it to work with colors instead of alpha etc.

On the second picture, I don't really know what I'm doing anymore, but the first should make a lot of sense...

alt text

alt text

alt text

Product Version: UE 4.20
matfunc1.png (264.3 kB)
matfunc2.png (205.6 kB)
testmat.png (136.3 kB)
more ▼

asked Oct 17 '18 at 03:58 PM in Rendering

avatar image

653 68 83 118

avatar image MaxPower42 Oct 17 '18 at 04:00 PM

Forgot to mention, but it probably goes without saying that I want to create round corners. The edges are ok.

avatar image Everynone Oct 17 '18 at 04:14 PM

9 slice does the same, are you specifically after a pure material solution?

avatar image MaxPower42 Oct 17 '18 at 04:22 PM

What other solution is there?

If you mean a texture-solution, I'd prefer material.

avatar image Everynone Oct 17 '18 at 04:34 PM

Well yes, it's a texture solution - 9 slice.

Check the Setting Images States section in the above link - 9-slice is an automatically expanding border that preserves edges. Essentially what you've described but it's a simple texture rather than an, arguably, expensive material.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
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