Reflection issue

Started by lesinhorini, July 07, 2017, 11:06:19 PM

Previous topic - Next topic

lesinhorini

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.


        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.set(model3D.getTransformedCenter());
        sv.y -= 90;
        sv.z -= 90;
        light.setPosition(sv);

EgonOlsen

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.