0
votes

I am using the Three.js JSON exporter plugin in Blender to export a basic test model which I am then loading in three.js.

The json loads the model fine, but the 'mirror' value which I have added on a couple of the materials is not showing up on the model.

I have seen this question ( Blender mirror modifier doesn't export mirrored half ) and a couple others including some threads on the three.js git but nothing seemingly tackling this issue.

Thanks!

1

1 Answers

0
votes

I think you're referring to two different "mirror" attributes. The mirror modifier duplicates and reverses geometry over a chosen axis or offset object. The mirror you're talking about (reflectivity) would require a ray traced renderer, so it's not available in webGL.

A close second would be to add an envmap/cubemap to your material, which gives the effect that your model reflects its environment. To do this, you need two things.

Here's an example:

  1. Make sure your material has a reflectivity value.
  2. Make sure your material has a envmap.

Here's how I did that in the above example: http://novak.us/labs/UmDemo/

            var path = "textures/images/blurredRoom_";
            var format = '.jpg';
            var urls = [
                    path + 'px' + format, path + 'nx' + format,
                    path + 'py' + format, path + 'ny' + format,
                    path + 'pz' + format, path + 'nz' + format
                ];

            var reflectionCube = THREE.ImageUtils.loadTextureCube( urls );
            reflectionCube.format = THREE.RGBFormat; 


            UMLogo.children[0].material.envMap = reflectionCube;
            UMLogo.children[0].material.reflectivity = 0.6;
            UMLogo.children[2].material.envMap = reflectionCube;
            UMLogo.children[2].material.reflectivity = 0.6;

I hope that helps.