You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example: Consider a BoxGeometry with 6 groups and a material array with 6 materials, one material for each group and one group for each face of the BoxGeometry
When we pass a "material array" to the "Mesh" function, it leads to the following bugs:
The first material of the material array is applied to the entire Mesh, basically ignoring the rest of the material array
The colors of other Meshes gets affected ( if we have a mesh in scene using material array )
Both these bugs may or may not appear at the same time.
These bugs appear even if we construct proper "groups" for the geometry and if we setScene() after creating the Mesh:
When we clear the groups and then construct our owngroups
We just update the material index of the groups
Note: The Mesh looks perfectly fine and utilizes the material array properly, resulting in faces using all materials from material array, when I don't use pathtracing or When samples count is 0
Note: If I were to create a cube with 6 different materials in blender, export as GLB and import in three.js. Then start Pathtracing, it works perfectly.
EDIT: Looks like, blender exports a cube as planes. Could it be the case that three-gpu-pathtracer doesn't work with geometry groups and material arrays?
Expected behavior
When we use Material Array and proper groups for geometry, instead of leading to the bugs described above. The pathtracing render should display
A scene where each face of the box geometry has a material assigned from the material array according to the groups, and not just the first material from the material array
It shouldn't affect other meshes present in the scene
Screenshots and Repro Model
In the code below, refer to the following functions: setup(), setupDummyMesh(), setupPathTracer()
PratikHadawale-tech
changed the title
Materials are rendered wrong when using Material Array
Materials are rendered wrong when using Material Array ( Link to CodeSandBox included )
Oct 23, 2024
PratikHadawale-tech
changed the title
Materials are rendered wrong when using Material Array ( Link to CodeSandBox included )
Materials are rendered wrong when using Material Array
Oct 23, 2024
Describe the bug
Link to CodeSandBox is included later in here
For example: Consider a BoxGeometry with 6 groups and a material array with 6 materials, one material for each group and one group for each face of the BoxGeometry
When we pass a "material array" to the "Mesh" function, it leads to the following bugs:
Both these bugs may or may not appear at the same time.
These bugs appear even if we construct proper "groups" for the geometry and if we setScene() after creating the Mesh:
Note: The Mesh looks perfectly fine and utilizes the material array properly, resulting in faces using all materials from material array, when I don't use pathtracing or When samples count is 0
Note: If I were to create a cube with 6 different materials in blender, export as GLB and import in three.js. Then start Pathtracing, it works perfectly.
EDIT: Looks like, blender exports a cube as planes. Could it be the case that three-gpu-pathtracer doesn't work with geometry groups and material arrays?
Expected behavior
When we use Material Array and proper groups for geometry, instead of leading to the bugs described above. The pathtracing render should display
Screenshots and Repro Model
In the code below, refer to the following functions: setup(), setupDummyMesh(), setupPathTracer()
CodeSandBox Link: https://codesandbox.io/p/sandbox/kz7x95
When samples are 0:
When samples become more than 0:
Platform:
The text was updated successfully, but these errors were encountered: