Пример #1
0
  public void UnLoad() {
    super.UnLoad();

    mShadowMaskObject.Delete();
    mShadowMask.Delete();

    Light.UnLoad();
    ComplexPolygon.UnLoad();
  }
Пример #2
0
  public void Load() {
    mCamera = new Camera(GetGameWindow());

    Light.Load(mGameWindow.Width(), mGameWindow.Height());
    ComplexPolygon.Load(mGameWindow.Width(), mGameWindow.Height());

    mShadowMask = new Texture(mGameWindow.Width(), mGameWindow.Height());

    try {
      mShadowMaskObject = new FrameBufferObject(mShadowMask);
    } catch (Exception e) {
      e.printStackTrace();
    }

    mCamera.ForceScaleFocus((mGameWindow.Width() / 1600.0f + mGameWindow.Height() / 900.0f) / 2);

    mAmbientLighting = 0.0f;
  }
 private Vector3f getEyeSpacePosition(Light light, Matrix4f viewMatrix) {
   Vector3f position = light.getPosition();
   Vector4f eyeSpacePos = new Vector4f(position.x, position.y, position.z, 1f);
   Matrix4f.transform(viewMatrix, eyeSpacePos, eyeSpacePos);
   return new Vector3f(eyeSpacePos);
 }