Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iPad 3/4 - Nothing Visible in Scene #9131

Closed
mzlock opened this issue Jun 14, 2016 · 15 comments
Closed

iPad 3/4 - Nothing Visible in Scene #9131

mzlock opened this issue Jun 14, 2016 · 15 comments

Comments

@mzlock
Copy link

mzlock commented Jun 14, 2016

Description of the problem

On iPad gen 3 and gen 4, nothing appears to render; I just get a black scene. In http://threejs.org/examples/#webgl_lights_pointlights2 the lights are rendering, but some geometry is missing. In my scene, if I remove the point lights and use an ambient light instead, it works.

Three.js version

greater than 0.74.0

Browser

All of them - Chrome, Safari, Firefox on iOS

OS

iOS - 9.3.2

Hardware Requirements (graphics card, VR Device, ...)

Shows on gen 3 and 4 iPads, but not a iPad Air 2

May be related to #9100

My code:

addPointLight: function(x, y, z, intensity, distance, decay, color) {
    intensity = intensity ? intensity : 1
    distance = distance ? distance : 100
    decay     = decay ? decay : 1
    color       = color ? color : 0xffffff

    var light = new THREE.PointLight(color, intensity, distance, decay)
    light.position.set( x, y, z )
    scene.add(light)

    return light
}

// can see things with this ambient light present
var light = new THREE.AmbientLight( 0x404040 ); // soft white light
this.scene.add( light );

// forward lights
addPointLight(40, -10, 10, 3, 80, 2.2, 0xff0000)  // bottom right
addPointLight(-40, 20, 40, 3.5, 180, 3.3) // top left - primary light

// bounce lights
addPointLight(15, -20, 3, 0, 30, 2, 0xff0000) // bottom right
addPointLight(-20, 40, 0, 28, 20, 2) // top left
@mrdoob
Copy link
Owner

mrdoob commented Jun 14, 2016

image

iPad Air 1st Gen

@mrdoob
Copy link
Owner

mrdoob commented Jun 14, 2016

Are there any errors in the console? (If you connect the ipad to your computer you should be able to check the console: http://moduscreate.com/enable-remote-web-inspector-in-ios-6/)

@mzlock
Copy link
Author

mzlock commented Jun 14, 2016

img_0056

From my iPad third gen Model FC705LL/A

I'll check for console errors

@mzlock
Copy link
Author

mzlock commented Jun 14, 2016

Nope, no errors logged for http://threejs.org/examples/#webgl_lights_pointlights2

screen shot 2016-06-14 at 3 34 53 pm

@mrdoob
Copy link
Owner

mrdoob commented Jun 14, 2016

/ping @grorg

@mrdoob
Copy link
Owner

mrdoob commented Jun 14, 2016

@bhouston sounds like MeshStandardMaterial doesn't work on some iPads. You won't happen to have one around?

@mzlock
Copy link
Author

mzlock commented Jun 14, 2016

I'm using Phongs in my scene where things aren't rendering without an Ambient light. I'm assuming that the example and my code are related, but they may not be. I am adding my geometry to the scene right after adding lights (or possibly concurrently, because JavaScript).

loader.load('../assets/static/three/object.json', function(geometry) {
  var material = new THREE.MeshPhongMaterial({
     map: 'texture.jpg',
     bumpMap: 'texture-bump.jpg',
     bumpScale: 0.1,
     shininess: 100,
     specularMap: 'texture-specular.jpg'
  })
  var obj = new THREE.Mesh(geometry, material)
  obj.scale.set(2, 2, 2)
  obj.position.set(0, 10, 0)
  scene.add(obj)
}

@mrdoob
Copy link
Owner

mrdoob commented Jun 14, 2016

Lets focus on webgl_lights_pointlights2 😁

@bhouston
Copy link
Contributor

I have an iPad Air 2 and it works with threejs.org/examples/#webgl_lights_pointlights2 unfortunately:

img_0019

@mrdoob mrdoob changed the title iOS Safari - Nothing Visible in Scene iPad 3/4 - Nothing Visible in Scene Jun 15, 2016
@javiermorawski
Copy link

I noticed the same problem on iPod 5. I... know it's an older device.
Using threejs v79.
example lights / pointlights2 doesn't work for me either. It looks like mzlock's screen.
I tried getting rid of a few lights, and it seemed to make a difference.

On the same device, I also noticed that textured phong materials didn't seem to work with point lights. The mesh would only render if it didn't have a texture, or if directional lights were used instead.

@javanli
Copy link

javanli commented Nov 2, 2016

set material.side= THREE.DoubleSide , it will work well.

  • iphone 5c
  • ios 8.3
  • ME679CH/A

iphone 5c meet the same problem.
It seems that iphone 5 also have the problem.
And if set side: THREE.DoubleSide, it will work well. But FPS become too low.

example webgl_lights_pointlights2:
bad

set doubleSide:

var groundMaterial = new THREE.MeshPhongMaterial( { color: 0xffffff, map: texture,side:THREE.DoubleSide } );
var objectMaterial = new THREE.MeshStandardMaterial( { color: 0xffffff, roughness: 0.5, metalness: 1.0,side:THREE.DoubleSide } );

or

material.defines['DOUBLE_SIDED']=true;

it will work well:
well

Hope this can be useful.

@EerikKivistik
Copy link

If anyone else happens on this issue, here's what worked for me:
I added a hemisphere light in addition to pointlights and the textures started rendering.
The devices I tested were iPhone 5s and iPad 2.

@mrdoob
Copy link
Owner

mrdoob commented Sep 8, 2017

@mzlock is this still an issue?

@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 7, 2018

Closing. We can reopen if the mentioned rendering problems still occur with latest iOS.

@Mugen87 Mugen87 closed this as completed Feb 7, 2018
@EerikKivistik
Copy link

I don't think it occurs on latest iOS versions, but people supporting legacy versions can use the workaround I described above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants