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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Is Material function call LocalPosition supported for HTML5 packaging?

LocalPosition in materials is a function that returns the local coordinates of the object's surface being textured/rendered. However when I try to package the project for HTML5, I get: - LogShaderCompilers:Warning: Failed to compile blabla.mat for platform GLSL_ES2_WEBGL, Default Material will be used in game.

I got a sense that LocalPosition might not be supported for HTML5, can someone confirm that if this is a true limitation of the WebGL platform or did I do something wrong during constructing the material blueprint?

Product Version: UE 4.10
Tags:
more ▼

asked Mar 07 '16 at 10:44 PM in Packaging & Deployment

avatar image

yunyunzai
3 1 3 6

avatar image AndrewHurley Mar 14 '16 at 02:44 PM

Hey yunyuzai,

When developing for the HTML 5 platform, you will be following along the same restrictions and limitations as the ES2 Mobile platform.

With that in mind, I looked into the LocalPosition function and only saw some 'Absolute World Position' nodes and that was about it, so I can't see why it wouldn't compile properly.

Let me know if you have further questions.

Thanks,

Andrew Hurley

avatar image yunyunzai Mar 14 '16 at 04:05 PM

Thanks for the reply Andrew.

Below, I have created a very simple material that renders the floor directly based on its local position in the mesh: alt text This is what shows up in the editor, everything looks fine. alt text During the HTML5 packaging, I get the following warning: LogShaderCompilers:Warning: Failed to compile Material /Game/M_LocalPosition.M_LocalPosition for platform GLSL_ES2_WEBGL, Default Material will be used in game. alt text And indeed, the render of the floor in the web browser shows the default material: alt text

Can you try the similar testing sequence and see if it produces the same result? I am running Unreal Engine 4.10.4. I suspect there is some bug not parsing the LocalPosition function properly to webGL code during HTML5 packaging.

avatar image AndrewHurley Mar 14 '16 at 06:07 PM

So I just ran the test you provided in a new blank 4.10.4 project with the Target Platform set to Mobile/Tablet. I did not get the same warning message, but I did get a message associated with the LocalPosition function which can be seen below.

alt text

It seems the packaging process automated a change for me by enabling the 'UsedwithStaticLighting' option. Be sure the project you are using is set to use the Mobile/Tablet for the Target Hardware.

One quick question, are you using a Mac, PC, or Linux?

Thank you,

Andrew Hurley

avatar image yunyunzai Mar 14 '16 at 06:08 PM

Hi Andrew,

Thank you for looking into this problem.

Sorry I forgot to mention about the OS, I am running it on Mac OS X I have changed the targeted hardware to mobile/tablet alt text Still getting the same error: alt text

May I know which OS did you run your test on?

snip20160314_8.png (106.5 kB)
snip20160314_9.png (455.9 kB)
avatar image AndrewHurley Mar 14 '16 at 06:56 PM

The original test was run on a PC, but I just tested the exact same process on the Mac and got the same results as I did on the PC.

What OS X version are you running, and is this a blueprint or a code project?

Thanks,

Andrew Hurley

avatar image yunyunzai Mar 14 '16 at 07:02 PM

Im running OSX Yosemite 10.10.5 alt text It's a blueprint project and the followings are the material details: alt text alt text

The followings are the GL info displayed during build: alt text Also that can you look at the entire HTML5 packaging log, not just the build log.

avatar image AndrewHurley Mar 21 '16 at 03:32 PM

We tested it again and still did not receive the warning message. What I suggest is adding a Feature Level Switch node to the material to see if that resolves the issue. Unfortunately, if we cannot reproduce this on our end there is not much we can do in terms of entering a bug report.

Looking at your Log RHI you are using a much different GPU then we have in our macs here, so that could be part of the issue. We are using the Nvidia 750M which doesn't support the DX12, but your AMD R9 M370X card does.

Let me know if you have further questions.

Thank you,

Andrew Hurley

avatar image yunyunzai Mar 22 '16 at 02:06 AM

Hi Andrew, I've repeated the above steps on another Windows Desktop with fairly different hardware structures. I was able to reproduce the same warning/error: MainFrameActions: Packaging (HTML5): UE4Editor-Cmd: [2016.03.22-01.34.12:615][ 0]LogInit:Display: LogShaderCompilers:Warning: Failed to compile Material /Game/LocalPositionM.LocalPositionM for platform GLSL_ES2_WEBGL, Default Material will be used in game.

alt text alt text

capture.png (155.7 kB)
capture2.png (14.0 kB)
avatar image yunyunzai Mar 22 '16 at 02:07 AM

System running is Windows 8.1

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

2 answers: sort voted first

Hey yunyunzai,

I really appreciate your patience while testing this issue, as I know I asked you to test the same thing multiple times. I was unable to determine whether this was expected or not, so I went ahead and entered a bug report for the issue (UE-28770).

With that being said, once the developers and engineers determine if the issue is in fact a bug, they will begin getting a fix in place. When the fix has been implemented, either myself or another team member will return here with the update.

Let me know if you have further questions.

Regards,

Andrew Hurley

more ▼

answered Mar 25 '16 at 02:46 PM

avatar image yunyunzai Mar 31 '16 at 10:07 PM

While the original bug still exists, I think I figured out a way to bypass this issue after seeing the newest "How to use the Custom Material node and create Metaballs" Youtube video and learned about custom material nodes (I'm only 1 month into Unreal Engine 4)

Basically, I replaced the LocalPosition node with a custom material function node containing the code: mul(float4(GetWorldPosition(Parameters), 1), Primitive.WorldToLocal).xyz; alt text And then the HTML5 packaging went smoothly without warnings: alt text And I am able to see the material shaded in the HTML5 canvas: alt text

capture2.png (384.8 kB)
capture.png (55.6 kB)
capture3.png (24.7 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hey yunyunzai,

I was finally able to get the material warning to appear in the version you mentioned by using the Shipping configuration, which I am assuming you were using as well?

However, I tested this issue in the 4.11 preview 8 release and it did not appear in that version. Would you mind testing to confirm this is true on your end?

Thank you,

Andrew Hurley

more ▼

answered Mar 23 '16 at 06:59 PM

avatar image yunyunzai Mar 23 '16 at 08:29 PM

I tried the same settings in 4.11.0 Preview 8. Seems the problem is still there: alt text alt text

snip20160323_1.png (574.5 kB)
snip20160323_3.png (36.0 kB)
avatar image AndrewHurley Mar 23 '16 at 08:46 PM

Are you running development or shipping build configuration?

avatar image yunyunzai Mar 23 '16 at 08:48 PM

Tried both development and shipping build, all have the same warning.

avatar image AndrewHurley Mar 24 '16 at 01:33 PM

I have noticed something when testing this issue, as I was also able to get it to reproduce in 4.11. The issue only appears for me when there is starter content involved in the project. Otherwise, there is no error that appears in the Output Log when packaging.

Check to see if this error still occurs when you package without starter content, and if it doesn't occur I will add that to the bug report.

Thanks,

Andrew Hurley

avatar image yunyunzai Mar 24 '16 at 02:49 PM

The warning happens even without the starter content For me. alt text alt text alt text

capture3.png (403.8 kB)
capture4.png (258.4 kB)
capture5.png (267.9 kB)
avatar image yunyunzai Mar 24 '16 at 02:50 PM

Tested on Windows 8.1 UE4.11.0 Preview 8

(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