hjoykim / THREE

c# port of Three.js
MIT License
128 stars 24 forks source link

ThreeJS vs Three speed #47

Open merco opened 1 day ago

merco commented 1 day ago

Hi this is the same model loaded in ThreeJS (chrome)

https://github.com/user-attachments/assets/de81d590-3af3-4171-8d8b-ac6cc0024c0f

and this in windows forms opentk control

https://github.com/user-attachments/assets/e251c02c-9c7c-48ba-bf32-42348f03441f

rendering speed seems very different.

could something be optimized?

hjoykim commented 1 day ago

hello Please, could send your demo model file?

merco commented 1 day ago

@hjoykim here we are!

SourceAndModels.zip

you should be able to create a solution like this, and open a *.s3d file. It contains vertex and positions like the original threejs file.

immagine

I can't include Javascrit version because it'a a legacy format and you need SAPUI5 frameowork runtime installed to get a working viewer. Do you think this part is necessary too?

this is the render time: without any user interaction

immagine

merco commented 1 day ago

a little improvement can be here... I'm duplicating materials because I want a selection to have the right instance hilighted You can try using 2robi.S3D

immagine

https://github.com/user-attachments/assets/695dd263-0758-4980-aa56-83dc80445326

merco commented 1 day ago

I can try also with InstancedMesh and that seems good. But can I set InstancedMesh visbility, opacity and color each singolar "mesh at position" ? @hjoykim

But the problem now is that I have some mesh with more than one material... and in this case how can mange only 1 color?

S3DFile.zip

immagine

This overload... shows multiple colors (However, they appear dull and not very bright.: probably a mistake in light positioning?)

immagine

immagine

merco commented 1 day ago

https://medium.com/@pailhead011/instancing-with-three-js-part-2-3be34ae83c57

very interesting but too far from my skills