我有一个问题...是否可以仅对一个对象禁用 GL10.GL_DEPTH_TEST?在我的示例中,有一个带有 Alphashadow 纹理的 Groundplane,我想为我的 Carmodel 禁用 DEPTH_TEST 以伪造阴影。其他对象不应该禁用 DEPTH_TEST,所以我不会通过它们看到阴影。
这是一个屏幕截图(阴影没有完美地转换为它们的对象,但我想你会得到我的问题) https://dl.dropbox.com/u/18265107/special/screenshot.png
我有一个问题...是否可以仅对一个对象禁用 GL10.GL_DEPTH_TEST?在我的示例中,有一个带有 Alphashadow 纹理的 Groundplane,我想为我的 Carmodel 禁用 DEPTH_TEST 以伪造阴影。其他对象不应该禁用 DEPTH_TEST,所以我不会通过它们看到阴影。
这是一个屏幕截图(阴影没有完美地转换为它们的对象,但我想你会得到我的问题) https://dl.dropbox.com/u/18265107/special/screenshot.png
Anything you disable depth-test for will show on top of other stuff. You can choose to do, or not do, that for anything you like. However I don't think it will fix your shadows.
To achieve what you were wanting, disabling depth-test isn't enough, and you would need to render things in the right order:
However this assumes the ground is flat, and that shadows don't cast onto other scene objects, which will probably look wrong.