-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shaders not WebGL compatible #12
Comments
Hi ! I do not know exactly the source of error, but you can use Potree(WebGL point cloud viewer for large datasets, http://potree.org), it allows a good visualization in browser. |
Thanks for the quick response! I see. I would like to build in some custom tools to be able to load custom data in the pointcloud, like bullet points etc. not to mention i want to be able to develop a VR and WebGL application in one go. Maybe i'm just asking to much of Unity :) Since i prefer to work in unity i'm going to try to fix this issue first before checking alternatives, also because i'm quite amazed by the performance of this package (also potree). I'm still open for suggestions ofcourse! Into the shader magic I go! I'll post potential fixes in this thread. |
So i've finally managed to find some time to look into this further... So a quick update. I've been working on removing all multithreaded and System.File code and replacing it with coroutines and webrequest. This gives good results so far. Things that work so far in webgl/browser: Things i'm currently trying to fix: I made a package of the changes I made if someone wants to check it out. Its quite a mess since i basicly copied the necessary scripts and butchered them to work with coroutines. https://drive.google.com/open?id=1r6VT_SngwcQFA7VjVMPAlF6sfEwOd2ab Cheers! |
Another update: |
There are two problems for using this project in unity WebGL:
If anyone is interested in collaboration to fix this problem, please send me an email. |
Yes you are correct about both issues. In this package About point 2 I made a thread on the Unity WebGL forum. One of the Unity employees recommended trying particle systems for rendering the points in WebGL. I've also not found time yet to look into this yet. the thread is found here https://forum.unity.com/threads/meshtopology-point-not-rendering-workaround.758369/#post-5051375 I would like to work on this together but i'm not always available. |
Thank you robibkuiper and mojtaba1995 for your interest. Maybe you can figure out together how to solve these problems. I only have limited availability, but if I can help you in any way, let me know. I haven't checked out your package, might do so when I have some time. My knowledge about WebGL and the threading issues there is also a bit rusty. |
Yes, the quads will work, but that's not efficient as you said. robibkuiper you can send me an email and we can work on it together to fix this issue ([email protected]). |
Hi,I have been trying this robibkuiper's modified version with Quad4PointMeshConfiguration to load point cloud with Unity webgl and it is performing quite good when the build and data are on my local machine. When I transfer this to my server it seems that either the data streaming is very slow or there is still some problem with loading-travelsel-rendering coroutines. It seems that loading or rendering comes behind tens of seconds so that if I move camera from room1 to room2 it still loads/renders room1 data for a while before starting to load/renser room2 data. My application is running steadily on 60fps and server cpu/memory does not seem to have affect to this at all. Did robibkuiper or mojtaba1995 get any improvements on this or does anyone has any hints how to continue with this? Networking should |
@TuomasK1989 I'm not sure whats going on but it might be that the program keeps pushing new nodes on the loading coroutine list, but because the previous ones are not downloaded yet (probably your internet connection can't keep up) it just keeps adding the newest ones to the back of the list. What you might try to do is stopping all coroutines and clean the loader list before entering the new room. its been a while so im not exactly sure anymore in which script you can find theses lists. |
I have tried this modified webgl code with somewhat larger datasets and it seems that when there is more points the initial point cloud loading takes a while. I am not sure what there happens when loading starts but for 500M point it takes about 90 seconds until Unity starts rendering point cloud and creating gameobjects. Is this some thing that is normal and how could this be avoided so that loading starts immediately after startup. In the main branch where multiple threads is used this startup is instant. I am also interested if this solution could be adjusted to work with potree 2.0 converted datasets. What do You think about this? |
Heya! I managed to get @robibkuiper version of the plugin working in webGL using Unity's Particle Systems. I've tested it with a pointcloud that's 340 million points. It takes about 4-5 seconds to load and the performance is 150-200+ fps (so it runs quite smoothly). if you wanna recreate what I did, edit PointMeshConfiguration.cs to include a particle system prefab:
And in the CreateGameObject function, add the particlesystem as a child and set the mesh renderer of the particle system to the renderer that Potree created:
Also don't forget to set I've included the particle system prefab I used as a Unity package: You can tweak the StartSize and Max particles/Rate over Time settings to control how many points and detail you want to render. Hope this can help someone! |
Using a particle system works on the web Here's a raw example of creating a star field. There can be some issues using the particle system though. ie If we upload the points to gpu, then we can't delete them from local memory - saving space on webgl builds. Can't do that with particlesystem by the looks because of the setparticle update.
|
Hello,
I just came across this project today and i'm amazed by its performance so far. It blows away everything i've done so far trying to load a point cloud in unity.
Right now i'm working on a case that requires point clouds to be loaded in browser so i changed this package to load the files from StreamingAssets and tried building it for WebGL. Sadly it doesn't want to load the shaders. These are the errors i get in the console:
WARNING: Shader
Unsupported: 'Custom/QuadGeoScreenSizeShader' - Pass '' has no vertex shader
ERROR: Shader
Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)
WARNING: Shader
Unsupported: 'Custom/QuadGeoScreenSizeShader' - Setting to default shader.
I'm not really a shader magician so i'm struggling to find a fix for this.
I build it in Unity 2019.1.8f1 with both webgl 2.0 and 1.0 as graphics api without any difference in result. i've also tried to use some of the other shaders in the project with the same result. Do you have any suggestions what could cause the shaders not to load?
Thanks in advance for your answer!
The text was updated successfully, but these errors were encountered: