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"

Is it possible to blend and / or manipulate Texture Objects

I have a material function that's neccessary for most of the materials I'm working on, and I've stumbled into a problem. It was initially really simple, but after a while I ended up with having to sometimes use a texture object, and sometimes a sampled texture. To make matters worse, I recently had to add different ways to sample a normal map. As you can see from the screenshot below, all of this ended up with lots of boolean inputs and an absolute spaghetti inside the function. Not pictured is having to use this function multiple times for different texture objects.

alt text

If I was able to blend several texture objects without a texture sampler, I'd be able to reduce this function to 4 inputs. Is that possible?

Product Version: UE 4.21
Tags:
example.png (62.5 kB)
more ▼

asked Jan 15 '19 at 09:44 PM in Rendering

avatar image

Mihhhhhhhh
11 2 2 3

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

2 answers: sort voted first

Not exactly what I was looking for, but I ended up layering different textures into separate rgba-layers of an image, sampling the texture once, and then blending between layers. This only works if you need grayscale textures, or two textures with two channels, or one rgb texture and a grayscale one.

more ▼

answered Mar 26 '19 at 12:25 PM

avatar image

Mihhhhhhhh
11 2 2 3

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

You could try to pack some information on existing non-Boolean varbales or utilize there predictable behavior and use it as toggles.

The vector parameter supports negative numbers (as any float type), but sampled texture never gonna have negative values... or else you got something weird. You can use that fact to detect if pin is connected and sampled color data is delived. Make a Texture Sample parameter default -1 on red (you can set it by extending color property in property editor (not in color editor). Now detect if red is -1, if it is sample data from texture parameter, if not that means we getting sampled color so we gonna use that. Wit this we got automatic toggle and we can remove toggle for texture sampling.

With static and dynamic, you could use alpha on normal map for that, or just use scalar parameter for that to reduce it to single toggle.

Note that nothing bad happen if you gonna have different version with different pin combinations of same node either ;] You can easily do this by just duplicating and modifying assets

more ▼

answered Jan 16 '19 at 05:38 AM

avatar image

Shadowriver
36.7k 932 169 1111

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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