Custom Mesh Rendering under UI Canvas

Does this mean that I cannot update the mesh of CanvasRenderer natively i.e. by getting a native buffer pointer of mesh using mesh.GetNativeVertexBufferPtr(0) and updating vbo data using OpenGL?

Because I am trying to update CanvasRenderer’s mesh natively from my plugin, and it doesn’t seem to work. But when I try the same thing with MeshRenderer it works.

I am following approach suggested by Unity to update mesh from native code-
https://docs.unity3d.com/Manual/NativePluginInterface.html
https://bitbucket.org/Unity-Technologies/graphicsdemos/src/43011994ae74/NativeRenderingPlugin/?at=default

Hi there,

I’m fighting a bit trying to come up with a proper way to create a hexagon-shaped graph that would show the player skills/attributes and be modified depending on their value. Let me show you a quick mockup of what I’m seeking:

(Just made up those stats, but you get what I mean) Now, how could I achieve something like that? The way this works is simple, if the player tweaks a given skill, its ‘vertex’ of the green ‘star’ goes higher or lower depending on the skill’s value.

Initially, I tried to create something like this in the form of some sort of ProgressBar, but to no avail. Is there a way to set up that kind of menu using Unity’s UI tools with some of the approaches discussed in this thread? Would manually creating a mesh by code work here?

Thanks in advance.

You can achieve this with the UIPolygon control in the Unity UI Extensions project.
3131031--237195--upload_2017-7-3_13-4-16.png
Doesn’t have the inside lines, but you could add those with the UI Line Renderer in the project, or enhance the control.
(Link in sig)

Hope this helps.

1 Like

Thanks a lot Simon! I’m sure it’ll help, as soon as I have some time to work on this I’ll keep you posted.

1 Like

Is there any way to get meshes created with CanvasRenderer to have decent edges? It actually looks very nice in the editor screen, but the play window and (worse) the actual build looks ugly and jagged around the edges (example):
3364324--263613--upload_2018-1-23_9-14-5.png

This is using Unity 5.6.3f1, and the build is run with “fantastic” quality. Since it looks fairly decent in the editor, one should think it’s got to be possible?

I tried the UILineRenderer from the UIExtensions, but it has the same issue.

Camera settings, in case they are the problem:

3 Likes

Hi,
I have a mesh in meshfilter and I want to convert it to UI component (like Image component). I tried above methods it works but eventsystem’s (pointer click etc is not working) raycast is not working. can anyone point me in the right direction.

You’d probably have better luck posting a new thread. Especially considering how old this one is. But off the top of my head, everything you need to know about dispatching and responding to UI events is pretty well documented here: https://docs.unity3d.com/Manual/UIE-Events.html