facebookarchive / react-360

Create amazing 360 and VR content using React
https://facebook.github.io/react-360
Other
8.73k stars 1.22k forks source link

Shininess, emissive and specular are not a property of this material in React VR #92

Closed HeinPauwelyn closed 7 years ago

HeinPauwelyn commented 7 years ago

Description

I'm developing an application with React VR and I've created an 3D pokeball with blender. I've export this as Wavefront .obj file and use it in my React VR application.

In the console I see this warnings:

THREE.MeshBasicMaterial: shininess, emissive and specular are not a property of this material.

Below you could find my code:

import React from 'react';
import { AppRegistry, asset, StyleSheet, Pano, Text, View, Mesh } from 'react-vr';

class pokemongo extends React.Component {
  render() {
    return (
      <View>
        <Pano source={asset('sky.jpg')} />
        <Mesh source={{ mesh: asset('pokeball.obj'), mtl: asset('pokeball.mtl') }} 
              style={{ height: 1 }} 
              transform={{ rotate: '0 90 0' }}></Mesh>
      </View>
    );
  }
};

AppRegistry.registerComponent('pokemongo', () => pokemongo);

This is the rendered output

And on this GitHub Gist you could find the obj and mtl file and could you download the blend file.

Here you could see my pokeball in Blender.

I've searched on the internet but didn't found solutions or documentation about the problem related with React VR.

What I've done wrong?

Additional Information

Personal notes

See this question on Stack Overflow.

andrewimm commented 7 years ago

Please update React VR to 0.2.1 or beyond. This has been resolved in recent versions.

andrewimm commented 7 years ago

Also, when you upgrade, be aware of these changes from 0.1 to 0.2: https://facebook.github.io/react-vr/docs/release-change-log.html

The Mesh API has been significantly improved, so that at least will affect you.

There isn't a graceful way to upgrade from 0.1 to 0.2 (such is the risk with pre-1.0.0 APIs). The easiest way is to upgrade your cli (npm install -g react-vr-cli), then react-vr init a new project, and then copy your code to the new project directory. In the future there will not be such dramatic changes to project configuration.