Any help getting RENDERSTYLE_POINTS working?

I’d love to be able to render a mesh using just the verts and it looks as though this is possible by setting a mesh instance renderStyle to pc.RENDERSTYLE_POINTS. But it either doesn’t seem to be working or I’m missing a step…?

self.entity.model.model.meshInstances[0].renderStyle = pc.RENDERSTYLE_POINTS;    

generateWireframe() works great for the same meshInstance, so I know that part is working. I’ve tried using generateWireframe before the above line as well… any help?

Hi @Lucass and welcome,

I think you need to call the following method instead of setting the renderStyle directly:

self.entity.model.model.prepareRenderState(pc.RENDERSTYLE_POINTS);

Also, check the following example it utilizes the upcoming render component:

https://playcanvas.github.io/#graphics/point-cloud.html

1 Like

Thanks for the quick response!

I just tried out prepareRenderState, no deal :frowning: these upcoming examples look great though. I’ll keep trying things out, thanks again.

1 Like

Side note: The render component is accessible now so you can use this effect now: https://playcanvas.github.io/#graphics/point-cloud.html

2 Likes

Beautiful! That’ll be perfect then, I’ll start there :slight_smile:

1 Like