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"

Inverting using one minus, subtract, lerp, or gradient texture is extremely innacurate

This is something I've been dealing with since UE3 and to date I haven't found a good solution.

I'm attempting to invert a texture, whether grayscale or RGB (mostly black and white)... and the result is very inaccurate.

Here's a picture to illustrate:

alt text

As you can see, the photoshop result is more representative of what things should look like. A one minus gives a washed out, inaccurate result.

Furthermore, I've added some arbitrary multiplies, powers, adds, and clamps... followed by a one minus... and the result is even worse.


alt text

I tried all sorts of things. I tried using a one minus, a subtract, a linear interpolate with the texture plugged into its alpha channel.. I even tried hooking a gradient texture up to the texture via its UV input. All resulted in very inaccurate inversions.

There has to be a better way. I've searched google for the answer but to no avail. Some suggest multiplying by a power of 0.55. Some suggest using the an "if" node. I've tried them all, but still have come up empty handed.

Is there a more accurate way of doing this? If so, it could unlock some neat tricks.

Historically, the way I've dealt with this is inverting in photoshop, then using that inverted texture in editor.. but it's not exactly the best way to do things.

Any help would be appreciated. :)

Thanks, -Neil (CaptainMigraine)

Product Version: Not Selected
more ▼

asked Feb 17 '15 at 02:13 AM in Everything Else

avatar image

366 11 24 34

avatar image cancel Feb 17 '15 at 03:16 AM

Is the texture sampler type set to grayscale, or linear grayscale? You probably want linear.

avatar image Fisher007 May 17 '15 at 02:58 PM

I would also be interested in this matter, I found the one minus giving awful results. Even with procedural stuffs, like gradients are getting inverted in a way that doesn't make any sense. I thought that it might be that the values are lower or higher than that is possible to put on the previewer, but using a clamp doesn't help either.

alt text

avatar image nickpetersonfx May 18 '15 at 12:29 AM

Cancel mentioned above that you probably want linear instead of SRGB. Probably correct.

Secondly, Fisher007, in your case, it is an order of operations thing. If you want the same thing literally flipped, you'll need to 1x the gradient, then do the power, and clamp. It doesn't work to simply 1x the final result.

alt text

flippedgradient.png (164.0 kB)
(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