Download

Weird texture problem in HTML5

Hi all,

apologies if this has been discussed before, I tried to find a solution to my problem but could not.
I have attached an image showing the issue. The textures on some of my objects go from correct into wrong. As you can see some of the brick is fine and then it goes all wrong.

  1. I read the official Performance Guidelines for Mobile Devices, I unwrapped properly the object in question (a wall), I changed its exture to be with square dimensions, there are no overlapping UVs.
  2. I’ve set the Preview Rendering Level to Default Mobile/ HTML 5 Preview
  3. The material has only 1 texture which is below the limit of 5 for mobile/html.
  4. Lighting has been built

I previewed the scene in Mobile Preview (PIE) and New Editor Window (PIE)- the textures were perfect there.
When I packaged my project for HTML5 and uploaded on our server I got the issue with the textures.

What could be causing this problem?

do not trust mobile/html5 preview.

most probably you are using a material type or node that is not compatible with html5, and your current one is packed incorrectly.
try checking output log for warnings about material compatibility errors. something similar to this:

MainFrameActions: Packaging (HTML5): UE4Editor-Cmd: [2016.04.26-19.58.17:556] 0]LogInit:Display: LogMaterial:Warning: Failed to compile Material /Engine/EditorMaterials/PreviewShadowIndicatorMaterial.PreviewShadowIndicatorMaterial for platform GLSL_ES2_WEBGL, Default Material will be used in game.

material editor will also tell you what cannot be used when you are in mobile renderer after clicking the apply button.

another possibility is that, you are clamping your texture. make sure that the texture’s tiling methods are “wrap” for both x and y.
Capture.JPG

this is how a clamped texture shows in material editor. however, it will show tiled on screen.

Hey emrahgunduz,
thank you so much for taking the time to write this and post the screenshots.
I checked the log (the one that appears during the Packaging process) and indeed I found there some red errors regarding the problematic objects (the wall in the above screenshot is just one of them).
In essence it says “Sampler type is Color, should be Linear Color”, or “Sampler type is Color, should be Normal”.
My materials only have diffuse .jpg textures so I have no idea why do I need to change the sampler type but even when I tried changing it an error got generated in the material editor.
I will keep trying to make it work… somewhere I read some people had to migrate their project into a new empty one…

Again- thanks for your help.

Never mind. I figured out what was the issue- I should have used a power of 2 texture (512x512 or 1024x1024). Instead I was using 700x700 resolution texture.
It works fine now.