i’m searching for a way to color the faces of a mesh with different colors. i know it sounds simple and i’ve tried to get it done, but shader and me aren’t the best friends yet.
the most useful solution would be something like this:
i get a spread for every face of the mesh and could change the colors with a color-spread.
for this you need subsets in your mesh. each subset will be like a separate mesh an can get its own color. there was a script somewhere for 3ds max or so, to do this, but i cant find the link right now…
i’m using the grid-node to generate my mesh, no external x-file. is there a way to get a subset out of it directly in vvvv?
otherwise, i have to generate a mesh in 3ds max with the help of the script. but then, the face-count is limited to the one, i’ve built in max and i couldn’t change it at runtime…
sorry, i’ve rembered it wrong. i’m not using a grid. i build my own mesh with the mesh- and vertexbuffer-nodes. Am i right, that the coloring should be the job of the shader? best would be a shader with spreadable color-input…
@joreg: that’s probably awesome; can you explain the benefit? one mesh with multiple subsets instead of multiple meshes sounds like added convenience for vertexshader athletics… right?
@clay: you could color your vertices one by one using the Diffuse Color pin on the VertexBuffer (EX9.Geometry Join) , then use the DrawFixed effect (which respects those colors). to really separate the colors (to avoid funky gradients in shading modes other than flat) you’d have to make sure that the faces aren’t sharing vertices (e.g. give each triangle its own set), though.
@diki: my patch is quite stupid as an example for that new feature as it isn’t really making use of the spreaded grid. all grid-subsets have the same resolution (the result looks exactly the same without spreding the grid). but note that they could have different resolutions. that wasn’t possible before beta21.