decentraland / decentraland/sdk

[BUG] Re-setting UVs to the same object fails to load the texture when changed with setPbrMaterial

Open
#1,029 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
4
Forks
5
PR merge metrics
No merged PRs in 30d

Description

### **Issue Description:**

### **SDK:**

- [ ] SDK6
- [x] SDK7

### **Tool:**

### **Steps to reproduce:**

1. Create a plane shape
2. Give it a pbr material with a texture
3. Observe it being completely fine, displaying the texture
4. Change prbmaterial (either via mutable object, or completely destroying and re-creating the component)
5. Observe it turning gray
6. Switch back to old pbr material (even by recreating)
7. Observe it being completely fine

### **Expected behaviour:**

For the material to change to desired texture

### **Current behaviour:**

Material does not render the texture

### **Reproduction rate:**

100%

### **Code Snippets:**
```
Material.setPbrMaterial(this.wallDecor[this.currentSpaceWallDecor[i].room][this.currentSpaceWallDecor[i].wall],{texture: Material.Texture.Common({src:globalWallTextures[itemId],
wrapMode: TextureWrapMode.TWM_REPEAT})})
```
### **Platforms:**

- [ ] Windows
- [ ] Mac
- [x] Not platform specific

### **Browser:**

- [ ] Google Chrome
- [ ] Microsoft Edge
- [ ] Firefox
- [ ] Desktop
- [ ] Brave
- [ ] Safari
- [x] Not Browser Specific

### **Environment:**

- [x] production - web client
- [x] production - desktop client
- [x] local preview
- [ ] web editor
- [ ] desktop editor

### **Evidence:**

![image](https://github.com/decentraland/sdk/assets/19371983/df4651b4-65eb-477b-9ce4-40833cb1704c)

![image](https://github.com/decentraland/sdk/assets/19371983/f1fb9083-f71e-4dc2-9edf-0c00d09bc379)

### **Additional Notes:**

When loaded at scene creation/set as the first PBR material for the plane, the material renders fine.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.