private MaterialWrapper createMaterial(String materialName, ReadableMap materialMap, VideoTexture videoTexture) {
        MaterialWrapper materialWrapper = new MaterialWrapper(materialName, materialMap);

        // These defaults match those in the JNI's Material.java
        Material.LightingModel lightingModel = Material.LightingModel.CONSTANT;
        int diffuseColor = Color.WHITE;
        int chromaKeyFilteringColor = Color.GREEN;
        boolean chromaFilteringEnabled = false;
        Texture diffuseTexture = null;
        float diffuseIntensity = 1.0f;
        Texture specularTexture = null;
        float shininess = 2.0f;
        float fresnelExponent = 1.0f;
        Texture normalMap = null;
        Material.CullMode cullMode = Material.CullMode.BACK;
        Material.TransparencyMode transparencyMode= Material.TransparencyMode.A_ONE;
        Material.BlendMode blendMode = Material.BlendMode.ALPHA;
        EnumSet<Material.ColorWriteMask> colorWriteMask = EnumSet.of(Material.ColorWriteMask.ALL);
        float bloomThreshold = -1.0f;
        boolean writesToDepthBuffer = true;
        boolean readsFromDepthBuffer = true;

        ReadableMapKeySetIterator iter = materialMap.keySetIterator();
        while(iter.hasNextKey()) {
            final String materialPropertyName = iter.nextKey();

            boolean isPbrProperty = false;
            for (PBRProperties property : PBRProperties.values()){
                if (property.key.equalsIgnoreCase(materialPropertyName)){
                    isPbrProperty = true;
                    break;
                }
            }
            if (isPbrProperty) {
                continue;
            }

            if (materialPropertyName.endsWith("texture") || materialPropertyName.endsWith("Texture")) {
                if (materialPropertyName.equalsIgnoreCase("reflectiveTexture")) {
                    Texture nativeTexture = createTextureCubeMap(materialMap.getMap(materialPropertyName), Texture.Format.RGBA8);
                    // TODO Reflective texture are unsupported currently
                    continue;
                }

                String path = parseImagePath(materialMap, materialPropertyName);
                String type = parseAssetType(materialMap, materialPropertyName);
                Texture.Format format = parseImageFormat(materialMap, materialPropertyName);
                boolean mipmap = parseImageMipmap(materialMap, materialPropertyName);
                boolean sRGB = !materialPropertyName.startsWith("normal");

                Uri uri = Helper.parseUri(path, mContext);
                if (path != null) {
                    if (isVideoTexture(path, type)) {
                        materialWrapper.addVideoTexturePath(materialPropertyName, uri);
                        diffuseTexture = videoTexture;
                    } else {
                        if (sImageMap.get(materialPropertyName) != null) {
                            Texture texture = parseTexture(sImageMap.get(materialPropertyName), sRGB, mipmap,
                                    materialPropertyName, materialMap);
                            if (materialPropertyName.equalsIgnoreCase("diffuseTexture")) {
                                diffuseTexture = texture;
                            }
                            else if (materialPropertyName.equalsIgnoreCase("specularTexture")) {
                                specularTexture = texture;
                            }
                            else if (materialPropertyName.equalsIgnoreCase("normalTexture")) {
                                normalMap = texture;
                            }
                            else {
                                throw new IllegalArgumentException("Invalid texture property received: " + materialPropertyName);
                            }
                        } else {
                            ImageDownloader downloader = new ImageDownloader(mContext);
                            downloader.setTextureFormat(format);

                            Bitmap imageBitmap = downloader.getImageSync(uri);
                            if (imageBitmap != null) {
                                Image nativeImage = new Image(imageBitmap, format);
                                Texture texture = parseTexture(nativeImage, sRGB, mipmap,
                                        materialPropertyName, materialMap);
                                if (materialPropertyName.equalsIgnoreCase("diffuseTexture")) {
                                    diffuseTexture = texture;
                                }
                                else if (materialPropertyName.equalsIgnoreCase("specularTexture")) {
                                    specularTexture = texture;
                                }
                                else if (materialPropertyName.equalsIgnoreCase("normalTexture")) {
                                    normalMap = texture;
                                }
                                else {
                                    throw new IllegalArgumentException("Invalid texture property received: " + materialPropertyName);
                                }
                            }
                        }
                    }
                }
            } else if (materialPropertyName.endsWith("color") || materialPropertyName.endsWith("Color")) {
                int color = materialMap.getInt(materialPropertyName);
                if (materialPropertyName.equalsIgnoreCase("diffuseColor")) {
                    diffuseColor = color;
                }
                else if(materialPropertyName.equalsIgnoreCase("chromaKeyFilteringColor")) {
                    chromaKeyFilteringColor = color;
                    chromaFilteringEnabled = true;
                }
                else {
                    throw new IllegalArgumentException("Invalid color property for material: " + materialPropertyName);
                }
            } else {
                if ("shininess".equalsIgnoreCase(materialPropertyName)) {
                    shininess = (float)materialMap.getDouble(materialPropertyName);
                } else if ("fresnelExponent".equalsIgnoreCase(materialPropertyName)) {
                    fresnelExponent = (float)materialMap.getDouble(materialPropertyName);
                } else if ("lightingModel".equalsIgnoreCase(materialPropertyName)) {
                    lightingModel = Material.LightingModel.valueFromString(materialMap.getString(materialPropertyName));
                } else if ("blendMode".equalsIgnoreCase(materialPropertyName)) {
                    blendMode = Material.BlendMode.valueFromString(materialMap.getString(materialPropertyName));
                } else if ("transparencyMode".equalsIgnoreCase(materialPropertyName)) {
                    transparencyMode = Material.TransparencyMode.valueFromString(materialMap.getString(materialPropertyName));
                } else if ("writesToDepthBuffer".equalsIgnoreCase(materialPropertyName)) {
                    writesToDepthBuffer = materialMap.getBoolean(materialPropertyName);
                } else if ("readsFromDepthBuffer".equalsIgnoreCase(materialPropertyName)) {
                    readsFromDepthBuffer = materialMap.getBoolean(materialPropertyName);
                } else if ("colorWriteMask".equalsIgnoreCase(materialPropertyName)) {
                    ReadableArray colorWriteArray = materialMap.getArray(materialPropertyName);
                    List<Material.ColorWriteMask> colorWriteList = new ArrayList<Material.ColorWriteMask>();
                    for (int c = 0; c < colorWriteArray.size(); c++) {
                        colorWriteList.add(Material.ColorWriteMask.valueFromString(colorWriteArray.getString(c)));
                    }

                    colorWriteMask = EnumSet.noneOf(Material.ColorWriteMask.class);
                    colorWriteMask.addAll(colorWriteList);
                } else if ("cullMode".equalsIgnoreCase(materialPropertyName)) {
                    cullMode = Material.CullMode.valueFromString(materialMap.getString(materialPropertyName));
                } else if ("diffuseIntensity".equalsIgnoreCase(materialPropertyName)) {
                    diffuseIntensity = (float)materialMap.getDouble(materialPropertyName);
                } else if ("bloomThreshold".equalsIgnoreCase(materialPropertyName)) {
                    bloomThreshold = (float)materialMap.getDouble(materialPropertyName);
                }
            }
        }

        Material nativeMaterial = new Material(lightingModel, diffuseColor, diffuseTexture,
                diffuseIntensity, specularTexture, shininess, fresnelExponent, normalMap,
                cullMode, transparencyMode, blendMode, bloomThreshold, writesToDepthBuffer,
                readsFromDepthBuffer, colorWriteMask);

                nativeMaterial.setName(materialName);
        if (chromaFilteringEnabled) {
            nativeMaterial.setChromaKeyFilteringEnabled(chromaFilteringEnabled);
            nativeMaterial.setChromaKeyFilteringColor(chromaKeyFilteringColor);
        }

        materialWrapper.setNativeMaterial(nativeMaterial);

        // Parse stuff
        parsePBRProperties(PBRProperties.METALNESS, nativeMaterial, materialMap);
        parsePBRProperties(PBRProperties.ROUGHNESS, nativeMaterial, materialMap);
        parsePBRProperties(PBRProperties.AMBIENT_OCCLUSION_TEXTURE, nativeMaterial, materialMap);

        // We don't need to hold a Java texture reference after assigning the texture to the material.
        // Make an exception for the videoTexture as we use the nativeref to play,pause, loop the video.
        if (diffuseTexture != null && videoTexture == null) {
            diffuseTexture.dispose();
        }
        if (specularTexture != null) {
            specularTexture.dispose();
        }
        if (normalMap != null) {
            normalMap.dispose();
        }
        return materialWrapper;
    }
This function goes through every material and reloads the material
android/viro_bridge/src/main/java/com/viromedia/bridge/module/MaterialManager.java