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"

Screen Aligned UV + Camera Offset on mobile

Hi guys,

I am using an unlit material with both nodes for mobile (android). It is applied on a 10m. sphere around the camera, to use it as background still image. I need to move the camera around and have always a still image on the background, behind any object in the scene.

On the editor it works ok, but on the mobile it doesn't work when both nodes are connected. The surprising thing is that ScreenAlignedUVs works fine on its own, the CameraOffset works fine too on its own, but when I use both at the same time only the offset works. Then the mesh doesn't show the texture but a plain color, taken probably from the texture.

Is this a limitation of Mobile rendering? Any workaround?

Thanks a lot,

Best, Alo.

alt text

Product Version: UE 4.12
Tags:
material.jpg (184.0 kB)
more ▼

asked Oct 25 '16 at 10:16 PM in Packaging & Deployment

avatar image

Nomte
68 2 6 6

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

2 answers: sort voted first

No worries, thanks for investigate!

Alejandro.

more ▼

answered Nov 21 '16 at 09:52 PM

avatar image

Nomte
68 2 6 6

avatar image ddvlost STAFF Nov 25 '16 at 09:04 AM

Hi, could you connect ScreenAlignedUVs to a Customized UV in a material and see if it helps? That way UV computation will be done in a vertex shader instead of pixel shader. And floating point precision is way better in vertex shader.

https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/CustomizedUVs/

avatar image Nomte Nov 25 '16 at 09:44 AM

Sounds good! I'll work on my game again this weekend, I'll try and let you know. Thanks a lot for the suggestion!!

Best, Alejandro

avatar image Nomte Nov 28 '16 at 11:16 PM

Hi ddvlost,

Thanks for the solution. As you imagined, using the customized UV solved the issue with the distance to camera. Cheers for that!. Unfortunately, when looking around the edges of the sphere are visible since the little distortion created by the vertex mapping.

YOUTUBE TEST Customized UV

I am using a workaround for now. When the issue is solved I'll apply it to my project again. Thanks a lot for your help!

Best, Alejandro

avatar image ddvlost STAFF Nov 30 '16 at 04:14 AM

Since 4.13 materials have an option to "Use Full Precision" in a pixel shader on mobile. That should solve that.

avatar image AloAlvarez Nov 30 '16 at 07:42 PM

Hi ddvlost, Thanks for the suggestion. I tried but the issue persists.

Best, Alejandro

alt text

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

Hi Nomte,

When I try this in 4.13, since I no longer have 4.12 installed, everything is working correctly for these nodes. The only issue I had was having to use a lower offset value. With a negative 50000 you're likely seeing a limitation of mobile here. Try smaller values, as that worked for me. If it's still a problem in 4.12 try 4.13 and see.

I used your same setup with an offset amount of -500 and also trying an offset value of 500. Also, depending on the device you're deploying to, it could also be a limitation there, as I'm using a Nexus5 phone running Android 6.0.1.

-Tim

more ▼

answered Oct 26 '16 at 05:58 PM

avatar image

Tim Hobson ♦♦ STAFF
48.7k 888 103 880

avatar image Nomte Oct 27 '16 at 08:57 AM

Thank you very much Tim!, I'll try this weekend and let you know :) Unfortunately, even if it works on 4.13 I don't want to upgrade right now. I am very close to release and the last time I upgraded and spend a lot of time just making the plugins and everything work again. I'll be back with news.

avatar image Nomte Oct 27 '16 at 11:31 PM

Hi again,

I think I am narrowing the issue. I tried 4.13 and it behaves exactly like you said. The same result in 4.12.

Here is the thing. I've notice that using ScreenAlignUV doesn't show the texture from a certain distance on mobile (aprox. 20000 units/centimeters) please see image attached. From that distance it shows just a plain color. When adding the CameraOffset, that "Mobile max distance" works in addition of the CameraOffset, that is why combining both with a large offset makes everything looks a plain color. In other words, if the limit is 20000 units and I offset the camera more than 20000 units, no texture is shown. In PIE or PC everything works fine.

Is there a way to remove this mobile limit? I think it should not be about a hardware limitation, because on mobile I can see objects that are farther than 70000 units from camera.

Thanks a lot.

alt text

avatar image Tim Hobson ♦♦ STAFF Oct 31 '16 at 07:13 PM

When I check this in on a Nexus 5 (Snapdragon chipset) I get the issue you have, however, when I check this on my Samsung S7 Edge (Exynos chipset) there isn't any issue at the same distances laid out. When tested with an Ipad Mini 2 and Iphone 5s (both using A7 apple chipset), I get the same without issue.

Can you post your phones model number from your Device Settings > About Device section. I can test a few more devices here with different chipsets and see if this is possibly something related just to Snapdragon chipsets as a limitation or known issue.

avatar image Nomte Oct 31 '16 at 09:48 PM

Thank you very much Tim for all your efforts.

I've tried in several devices and these are the results:

Without issue: LG G4S (LG-H735) 64bits - Qualcomm Snapdragon 615 MSM8939 (28nm) GPU Adreno 405

With issue LG G2 (LG-D802) Qualcomm Snapdragon 800 MSM8974 GPU Adreno 330

Samsung Galaxy Tab 4 (SM-T530) Qualcomm Snapdragon 400 GPU Adreno 305

Samsung S4 Mini Qualcomm Snapdragon 400 MSM8930 GPU Adreno 305

If it is a hardware limitation, I better try another solution. Coming back to the root of the problem: Is there any way to place a still image as background of the scene, with a moving camera?

Thanks a lot, Alejandro

avatar image Tim Hobson ♦♦ STAFF Nov 21 '16 at 09:46 PM

Hey Alejandro,

sorry for the delay. I've submitted a ticket for this one to be investigated. You can follow the status here: https://issues.unrealengine.com/issue/UE-38923

(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