Solar-System icon indicating copy to clipboard operation
Solar-System copied to clipboard

Planets only render water in WebGL build

Open amack2u opened this issue 5 years ago • 2 comments

Hello, I am having an issue testing in WebGL. It Builds successfully, but then when running in the browser the terrain is not visible only the water. I think it may be related to the compute shaders not compiling, however there is no errors in unity indicating that.

Unity version 2019.4.1f1

repeated errors from webgl build in the browser console: IndexOutOfRangeException: Invalid kernelIndex (0) passed, must be non-negative less than 0. Kernel index (0) out of range

Thanks

amack2u avatar Aug 26 '20 18:08 amack2u

It is, quite possibly, a compute shader has failed to compile. The console for some reason does not show that error, however the Inspector reveals it upon clicking on a problematic shader.

Delofon avatar Mar 29 '21 18:03 Delofon

Has anyone found a fix to get planets working in WebGL? I unchecked 'Has Atmosphere' and the planet generates, but the collider does not generate. In the console window I get the errors: "Kernel index (0) out of range"(x2) and "IndexOutOfRangeException: Invalid kernelIndex (0) passed, must be non-negative less than 0."

I have determined that the errors are coming from CelestialBodyShape.cs, lines 25, 26, and 29 respectively. Seems like vertexBuffer.count is 0? @SebLague any ideas? Awesome project and video series by the way. Glad I found this.

Edit: just logged vertexBuffer.count and it is actually not 0. Not entirely sure why ComputeHelper.Run (heightMapCompute, vertexBuffer.count); is giving me the IndexOutOfRangeException error

Edit 2: WebGL does not support compute shaders. How difficult would it be to somehow convert the compute shader portion of this project to something else? I'm not really sure how to go about this/what to even look up

evanhosni avatar Jun 18 '22 03:06 evanhosni