How do I edit the draco compressed glb in the editor?

How to change materials of heart at runtime?


With the model loaded by this script, I can get the material using the following method, but I can’t change it at present
image
Is there any good method or case for reference?

What you have done is correct, you will just need to change the material on the meshInstance via https://developer.playcanvas.com/api/pc.MeshInstance.html#material


Is my writing wrong? I get the color of the material but can’t change it

Can you possible a project that shows the issue please?

https://playcanvas.com/project/1021630/overview/loading-draco-compressed-glbs

The issue is that you didn’t parse the loadGlb script for the new color attribute so this.color is null

After parsing, it works as expected

okay,I know what the problem is. thx :slight_smile:

Can the entities added in the script have custom names(entity name)?

You can rename any Entity via https://developer.playcanvas.com/api/pc.Entity.html#name

Does the loaded glb have a callback?I want to use ‘ready’ during initialization, but it doesn’t seem to work
image
I want to konw when this glb loaded

That commented code should work. Can you please post a new project with the issue?

A post was merged into an existing topic: Is there any way to get the callback loaded from a glb?

We made two glb files, the “test1.glb” is the original without compress, and “test1-basis.glb” was compressed basis. Used “https://gltf-transform.donmccurdy.com/” this command line tool.
Pic1, is the test1.glb, the original quality.

Pic2, is the “test1-basis.glb”, the quality is pretty low(I have imported the basis lib):

I know the basis compress will reduce the quality, but we have no more choice by the command line tool, it doesn’t have more option choice.

But it’s very stranges, When I use the playcanvas modelviewer to open the test1-basis.glb, the materials are better(When stop rotating the model), looks like the modelviewer can optimize the basis compressed texture quality.

@yaustar I have added you as a team member to edit the following project, Please check it, thanks
https://playcanvas.com/project/1020626/overview/loading-draco-compressed-glbs1

The model viewer has a multi sampler rendering shader that smooths out jagged rendering lines/edges as you can see in your preview.

The Model Viewer is open source: GitHub - playcanvas/model-viewer: glTF 2.0 model viewer and you can read more about the recent release here: glTF Viewer Arrives on Mobile with AR Support | PlayCanvas

I made an Editor version here (might be slightly outdated now): https://playcanvas.com/project/910157/overview/multiframe-model-viewer

And I’ve quickly added it to a fork or your project here: <
https://playcanvas.com/project/1023639/overview/f-loading-draco-compressed-glbs

However, I would recommend compressing the textures using UASTC compression with Basis instead as that gives a higher quality texture.

2 Likes

Thanks,it works. :smiling_face_with_three_hearts: