Iskander Posted March 27, 2016 Share Posted March 27, 2016 (edited) Hi guys! I want to make 'lowpoly stilyzed' image. I know it is easy to make that by vex expression(for example),but i don't know vex syntax right now-just starting to learn it. Please help me on my Houdini way. Left what i have,right what i need. Example in random colors,but i am reading colors from image,don't be afraid. All i want is to sum up 3 values of 3 vertex colors to 1 primitive color,and then i'll have 3 same vertex colors in primitive.By this way: Pr[*].Cd = (Pr[*].Vtx[x].Cd+Pr[*].Vtx[y].Cd+Pr[*].Vtx[z].Cd)/3 Edited March 27, 2016 by umpaumpa Quote Link to comment Share on other sites More sharing options...
Skybar Posted March 27, 2016 Share Posted March 27, 2016 Not vex, but you could try the Attribute Promote SOP. It has a few different operations including sum. Quote Link to comment Share on other sites More sharing options...
f1480187 Posted March 27, 2016 Share Posted March 27, 2016 (edited) For vertex color: // Primitive Wrangle. @Cd = 0; int vtxs[] = primvertices(0, @primnum); foreach (int vtx; vtxs) @Cd += vector(vertex(0, "Cd", vtx)) / len(vtxs); For point color: // Primitive Wrangle. @Cd = 0; int pts[] = primpoints(0, @primnum); foreach (int pt; pts) @Cd += vector(point(0, "Cd", pt)) / len(pts); Then delete point or vertex color with Attribute Delete node, since primitive color has low priority. Use Attribute Promote node. It has different methods, not only averaging. primitive_color.hipnc Edited March 27, 2016 by f1480187 2 Quote Link to comment Share on other sites More sharing options...
Iskander Posted March 28, 2016 Author Share Posted March 28, 2016 (edited) Thank you guys.Perfect!Promote node is amazing node. Edited March 28, 2016 by umpaumpa Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.