Creating optimized reflection material in jme3 for android

I want to create mirror like reflective metallic surface for vehicle object kinda similar to this game https://play.google.com/store/apps/details?id=ru.Pragmatix.DeathTour&hl=en in an optimized way for the game i am creating for android. I have tried SimpleWaterProcessor but it takes too much processing. I will be glad if anyone can help me out in this. I think an illusion of reflective surface might be possible through shaders.
Screenshot: http://gados.ru/wp-content/uploads/2013/07/Death_tour_3.png

IMO for android you should just use a small env map (128x128x6 not much more) and just do reflection mapping (lighting.j3md supports it)

Thanx for replying Nehon, can you give me some example or provide me with a link which can be helpful to me because i dont have much experience with Reflection mapping with lighting.j3md

Thanx, for your help again Nehon i just implmented the reflection.j3md and got it working and have noticed a performance boost in the gameplay. Here is the code:

        //initialize TextureKey with string texture path
        TextureKey key = new TextureKey(PstringTexture, true);
        key.setGenerateMips(true);
        //initialize environment map
        envMap = assetManager.loadTexture(key);
        Material mat = new Material(assetManager, "MatDefs/Reflection.j3md");
        //Setting texture through environment map
        mat.setTexture("Texture", envMap);
        //Setting material to SphereMap
        mat.setBoolean("SphereMap", true);
         //setting the vehicle reflective surface material
        carNode.getChild("mirror_material").setMaterial(mat);
        carNode.getChild("glass_material").setMaterial(mat);
      
        metallicSurface.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Color);
        //setting the vehicle metallic surface material
        carNode.getChild("hull_material").setMaterial(metallicSurface);
2 Likes

Great nice work

1 Like