KhronosGroup / UnityGLTF

Runtime glTF 2.0 Loader for Unity3D
MIT License
1.81k stars 490 forks source link

Unity WebGl build error #742

Closed MarcusGT076 closed 3 months ago

MarcusGT076 commented 3 months ago

Hello there,

i become this 2errors in Unity and i dont know what is the reason for that ? i tried to build on WebGl with Version Unity2022.1.23f1

  1. dergraph@13.1.8/Editor/Generation/Targets/BuiltIn/Editor/ShaderPreprocessor.cs:284) UnityEditor.Rendering.BuiltIn.ShaderPreprocessor.OnProcessShader (UnityEngine.Shader shader, UnityEditor.Rendering.ShaderSnippetData snippetData, System.Collections.Generic.IList`1[T] compilerDataList) (at Library/PackageCache/com.unity.shadergraph@13.1.8/Editor/Generation/Targets/BuiltIn/Editor/ShaderPreprocessor.cs:348) UnityEditor.Build.BuildPipelineInterfaces.OnPreprocessShaders (UnityEngine.Shader shader, UnityEditor.Rendering.ShaderSnippetData snippet, UnityEditor.Rendering.ShaderCompilerData[] data) (at <4ce403b7cdf744109283ae55cdc24285>:0) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

  2. Error building Player: ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: subshaderIndex

would be nice if someone can help me with this issue ?

hybridherbst commented 3 months ago

Hey, please use Unity LTS versions (2021.3 / 2022.3), seems you used 2022.1. Were you able to solve your issue?

MarcusGT076 commented 3 months ago

Hello there,

Yes i was able to solve this issue but it should be in the Plugin direct i think ? Even i have to find out if i am in Runtime mode or not. I dont want to change the PBRGraph itself. So now the volume and transmission in unity is upside down and in the webgl build correct. I use Unity 2023.2.1f1.

Cheers Marcus


Von: hybridherbst @.> Gesendet: Montag, 1. Juli 2024 18:15 An: KhronosGroup/UnityGLTF @.> Cc: MarcusGT076 @.>; State change @.> Betreff: Re: [KhronosGroup/UnityGLTF] Unity WebGl build error (Issue #742)

Hey, please use Unity LTS versions (2021.3 / 2022.3), seems you used 2022.1. Were you able to solve your issue?

— Reply to this email directly, view it on GitHubhttps://github.com/KhronosGroup/UnityGLTF/issues/742#issuecomment-2200560396, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BJMZIXISVQVIUK6Z76SYKATZKF6CDAVCNFSM6AAAAABJY2XOLCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBQGU3DAMZZGY. You are receiving this because you modified the open/close state.Message ID: @.***>

hybridherbst commented 3 months ago

Hey, I'm not sure what you mean by this:

but it should be in the Plugin direct i think

And also this:

Even i have to find out if i am in Runtime mode or not. I dont want to change the PBRGraph itself.

Could you clarify what you mean / what you encountered?

We saw #746 and will take a look this week.

MarcusGT076 commented 3 months ago

Hi 🙂

So the problem is that the what the camera sees in the volume and transmission object is different in Unity editor and a webgl build. When you see through the object with volume and transmission, you see the objects behind the object upside down. So the UV's are flipped.

void SampleSceneColor_float(float2 uv, float lod, out float3 color) its this function in the PBRHelper.cginc File where i corrected the UV's. But of course now the material is in the editor upside down and in the build its correct.

Cheers, Marcus


Von: hybridherbst @.> Gesendet: Dienstag, 2. Juli 2024 13:32 An: KhronosGroup/UnityGLTF @.> Cc: MarcusGT076 @.>; State change @.> Betreff: Re: [KhronosGroup/UnityGLTF] Unity WebGl build error (Issue #742)

Hey, I'm not sure what you mean by this:

but it should be in the Plugin direct i think

And also this:

Even i have to find out if i am in Runtime mode or not. I dont want to change the PBRGraph itself.

Could you clarify what you mean / what you encountered?

We saw #746https://github.com/KhronosGroup/UnityGLTF/issues/746 and will take a look this week.

— Reply to this email directly, view it on GitHubhttps://github.com/KhronosGroup/UnityGLTF/issues/742#issuecomment-2202889179, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BJMZIXNODNX7EUPKYI2XGITZKKFVZAVCNFSM6AAAAABJY2XOLCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBSHA4DSMJXHE. You are receiving this because you modified the open/close state.Message ID: @.***>

hybridherbst commented 3 months ago

Hey, that relates to https://github.com/KhronosGroup/UnityGLTF/issues/746 and that is a separate issue.

We're in the issue titled "Unity WebGl build error" here, so my questions relate to what you had to change to not have a build error anymore.

MarcusGT076 commented 3 months ago

Ahhhh so i get it now 🙂 Sorry for the misunderstanding. So it was my fault in this case thats because i closed this one. It was a problem of some settings in Unity itself and some scripts of mine.

Cheers, Marcus


Von: hybridherbst @.> Gesendet: Dienstag, 2. Juli 2024 19:17 An: KhronosGroup/UnityGLTF @.> Cc: MarcusGT076 @.>; State change @.> Betreff: Re: [KhronosGroup/UnityGLTF] Unity WebGl build error (Issue #742)

Hey, that relates to #746https://github.com/KhronosGroup/UnityGLTF/issues/746 and that is a separate issue.

We're in the issue titled "Unity WebGl build error" here, so my questions relate to what you had to change to not have a build error anymore.

— Reply to this email directly, view it on GitHubhttps://github.com/KhronosGroup/UnityGLTF/issues/742#issuecomment-2203882206, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BJMZIXNP4CHA7KPOMW6SFXTZKLOA3AVCNFSM6AAAAABJY2XOLCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBTHA4DEMRQGY. You are receiving this because you modified the open/close state.