simon
December 27, 2024, 1:24pm
1
Hello!
Just want to ask what approach to use to render UV at canvas. I tried straight way (just got all the triangles from UV Vertex Data and render them on a canvas) but I got a performance bottleneck in case of complex meshes. Maybe somebody knows more civilized approaches or maybe Babylon have such a feature. I found MeshUVSpaceRenderer but I dont clearly understand if it can helps me
1 Like
are you looking for smth like this?
1 Like
simon
December 27, 2024, 2:17pm
3
Thanks for the answer!
Not exactly. I need to draw UV on canvas. Ideally, separate UV islands filled with some color
1 Like
simon
December 27, 2024, 2:24pm
4
I think what I can do is do the same with like a “hidden” rendering of such a mesh to a texture and than put this data on a canvas
You used very tricky approach by the way)
1 Like
I still don’t get it lol, this is UV unwrapping drawn on a canvas,
do you want it on a non babylonjs canvas?
do you want the vertices to be move-able so you can change the UVs like you do in blender?
or do you want to draw each island in isolation, separately?
simon
December 27, 2024, 2:33pm
6
No, I don’t need any manipulations with vertices. Just draw. And about canvas I meant HTMLCanvas)
1 Like
Oh okay, so I think you can do exactly as you said,
render it separately on an RTT ,
use the readPixels
method of the rtt to get the raw pixel data
and then put those pixels on the canvas
2 Likes
simon
December 27, 2024, 2:49pm
8
Yes, I think I’ll go this way, thank you!
1 Like