The first answer doesn't solve anything. It's just saying to do what we already
pretty much do. Shade the surface only if it points towards the light. The
second answer works. You can use a slightly different vertex shader to render an
objects geometry a second time, reversing the normal before using it. The third
answer doesn't work because culling is off. If you render two meshes in exactly
the same location, you will get z fighting. If culling was turned on in the data
set properly, this solution would work. Well, this solution doubles the size of
the geometry need to store. It does have the advantage of not needing any
special treatment. It's just another object to render in the normal way. The
fourth answer will make almost all surfaces get some light. This fix will have
the effect of properly making the dark inside of the object be lit. However,
there are also areas inside that are lit that shouldn't be, and these will
continue to be lit. Similarly, the outside of the object would now be lit in
both sides, which gets too much light, so this answer is wrong.
第1の案は何も解決しません
これはすでにやっていることで表面がライトの方を
向いている時だけシェーディングします
第2の案は正解です
2回目は わずかに異なる頂点シェーダを使って
オブジェクトジオメトリをレンダリングできます
頂点シェーダを実行する前に法線を逆にしてください
第3の案はカリングが無効なため機能しません
2つのメッシュをまったく同じ位置に
レンダリングするとZファイティングが起こります
適切な設定のデータでカリングが有効なら
この方法は機能します
しかし保存の必要なジオメトリの
サイズが2倍になります
特別な処理が不要という利点もあります
通常の方法でもう1つオブジェクトを
レンダリングすればいいからです
第4の案は ほぼすべての表面にライトを当てます
この方法はオブジェクトの内側の暗い部分を
適度に照らす効果があります
しかし内側のライトが当たらないはずの部分まで
照らし続けてしまいます
同様にオブジェクトの外側も両面が照らされ
明るくなりすぎるため この方法は正しくありません
第一個答案沒有解決任何問題,它描述的我們已經做了
在法向量指向光源時才替表面上色
第二個答案可以,你能用稍微不同的 Vertex Shader 來繪製物件的幾何第二次
在使用之前先反轉法向量
第三個答案不行,因為剔除被關掉了
如果你在同一位置繪製兩個網格,會觸發 Z-Fighting
如果剔除打開且資料有妥善處理過,這個做法能成功
這個作法讓幾何需要的儲存空間大小加倍
但優點是不需要任何特殊處置,正常地畫第二個物件即可
第四個答案會讓所有面都受到一些光照
這個修正可以讓物件內部的黑暗面亮起來
但是內部不該亮的部分也會亮起來
同樣地,物件外部表面會受兩次光,這樣太多了
所以這答案是錯的