Author Topic: Reflection issue  (Read 1020 times)

Offline lesinhorini

  • byte
  • *
  • Posts: 1
    • View Profile
Reflection issue
« on: July 07, 2017, 11:06:19 pm »
I'm having a unspected reflection over my objects (mall.jpg). I would like a light more flat over all objects, keeping a same pattern.

The mall was drawed from a .OBJ file.

Follow below the code where I configure ambient light and a Light.

Code: [Select]
        world = new World();
        world.setAmbientLight(170, 170, 170);

        light = new Light(world);
        light.setIntensity(252, 252, 252);

        // Positioning the light
        SimpleVector sv = new SimpleVector();
        sv.y -= 90;
        sv.z -= 90;

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12258
    • View Profile
Re: Reflection issue
« Reply #1 on: July 07, 2017, 11:16:52 pm »
You mean the 'uneven' lighting? That's caused by vertex lighting applied to quite uneven object/polygon structures. One way to fight this is to use normals that fit the object's structure better then the ones calculated by jPCT. Maybe your mesh already contains these. You can try by setting Config.useNormalsFromOBJ to true before loading the object. If that doesn't help, you have to create proper normals in some 3D editor.
Another option might be to use a kind of per pixel lighting instead, but you have to write your own shader for that.