Skip to content

Conversation

tomlee-dev
Copy link
Contributor

@tomlee-dev tomlee-dev commented Aug 21, 2025

Description

for supporting i3dm rendering.

note that this change is a proof of concept i3dm instanced rendering in Unity.

for texture and lighting and animation? need to work for it. (I've not finished. I don't have time line for it)

Issue number or link

#416

Author checklist

  • I have submitted a Contributor License Agreement (only needed once).
  • I have done a full self-review of my code.
    -[ ] I have updated CHANGES.md with a short summary of my change (for user-facing changes).
    - [ ] I have added or updated unit tests to ensure consistent code coverage as necessary.
    - [ ] I have updated the documentation as necessary.

Testing plan

check these url with Cesium3DTileset component.

https://sandcastle.cesium.com/SampleData/Cesium3DTiles/Instanced/InstancedWithBatchTable/tileset.json
https://sandcastle.cesium.com/SampleData/Cesium3DTiles/Instanced/InstancedOrientation/tileset.json
https://raw.githubusercontent.com/CesiumGS/cesium/refs/heads/main/Specs/Data/Cesium3DTiles/Instanced/InstancedTextured/tileset.json
https://raw.githubusercontent.com/CesiumGS/3d-tiles-samples/refs/heads/main/1.0/TilesetWithTreeBillboards/tileset.json

lat: 40.04253068
lon: -75.61209424
height: 10.0096
image

…ted data

note that this change is a proof of concept i3dm instanced rendering in
Unity
@tomlee-dev tomlee-dev changed the title for creating unity mesh and instanced rendering from i3dm gltf conver… for supporting i3dm Aug 21, 2025
@tomlee-dev
Copy link
Contributor Author

tomlee-dev commented Sep 5, 2025

I found that there is issue of processing material in UnityPrepareRendererResources.cpp

I added fallback logic to the baseColorTexture processing of gltf 1.0 extension KHR_techniques_webgl

I tested with this tileset.
https://raw.githubusercontent.com/CesiumGS/3d-tiles-samples/refs/heads/main/1.0/TilesetWithTreeBillboards/tileset.json

see the commit
bb86eac

@Patrick-van-Halm-360Fabriek

Hi @tomlee-dev, do you have an indication when this could be implemented into the main branch. Our company would benefit from this implementation a lot.

@TomLeeLive
Copy link
Contributor

TomLeeLive commented Sep 8, 2025

@Patrick-van-Halm-360Fabriek I don't know. I am just a contributor :)
If you need this in hurry, then just check out this remote branch and merge with your local repository and build it :)

see
https://github.com/CesiumGS/cesium-unity/blob/main/Documentation~/developer-setup.md#packaging-cesium-for-unity

@Patrick-van-Halm-360Fabriek

I've found this implementation to be very laggy when loading a tileset containing lightposts for instance, is there a way to optimize it? My whole Unity Editor just starts to freeze...

@TomLeeLive
Copy link
Contributor

@Patrick-van-Halm-360Fabriek could you give me the tile url ?

@Patrick-van-Halm-360Fabriek

@TomLeeLive
Copy link
Contributor

@Patrick-van-Halm-360Fabriek I will check it tomorrow!

@Patrick-van-Halm-360Fabriek

@Patrick-van-Halm-360Fabriek I will check it tomorrow!

Thanks in advance :)

@Patrick-van-Halm-360Fabriek

We also found that this tileset doesn't seem to load:
https://www.3drotterdam.nl/datasource-data/00a7099b-8670-4173-8ac6-d16cd6ab0ffe/tileset.json

@TomLeeLive
Copy link
Contributor

We also found that this tileset doesn't seem to load: https://www.3drotterdam.nl/datasource-data/00a7099b-8670-4173-8ac6-d16cd6ab0ffe/tileset.json

this tileset is cmpt. I know that cmpt can embed i3dm tile. so I tried to implement some code for supporting it, but It is difficult than just showing i3dm tile. It takes time to me. and I also don't have clear time line for this too. maybe yours developer can working on this. remember that I am just a contributer not a paid freelancer :)

@TomLeeLive
Copy link
Contributor

@Patrick-van-Halm-360Fabriek
Here's what I found:
current implementation code is each cmpt contains I3dmInstanceRenderer component.
Purpose of the component is calling the DrawMeshInstanced method and containing mesh data for that cmpt.
The problem is that each cmpt calls its own mesh and DrawMeshInstanced method.
It seems that the cmpt's parent object should contain the shared mesh data for instancing, and only call DrawMeshInstanced once in Update method in I3dmInstanceRenderer component of cmpt's parent object. this will be better implementation.

The current fix idea is as above, but I'm currently busy and can't work on it right away. It will take some time.

Thank you for reporting this :)

@TomLeeLive
Copy link
Contributor

TomLeeLive commented Oct 2, 2025

@Patrick-van-Halm-360Fabriek I've just uploaded commit for cmpt, embedded i3dm. 31d1a81
but still need to improve this PR. I mean applying the idea I mentioned before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants