Hello, we are currently working on adding web support to our application and are struggling with an issue where the textures and lighting of a 3D model are not displaying properly in a WebGL build. The top image is what we see in the editor, the bottom is what we see in the build.
Some additional info:
All models are loaded from an asset bundle
All textures do not have any import settings overwritten for WebGL and are set to the default “Low Quality” compression level.
Mip maps are enabled
The Standard Specular shader is used
All models have a main texture and a normal map
The transparent skin is not a transparent texture but instead faded down using the alpha value of the albedo color
We are using Unity 2017.1.0p3
If y’all have any idea what might be causing this I would appreciate any help you can give.
Which browser? If it’s Chrome/Firefox, maybe try Edge/Safari.
Any shader error in the browser log?
You could also try to have a look at in in Spector.js
I looked at the Spector.js snapshot, but am not familiar with OpenGL enough to be able to get any usable information from it. Nothing jumps out as being a cause of the issue, just that everything is still rendering incorrectly in the capture buffers.
The link to the capture output is capture 12_02_17.json - Google Drive if anyone is interested.
So I believe I might have found the solution (or at least a workaround). The issue was with the normal maps, and switching the Texture Type on the import settings from ‘Normal Map’ to ‘Default’ fixed the issue. My hunch is that under the Default type RGB compression is used while under Normal Map on RGBA compression options were available which is something we don’t need.
This fix does however make me nervous as I would assume that the Normal Map setting would be correct and Im afraid that we will be missing out on something by using the Default texture type. Additionally all of our materials would have a message on them saying “This texture is not marked as a normal map Fix Now” even though clicking that button would actually break our web builds.
Does anyone have any input on this? This seems like a workaround and I’d like to have a proper fix in place for this issue. Some additional info on the normal maps themselves they are exported from 3DCoat into photoshop which then exports them as jpgs.
I have to necro this thread, as I seem to have the exact same problem, but only when I’m doing a WebGL build that loads the assets via the addressables system.
Putting all normal maps into “default import” mode seems to kind of work (with small artifacts here and there) but this surely can’t be the solution, right?!
There is a known issue that exporting to WebGL may incorrectly compile shaders in relation to using compressed texture formats if the shaders are present in the “Always Included Shaders” list in Project Graphics settings. Not sure if that is the bug here, though you can try checking if the badly rendering shaders in question are in the “Always Included Shaders” list, and if so, try removing them from there.
I am also posting and following the thread you mean, but this also happens for us if the shaders are used on objects in asset bundles. So this is kind of the same problem, but has nothing to do with the always include list as far as I can tell.
@jukka_j
Edit: I just sent you the link to the open issue where I submitted a mini project with said problem.
@jukka_j@unity_bill@Marco-Trivellato Sorry if this is annoying, but I wanted to check if there’s any new information on this? This is a very important issue for my company.
Hate to keep “necro”-ing this thread…but I am running into the same problem. I made the simplest project ever, just a 2D Map that I can scroll around on. The Normal map is working but there’s no albedo texture.
Sorry, but I don’t think my shader could help - It’s quite specific. I’m just saying that it is possible to recreate something like a default UnityShader with proper normal map behaviour.