• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Main repository of MikuMikuStudio


コミットメタ情報

リビジョン6df71aae069fc6075e8eb78f97f7309f0de711a0 (tree)
日時2013-06-13 04:11:21
作者remy.bouquet@gmail.com <remy.bouquet@gmai...>
コミッターremy.bouquet@gmail.com

ログメッセージ

SpotLigth: the cosine of the inner and outer angle of a spotlight are packed in the same float to send it to the shader (to save some varryings). This imples that their precision is no more than 0.001. This was producing wrong lighting for very close angles because the cosine were equals.
There is now a check that ensure that the outer cos is lower than the inner cos.

git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@10648 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

変更サマリ

差分

--- a/engine/src/core/com/jme3/light/SpotLight.java
+++ b/engine/src/core/com/jme3/light/SpotLight.java
@@ -71,7 +71,13 @@ public class SpotLight extends Light implements Savable {
7171 float innerCos=FastMath.cos(spotInnerAngle);
7272 float outerCos=FastMath.cos(spotOuterAngle);
7373 packedAngleCos=(int)(innerCos*1000);
74+ //due to approximations, very close angles can give the same cos
75+ //here we make sure outer cos is bellow inner cos.
76+ if(((int)packedAngleCos)== ((int)(outerCos*1000)) ){
77+ outerCos -= 0.001f;
78+ }
7479 packedAngleCos+=outerCos;
80+ System.out.println("anfle"+ packedAngleCos);
7581 }
7682
7783 @Override