Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by nasirs001 · Oct 22, 2015 at 10:11 AM · buildwebglbuild-error

Webgl build problems

Well, I've searched everywhere but I can't find any sort of answer so I'm hoping I can receive some help here. I'm experiencing three huge problems when I build my game using the webgl platform. The first is that all my shaders either have some weird new offset or the colors are slightly out of wack.The second problem is that only some of my reflection probes work while other's aren't doing anything, I also recieve this error upon loading up scenes where this is happening "PPtr cast failed when dereferencing! Casting from Shader to Texture! UnityEditor.DockArea:OnGUI()". the last problem that I'm having (although this may not be webgl build specific) is that my character's mesh is distorted. Any help is appreciated :)

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Statement · Oct 22, 2015 at 07:30 PM

Sounds like you got a corrupt metafile for some shader.

If you got a more recent version than 4.2 try deleting your Library folder.

Note: Projects created in Unity 4.2 and earlier may not have .meta files if not explicitly enabled. Deleting the Library folder in these projects will lead to data loss and permanent project corruption because both the generated internal formats of your assets and the meta data were stored in the Library folder.


However, it is always safe to delete the Library folder (while the project is not open in Unity) as all its data is generated from what is stored in the Assets and ProjectSettings folders. This also means that the Library folder should not be included in version control.

Do you have a longer callstack? Also try to break up your questions so there's a post each. For example right now I am providing an answer to one of three topics. Not everyone can answer all questions.

Comment
Add comment · Show 6 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image nasirs001 · Oct 22, 2015 at 09:41 PM 0
Share

I tried this but still didn't work. Also, in response to your suggestion, I posted all three here in case the problems we're directly related to each other or that it may help diagnose my problem. I have no idea what a callstack is so sorry I can't really answer that question. Thanks for trying to help :).

avatar image Statement nasirs001 · Oct 22, 2015 at 10:05 PM 0
Share

You can view the entire log or upload it to some paste site like pastebin and give me the link.

http://docs.unity3d.com/$$anonymous$$anual/LogFiles.html

A call stack is the chain of functions called that generated the log. You have the top part of the call stack already in there (UnityEditor.DockArea:OnGUI()). It could be interesting to see what the call stack looks like to figure out which system throws the error. It could also be that there is no visible call stack because it was called from native code. In that case you only see that one frame.

avatar image Statement nasirs001 · Oct 22, 2015 at 10:16 PM 0
Share

The best clue I got so far is that some editor window expects a texture but for some reason it got a shader. Perhaps you have been toying with editor extensions? I don't know why that error happens but PPtrs are persistent pointers. Each object that you or Unity creates is assigned a PPtr. I believe the PPtrs are stored in scene files and any resource bundles that Unity manages. If you open up a scene file with a text editor, you can spot them in the yaml. Let's look at a snip from one of my files.

 --- !u!124 &503149942
 Behaviour:
   m_ObjectHideFlags: 0
   m_PrefabParentObject: {fileID: 0}
   m_PrefabInternal: {fileID: 0}
   m_GameObject: {fileID: 503149940}
   m_Enabled: 1
 --- !u!92 &503149943
 Behaviour:
   m_ObjectHideFlags: 0
   m_PrefabParentObject: {fileID: 0}
   m_PrefabInternal: {fileID: 0}
   m_GameObject: {fileID: 503149940}
   m_Enabled: 1

Here, 503149942, 503149940 and 503149943 would be examples of these PPtrs (if I remember it right). What I guess is that somewhere there is a variable that happens to point to a shader ins$$anonymous$$d of a texture. One far fetch/a hunch is that perhaps you had a variable called foo that used to be of type Shader, but then you changed the type of foo to Texture. I don't know if Unity would correct that by setting it to 0 or if it would have a reference to that shader that used to sit there.

avatar image Statement nasirs001 · Oct 22, 2015 at 10:28 PM 0
Share

Ok so I got curious. I added a component to a scene that has a public Shader foo; without setting it to anything. This is what Unity saves:

 --- !u!114 &788221524
 $$anonymous$$onoBehaviour:
   m_ObjectHideFlags: 0
   m_PrefabParentObject: {fileID: 0}
   m_PrefabInternal: {fileID: 0}
   m_GameObject: {fileID: 788221522}
   m_Enabled: 1
   m_EditorHideFlags: 0
   m_Script: {fileID: 11500000, guid: b4a5c37aba2283546b84dd0eaaf88e45, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
   foo: {fileID: 0}

Here, we can see foo: {fileID: 0} - it's not set to anything. Ok, let's give foo a shader reference:

 --- !u!114 &788221524
 $$anonymous$$onoBehaviour:
   m_ObjectHideFlags: 0
   m_PrefabParentObject: {fileID: 0}
   m_PrefabInternal: {fileID: 0}
   m_GameObject: {fileID: 788221522}
   m_Enabled: 1
   m_EditorHideFlags: 0
   m_Script: {fileID: 11500000, guid: b4a5c37aba2283546b84dd0eaaf88e45, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
   foo: {fileID: 4800000, guid: f294816f329f42d4295989333f95f30a, type: 3}

It says foo: {fileID: 4800000, guid: f294816f329f42d4295989333f95f30a, type: 3}

I don't know what fileID means in this context though. Looking in the shaders metafile we see that the guid matches.

 fileFormatVersion: 2
 guid: f294816f329f42d4295989333f95f30a
 timeCreated: 1445552297
 licenseType: Free
 ShaderImporter:
   defaultTextures: []
   userData: 
   assetBundleName: 
   assetBundleVariant: 

Ok, so then I changed the type of foo to Texture ins$$anonymous$$d of Shader and saved the scene (without touching the field in the inspector)

 --- !u!114 &788221524
 $$anonymous$$onoBehaviour:
   m_ObjectHideFlags: 0
   m_PrefabParentObject: {fileID: 0}
   m_PrefabInternal: {fileID: 0}
   m_GameObject: {fileID: 788221522}
   m_Enabled: 1
   m_EditorHideFlags: 0
   m_Script: {fileID: 11500000, guid: b4a5c37aba2283546b84dd0eaaf88e45, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
   foo: {fileID: 4800000, guid: f294816f329f42d4295989333f95f30a, type: 3}

We can see that fileID, guid and type are unchanged. I guess this means that if something tried to access foo and expect it was a Texture, Unity would get angry because f294816f329f42d4295989333f95f30a is a Shader.

So, perhaps this could be a possible cause? $$anonymous$$aybe you changed the type of a variable when you were editing away? If a prefab or scene used to reference a shader, that shader reference still exists in the scene or prefab file.

avatar image nasirs001 Statement · Oct 22, 2015 at 11:05 PM 0
Share

I appreciate you being patient with me and doing so much explaining. I think I found the problem. the albedo for a couple of my materials were sprites ins$$anonymous$$d of textures. I changed them so hopefully that does the trick.

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

36 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

WebGL build failure: Mono.Cecil.ResolutionException: Failed to resolve UnityEngine.Profiler 1 Answer

Unity 2019.3.9f1 WebGL build error TypeLoadException when making release build 3 Answers

I can't build Webgl 0 Answers

I cant build WebGL 3 Answers

WebGL build failing Unity v5.2 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges