-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Color the faces directly #20
Comments
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! If I'm correct, this will create a 2D image with a color palette based on the face ids. |
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! |
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?
The text was updated successfully, but these errors were encountered: