How to render UV on a canvas?

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

Thanks for the answer!

Not exactly. I need to draw UV on canvas. Ideally, separate UV islands filled with some color

1 Like

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 :thinking:

You used very tricky approach by the way) :metal:

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?

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

Yes, I think I’ll go this way, thank you! :slightly_smiling_face:

1 Like