Jump to content

rendering not the same on pc and mobile


guzuomuse
 Share

Recommended Posts

can you repro on the PG? can you make sure that you have no network issue on mobile? (looks like the environment texture is not loaded)

Link to comment
Share on other sites

oh sorry @aWeirdo @Deltakosh,i'm back....

I only test on my mobile(jailed,you know :P )

mobile: Iphone5s version 9.33

pc browses: any "morden" brower .chrome opera firefox.etc.

all browser look like act right.but the mobile is going wrong. they have different rendering results.

@Deltakosh,

i 'm sure there is no network issue, because i test on my local server.

i want to create a PG.but i Don't know how to upload the ".babylon" file assets.so i put the code here;actually, the code is very simple:

 

  test_pbr() {
    BABYLON.SceneLoader.Load('/assets/', 'test_2.babylon', this._engine, (newScene) => {
      this._scene = newScene;
      this._scene.clearColor = new BABYLON.Color4(1, 1, 1, 0);
      const materials = newScene.materials;
      const meshes = newScene.meshes;
      const test_pbr_m = new BABYLON.PBRMaterial(materials[0].name, newScene);
      const material_0 = materials[0], material_1 = materials[1];
      material_0.dispose();
      const mesh_0 = meshes[0];
      //// camera setting-start///
      const camera = newScene.activeCamera as BABYLON.ArcRotateCamera;
      const test_ratio = this._engine.getAspectRatio(camera);
      if (test_ratio >= 1) {
        // this._engine.resize();
      } else {
        camera.radius = camera.radius / test_ratio;
        camera.maxZ = camera.maxZ / test_ratio;
      }
      camera.lowerRadiusLimit = camera.upperRadiusLimit = camera.radius;
      camera.allowUpsideDown = false;
      newScene.activeCamera.attachControl(this._canvas);
      //// camera setting-end///
      test_pbr_m.albedoColor = new BABYLON.Color3(1.000, 0.766, 0.336);
      test_pbr_m.metallic = 0;
      test_pbr_m.roughness = 1;
      test_pbr_m.reflectionTexture = BABYLON.CubeTexture.CreateFromPrefilteredData('/assets/environment.dds', newScene);
      test_pbr_m.albedoTexture = new BABYLON.Texture('/assets/touming_1.png', newScene);
      const multimat = new BABYLON.MultiMaterial('multi', newScene);
      multimat.subMaterials.push(test_pbr_m);
      multimat.subMaterials.push(material_1);
      mesh_0.material = multimat;
      // newScene.lightsEnabled = false;
      mesh_0.material = test_pbr_m;
      this.doRender();
    });
  }

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...