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
Copy file name to clipboardExpand all lines: src/framework/components/gsplat/component.js
+16-3Lines changed: 16 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -221,12 +221,17 @@ class GSplatComponent extends Component {
221
221
/**
222
222
* Sets the material used to render the gsplat.
223
223
*
224
+
* **Note:** This setter is only supported when {@link unified} is `false`. When it's true, multiple
225
+
* gsplat components share a single material per camera/layer combination. To access materials in
226
+
* unified mode, use {@link GsplatComponentSystem#getGSplatMaterial}.
227
+
*
224
228
* @param {ShaderMaterial} value - The material instance.
225
229
*/
226
230
setmaterial(value){
227
-
228
-
Debug.assert(!this.unified);
229
-
231
+
if(this.unified){
232
+
Debug.warn('GSplatComponent#material setter is not supported when unified true. Use app.systems.gsplat.getGSplatMaterial(camera, layer) to access materials.');
233
+
return;
234
+
}
230
235
if(this._instance){
231
236
this._instance.material=value;
232
237
}else{
@@ -237,9 +242,17 @@ class GSplatComponent extends Component {
237
242
/**
238
243
* Gets the material used to render the gsplat.
239
244
*
245
+
* **Note:** This getter returns `null` when {@link unified} is `true`. In unified mode, materials are
246
+
* organized per camera/layer combination rather than per component. To access materials in
247
+
* unified mode, use {@link GsplatComponentSystem#getGSplatMaterial}.
248
+
*
240
249
* @type {ShaderMaterial|null}
241
250
*/
242
251
getmaterial(){
252
+
if(this.unified){
253
+
Debug.warnOnce('GSplatComponent#material getter returns null when unified=true. Use app.systems.gsplat.getGSplatMaterial(camera, layer) instead.');
0 commit comments