Hi
Is there anyway to select the faces using the texture color value applied to it .
Example: A mesh having red color (in the texture… not vertex color)should be selected, where the mesh is properly tessellated.
The idea is to apply the basic texture with multiple color on the mesh. Then the mesh is selected using the color for changing the material property or the extracting the mesh … so on and on …
I was trying to modify the Displacement shader, which tessellates the mesh with the color value… but have no idea to continue for selecting using color value
Please help
Reply from
dbsmith
undefined
Name: Damon Smith
Company: Sidhe Interactive
Join Date: Aug 2009
Location: Wellington, New Zealand
Posts: 13
Are you using maya?
If so, you could do something like this:
Iterate over your faces, get the vertices of that face.
Get the UVs of those vertices and average them (if your faces are triangulated, should get an accurate UV position).
Use maya’s colorAtPoint command to get the color of that UV position.
colorAtPoint takes a fileNode (eg a texture) and a UV coord, returning that color.
Then, based on your result, you can process your faces as you like.