UnityProceduralPlanets icon indicating copy to clipboard operation
UnityProceduralPlanets copied to clipboard

Compute Shader Error

Open Setz0r opened this issue 3 years ago • 2 comments

Just loaded up the project in 2020.3.22f1. When attempting to launch the included scene, I'm getting compute shader errors almost everywhere they are used.

Sporting an nVidia RTX 2060 6gb, 32gb ram, i7 8700k cpu

A few examples:

GeneratePlanetHeightMap.compute: Kernel at index (0) is invalid
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Planet:GeneratePlanetData () (at Assets/ProceduralPlanets/Planet.cs:137)
Planet:Start () (at Assets/ProceduralPlanets/Planet.cs:87)
GenerateChunkHeightMap.compute: Kernel at index (0) is invalid
UnityEngine.StackTraceUtility:ExtractStackTrace ()
ChunkData:GenerateHeightMap () (at Assets/ProceduralPlanets/ChunkData.cs:490)
ChunkData/<StartGenerateCoroutine>d__56:MoveNext () (at Assets/ProceduralPlanets/ChunkData.cs:315)
Planet:GenerateChunks (System.Diagnostics.Stopwatch,System.TimeSpan) (at Assets/ProceduralPlanets/Planet.cs:338)
Planet:LateUpdate () (at Assets/ProceduralPlanets/Planet.cs:286)
GenerateChunkDiffuseMap.compute: Kernel at index (0) is invalid
UnityEngine.StackTraceUtility:ExtractStackTrace ()
ChunkData:GenerateDiffuseMap () (at Assets/ProceduralPlanets/ChunkData.cs:735)
ChunkData/<StartGenerateCoroutine>d__56:MoveNext () (at Assets/ProceduralPlanets/ChunkData.cs:345)
Planet:GenerateChunks (System.Diagnostics.Stopwatch,System.TimeSpan) (at Assets/ProceduralPlanets/Planet.cs:338)
Planet:LateUpdate () (at Assets/ProceduralPlanets/Planet.cs:286)

Setz0r avatar Nov 24 '21 01:11 Setz0r

I am experiencing exactly the same issue. Is there any update on this matter? I am using Unity 2021.3.3f1

dev-bre avatar Sep 01 '22 16:09 dev-bre

Appearantly, the casing of the shader names is a problem ;

the shaders are named "Something.compute.cginc", and the casing in the references is "Something.Compute.cginc" ; so either change the casing in the name of the cginc files or in the references.

Then it seems the chained imports in these files are also broken. I got it to function by adding imports for any functions the compiler said were not defined.

On top of this, several versions of Unity seem to have issues with using async data copying from vertex buffers ; the only solution there is to switch to build 2020.3.26f1 or later.

It should be noted that even with these problems solved, there are still many other shader issues such as memory leaks.

timgroote avatar Aug 22 '23 09:08 timgroote