GLSL Duplicates trouble

Hello everyone, I encountered the problem of duplicates when working with a hex grid. Duplicates appear after adding with “P”, this is noticeable when I continue to use the rotation matrix. I use the buffer texture with which I carry out all the operations on the grid. As I understand it, the problem is that I superimpose one array on another using the addition operation with “P”. How do I get rid of duplicates? Below I attach the file. Thank you, I hope for help in solving this problem!

Patterns_trouble.toe (7.9 KB)

hm took a quick look at your toe, you’ll need to do one of two things I think:

A) (harder) in the vertex shader, or passed into the vertex shader, you need a mask, that can identify if a geometry is a duplicate or not. use that mask to scale the size to 0, or move it off screen, etc.

B) (somewhat easier) I see that you are passing in a grid of instance coords, and in the vert shader moving them into a hexagon friendly pattern? You might look at moving those points around in chop space, and getting the initial static positions that way (keep rotation in the gpu for speed ). Once you have this setup, you could use a delete CHOP to delete similar samples relatively easily I think!

Thanks for the help and the idea with the masks. The first option turned out to be more effective for me. The way it is associated with the code. The second option can also be tried to be implemented, but in this task it was important for me to build everything on shaders. Thanks again for the help.Patterns_trouble_resolved.toe (8.2 KB)

1 Like