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"

Material Vector Expressions not working on Android?

Hi

We have started testing our scene settings on mobiles, and I have just came across a strange problem. We have decided to go with totally unlit scene, no lightmaps and no post-processing for our lowest performance tier. But what the scene really needs to look nice is some cool atmospheric perspecitve. So instead of using the fog I have decided to mix some predefined Fog Color directly into the materials, based on the objects' distance from the camera. And it basically looks like this:

alt text

alt text

But when I built it on my Xperia M the "fog" effect got ignored. It simply does not calculate the Fog Color into the shaders, and besides that, everything works fine. I have tested all 3 options for the Feature Level Preview in the Editor, and all of them work fine with my "fog".

And this is how it looks on the phone:

alt text

So where is the catch?

Forum link: https://forums.unrealengine.com/showthread.php?53799-Camera-Position-and-Object-Position-not-working-on-Android

Product Version: Not Selected
Tags:
more ▼

asked Dec 09 '14 at 08:48 AM in Rendering

avatar image

rimau
192 12 18 23

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

1 answer: sort voted first

Hey rimau -

This is probably do to the UV math begin done through a pixel pipeline which has limits on mobile. If you go into your material attributes you can add a customized UV channel (if you are using any Textures better to add 2 that way you can not effect UV0). Take all the math for your Fog color and the MPC Parameters and plug that clamp into Customized UV0 (or UV1 depending), then create a UV coordinate with the exact and mask it to just the R channel and plug that into your LERP Alpha.

It should work as intended on mobile now. This is forcing the math to run on the vertex shader which has more options in mobile.

Thank You

Eric Ketchum

more ▼

answered Dec 09 '14 at 04:17 PM

avatar image

Lovecraft_K ♦♦ STAFF
36.8k 702 260 736

avatar image rimau Dec 09 '14 at 07:20 PM

I'm affraid I do not follow :) I do understand that I do add a Make Material Attributes node. The last Clamp node I should connect to one of the Customized UVs, and this should be no problem. But the part with "creating a UV coordinate with the exact" is where I'm getting lost. I'm missing some bigger picture here, as this are some of my first steps with UE4 materials. I have attached a full material setup, with just Make Material Attributes node added. If you could be a bit more specific what to connect where that would be great. And some tips what to look for in the documenation/tutorials to get some better understanding of the problem.

alt text

clipboard01.jpg (410.7 kB)
avatar image Lovecraft_K ♦♦ STAFF Dec 09 '14 at 08:53 PM

Here is my setup this should clear it up, my apologies for the confusion.

alt text

Thank You

Eric Ketchum

customuvs.jpg (232.6 kB)
avatar image rimau Dec 09 '14 at 09:45 PM

Thanks a lot, now I get it! :) In the meantime I have tested one other approach. I have placed the meshes inside the blueprints, than got their world locations and passed that values into a new Distance parameter. So it looks like now I have two working solutions at my disposal. Thanks again for your help.

(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