Open robinenrico opened 3 years ago
Hi,
If you need only a flat shading then you can use the face index buffer and display it with a color palette, like here.
If you need one of the shaded materials, then I would need to add shaders with a slightly modified logic, that takes color from the face index and applies it instead of interpolated colors from vertex indices.
Let me know what is your use case.
Thanks for your fast reply! I indeed looked into that particular example.
If I'm correct, this will create a 2D image with a color palette based on the face ids. However, I'm looking into coloring the mesh. This will make sure that the mesh is colored during the 3D rendering.
OK. I'll prepare the next release soon. Will try to include there also the modified shading of meshes. Stay tuned ;)
Thanks a lot Robert, that would really help! Without trying to rush you, do you have any idea on when you plan the next release?
1-2 weeks, I think. :)
I have to make a minor release tomorrow, but did not manage to include new shaders. Sorry for delay! I'll push updates for you in the next release, which should be again in 1~2 weeks.
Hi Rober, did you already find the time to look into the new shaders?
I was working on that code for a while - changes in the shaders and in the Python API are minimal, but... there is a problem in between. Color buffer size now follows the number of the geometry primitives. For meshes, wireframes and curves it is the number of vertices/nodes. A mesh with some fixed number of vertices can have any number of faces - this does not fit the design of the mesh geometry code. I don't think repeating the whole structure with only differently managed color buffer is the best option, so I still need to figure out how to implement this request.
Sorry, it is a bit more than I thought at the beginning!
Thanks again for this really fast ray tracing package.
I was wondering if there is a way to color the faces directly instead of coloring via the vertices. In other words, we can update the color of the mesh by running:
rt.update_mesh(c=np.array(n, 3)
)However, this requires an array of colors for the vertices, is there a similar approach where c is a color for each face id?