happy-turtle / oit-unity

Order-independent Transparency Implementation in Unity with Per-Pixel Linked Lists
Apache License 2.0
186 stars 29 forks source link

Is Android available? #5

Closed BensonMaZIHao closed 2 years ago

BensonMaZIHao commented 2 years ago

Can I use it on Android and Android is black and I can't see anything

happy-turtle commented 2 years ago

You definitely need to build for a backend that supports Shader Model 5.0 (look in the Build Settings for Graphics Backend). And then your device needs to support this backend, on Android Vulkan or OpenGL 4.3+. And even then there is no guarantee that it will work. Specific HLSL features, namely earlydepthstencil and RWStructuredBuffer are used. On Android Unity probably translates the shader code to GLSL. And I have no idea if those HLSL features are correctly translated or if there is even any close equivalent for those features in GLSL. That's why I wrote in the Readme "Other platforms than Windows might not work as expected as this is using more unconventianol HLSL features. Let me know of your experience and if you got this running on different platforms."

All in all I don't know if there is any support for the used shader code on other platforms and it would definitely require additional research and testing from you if you want this to run on an Android device.

BensonMaZIHao commented 2 years ago

您肯定需要为支持着色器模型 5.0 的后端进行构建(请参阅图形后端的构建设置)。然后,您的设备需要在Android Vulkan或OpenGL 4.3 +上支持此后端。即使这样,也不能保证它会起作用。特定的HLSL功能,即和被使用。在Android上,Unity可能会将着色器代码转换为GLSL。我不知道这些HLSL功能是否正确翻译,或者GLSL中是否有任何与这些功能接近的等效项。这就是为什么我在自述文件中写道:“Windows以外的其他平台可能无法按预期工作,因为这使用了更多非常规的HLSL功能。让我知道你的经历,以及你是否在不同的平台上运行过它。earlydepthstencil``RWStructuredBuffer

总而言之,我不知道在其他平台上是否支持使用的着色器代码,如果您希望在Android设备上运行,则肯定需要您进行额外的研究和测试。

All right. Thank you very much.