fury-gl / fury

FURY - Free Unified Rendering in pYthon.
https://fury.gl
Other
246 stars 182 forks source link

GLTF model to check after PBR + animation integration #628

Open skoudoro opened 2 years ago

skoudoro commented 2 years ago

Hello @xtanion , While importing various models I was facing the below issues

  1. After importing the models they aren't clearly visible as you can see below (I don't know whether it is related to importing or light or something else)

    1. BoomBox: BoomBox

    2. BarramundiFish: BarramundiFish

  2. Unicode❤♻Test: It seems pygltflib is unable to decode the Unicode characters

    Traceback (most recent call last):
    File "d:\FuryWorkspace\fury\docs\tutorials\01_introductory\viz_gltf.py", line 28, in <module>
    gltf_obj = glTF(filename, apply_normals=True)
    self.gltf = GLTF2().load(filename)
    File "D:\FuryWorkspace\fury-env\lib\site-packages\pygltflib\__init__.py", line 1102, in load
    obj = cls.load_json(fname)
    File "D:\FuryWorkspace\fury-env\lib\site-packages\pygltflib\__init__.py", line 1050, in load_json
    obj = cls.gltf_from_json(f.read())
    File "C:\Users\ganim\AppData\Local\Programs\Python\Python39\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
    UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 285: character maps to <undefined>
  3. Fox: glTF type doesn't display any model image Do we support the .glb file?? Because when I try to import Fox in glTF-Binary tmode it throws the below error

    Traceback (most recent call last):
    File "d:\FuryWorkspace\fury\docs\tutorials\01_introductory\viz_gltf.py", line 28, in <module>
    gltf_obj = glTF(filename, apply_normals=True)
    File "gltf.py", line 49, in __init__
    self.inspect_scene(0)
    File "gltf.py", line 82, in inspect_scene
    self.transverse_node(node_id, self.init_transform)
    File "gltf.py", line 120, in transverse_node
    self.load_mesh(mesh_id, next_matrix)
    File "gltf.py", line 146, in load_mesh
    vertices = self.get_acc_data(attributes.POSITION)
    File "gltf.py", line 209, in get_acc_data
    return self.get_buff_array(buff_id, d_type['dtype'], byte_length,
    File "gltf.py", line 247, in get_buff_array
    if uri.startswith('data:application/octet-stream;base64') or \
    AttributeError: 'NoneType' object has no attribute 'startswith'

    the uri is None. Yes, It is correct because the .glb file doesn't have any separate bin files for the buffer.

Also if we don't provide any mode to read_viz_gltf, the glTF mode isn't selected as the default. This is because of this line in fetcher.py where you are choosing the last type, so considering file order glTF will always be at the top (in windows as per I know) than the other glTF-* type files.

I will continue to import another type of models too and let you know if I found something.

Originally posted by @ganimtron-10 in https://github.com/fury-gl/fury/issues/600#issuecomment-1177331239

chisarie commented 1 year ago

Hello! It seems that this issue is caused by missing lights. Is there any plans to add lighting to the current Fury API? One could take inspiration from the API structure of the pyrender project: https://pyrender.readthedocs.io/en/latest/api/index.html#lighting

skoudoro commented 1 year ago

Hi @chisarie,

Yes, we plan to add different lighting but by default, there is a light so that why the result is strange.