uRaymarching
uRaymarching copied to clipboard
Is this technique compatible with mobile platforms?
I developed a sample project with uRaymarching. There is no problem with PC. But, when I built project for mobile platform, i receive 5-10 fps. I also receive color problem. Character that i applied the shader turns black on mobile platform.
That's my project link : https://github.com/tunchasan/Blob-Runner3D-Clone
This is the shader : https://github.com/tunchasan/Blob-Runner3D-Clone/blob/main/Assets/_Main/Shader/TransformProvider.shader
I'm looking for some help :)
Raymarching is a very heavy technique. To make it work well on mobile, the per-pixel load needs to be reduced.
- Reduce the complexity of the formula
- Reduce the number of loops (
Loop
) - Increase the
Minimum Distance
so that the loop finishes faster - Reduce the resolution of the rendering buffer (uRaymarching does not support this)
And I ran the sample scenes in uRaymarching on Android and both Forward / URP (Forward) worked fine. Could you try the same?
Thank you for your support. I made remarkable optimization progress for mobile. I followed your instructions and got result. But there are still a few issue that I need to handle. I have tested project new version on Android Devices, BlueStack Android Emulator and IOS. The project run on IOS without any problem. But, there is an interesting case between BlueStack Android Emulator and Android devices. I simulated the project with very low Android device settings on BlueStack Android Emulator with 40-50 fps. Here is the interesting thing, when I run the project on Android device which has very high capabilities than the BlueStack Android Emulator, I get 1-5 fps.
I got screenshots from IOS, Android Device and BlueStack Android Emulator. I noticed the Shader Level. The shader level is 35 on BlueStack Android Emulator. Even I keep same settings, the shader level is 50 on Android Devices.
Note : I also shared the Device's hardware specifications on bottom the images.
BlueStack Android Test
![BlueStack Test](https://user-images.githubusercontent.com/39636292/166506665-1ae126c5-ccbb-49ab-b5b0-0f3407a6de7a.png)
Android Test - 1
![Android Test 1](https://user-images.githubusercontent.com/39636292/166511782-905b5e29-c599-4d90-bb18-16513c1e477a.jpeg)
Android Test - 2
![Android Test 2](https://user-images.githubusercontent.com/39636292/166508720-a164f9c8-097f-490c-b63c-e3bca4532066.jpeg)
IOS Test
![IOS Test](https://user-images.githubusercontent.com/39636292/166508989-811cd30e-f59f-4004-a801-5c90e0074092.jpeg)
1 fps seems too slow... It might be a good idea to connect Profiler to analyze to see if the graphics are really the cause. (For example, the FPS often drops noticeably in cases where a lot of error messages are output.)
Of course, differences in Shader Level may also have an indirect effect, but I have no idea at this time... 😢