0

質問があります...1つのオブジェクトに対してのみGL10.GL_DEPTH_TESTを無効にすることは可能ですか?私の例では、Alphashadowテクスチャを備えたGroundplaneがあり、カーモデルのDEPTH_TESTを無効にして、シャドウを偽造します。他のオブジェクトではDEPTH_TESTを無効にしないでください。そのため、他のオブジェクトを通して影が見えなくなります。

これがスクリーンショットです(シャドウはオブジェクトに完全に変換されていませんが、問題が発生すると思います) https://dl.dropbox.com/u/18265107/special/screenshot.png

4

1 に答える 1

2

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:

  1. render the ground.
  2. render the car.
  3. render the shadows, with depth-test disabled.
  4. render the rest of the environment.

However this assumes the ground is flat, and that shadows don't cast onto other scene objects, which will probably look wrong.

于 2012-12-15T15:04:32.483 に答える