adizanni / floor3d-card

Your Home Digital Twin: aka floor3d-card. Visualize Home Assistant state and perform actions using objects in a 3D home model based on Three.js.
https://github.com/adizanni/floor3d-card
MIT License
450 stars 65 forks source link

Black/grey color but no model shown #92

Closed KrX3D closed 2 years ago

KrX3D commented 2 years ago

Hello,

i installed the card via hacs.

i did everything like you showed on youtube but for me the card only shows a grey color sometimes black. ress laod empty

i made the model in sweet home 3d and exported it with the plugin.

image

i tred it on several browsers and the mobile app

i reduced the yaml code to this but still the same:


type: custom:floor3d-card
path: /local/floorplan/
objfile: home.obj
mtlfile: home.mtl`
adizanni commented 2 years ago

Hello based on the info you provided, the thing that worries me most is the size of the model. I've seen up to 200 Mb but I'm scared that 500 Mb is too hard to handle for the WebGL library behind the card. If you do not mind to send me your sh3d model file I will try to see if I stumble on the same issue

KrX3D commented 2 years ago

i did some test, i removed some things and my model went down to 204mb, but the card now stops at 97% and it than takes like 2 minutes than the model loads. also at 84mb it stops at 97%

so it seems really to be the size. is there a way to shrink objects (.obj, .3ds, .dae) down? since the model is already at more than 60mb with only some walls

EDIT: i just added a couple of furniture and it went up to more than 500mb, i downloaded the models from the internet

KrX3D commented 2 years ago

Hi, i found out how to shrink the downloaded obj files. With the tool Meshmixer -> select -> whole model and then hit EDIT -> Reduce.

first i selected "triangle budget" and Acceppt, than after that "percentage"

my obj file (a lamp) went down from 79mb to under 6mb.

my exported floor plan from ~579mb to 482mb. i will do that with most of my objects that are large. will report again how it went

adizanni commented 2 years ago

The size of the model can be compressed using the glb format (it requires some tweaking, I will do a tutorial about that) on the other hand the glb will make the card faster to load but if it is too heavy, the card will be hard to render and animate. Some furniture are so detailed that have thousands of vertices; these objects make the rendering very intense for cpu and gpu. You need to strike a balance between esthetic and performance. A model of 100mb can be handled reasonably well by average cpus, but if you have detailed furniture even a simple light (and the shadows) may require thousand of computations to be rendered.

KrX3D commented 2 years ago

ok i reduced the furniture models i downloaded, and now i got my model down to 105mb.

but the card still gets "stuck" on 96%, now even google chrom hangs and i need to click "wait" and after 2 minutes the model loads

EDIT: this also happens on the mobile app, it stops around 80% there and after ~ 2 mins it loads the model

adizanni commented 2 years ago

Please send a message to my mail, it is public and attach a link to a file drop with your model (sh3d), I've never heard about this behaviour. Also what is your Hardware both pc and mobile ?

KrX3D commented 2 years ago

Hi,

i have sent you an Mail. It seems i need to redo some furniture since they are exported or loaded in the card incorrectly (wrong color or even not all elements are loaded)

my hardware is:

adizanni commented 2 years ago

KrX, can you please state the status of this issue ?

KrX3D commented 2 years ago

ah hi sorry forgot about that.

like i said above it helped a lot reducing the furniture models down in size and after shrinking the floor model to below 100mb helped a lot, but it was still taking about 40-60 seconds to load.

with your help the model was converted to the glb format which now loads in 2-3 seconds on my notebook and maybe 8 seconds on my mobile phone.

so as you said via mail you will make a tutorial about how to convert the obj model to glb in the future, so im happy right now ;)

thanks again for all your help and this nice project