Geometry turns black, when scene.updateMatrixWorld() applied

I am not sure if it connected with Path rendering engine or with three.js. So…

Matrix transformation applied on a scene (or any of its group) does not show any effect. However, when method updateMatrixWorld is applied on a scene, the color and textures disappears but the transformation finally happens.

step 1

Apply matrix transformation

  group.applyMatrix4(new THREE.Matrix4().set(
    1, 0, 0, 0,
    0, 0, 1, 0,
    0, 1, 0, 0,
    0, 0, 0, 1));

  scene.add(group);
  
  //initialization of a render
  const generator = new RTX.DynamicPathTracingSceneGenerator( scene );
  const sceneInfo = generator.generate( scene );
  const { bvh, textures, materials } = sceneInfo;

  const geometry = bvh.geometry;
  const material = ptRenderer.material;

  material.bvh.updateFrom( bvh );
  material.attributesArray.updateFrom(
    geometry.attributes.normal,
    geometry.attributes.tangent,
    geometry.attributes.uv,
    geometry.attributes.color,
  );

  material.materialIndexAttribute.updateFrom( geometry.attributes.materialIndex );
  material.textures.setTextures( renderer, 2048, 2048, textures );
  material.materials.updateFrom( materials, textures );
...

Result geometrically is wrong. Applied matrix has no effect

image

step 2

adding update method

  group.applyMatrix4(new THREE.Matrix4().set(
    1, 0, 0, 0,
    0, 0, 1, 0,
    0, 1, 0, 0,
    0, 0, 0, 1));

  scene.add(group);

  //added here!
  scene.updateMatrixWorld();
  
  //initialization of a render

Result geometrically is correct, but has no textures or colors

image

Platform:

  • Device: [Desktop]
  • OS: [Linux]
  • GPU: [NVidia 1660]
  • Browser: [Firefox]
  • Three.js version: [r143]

Did you try rendering the scene with just the default WebGLRenderer? DynamicPathTracingSceneGenerator is not part of three.js - it’s custom renderer created for three-gpu-pathtracer.