Jump to content
netherknight

changing color based on a map after a wiresim?

Recommended Posts

I've generated a bunch of wires which I then applied a wiresim to. Now after this I want to change the colors of the primitives through a texture map. I'd like to do this after the simulation so I can change the texture without having to run the simulation again. 

Usually when applying hair material to hair you can add a texture map to the root color. This will then allow you to color in the hair based on anything. This doesnt seem to work with my generated wires though. changing the root and tip color does result in a gradient over the strand like image 1. But applying a map projects the entire image per strand. 

image.thumb.png.c561c8b10ae21e2dc9004f9223c15a17.pngimage.thumb.png.8998bc927d2da08781fa52fa4aa58afb.png

Is there any way to adjust the colors to what I want? 

 

Edit for slightly more informaion:
image.thumb.png.e40b1e3b48552098c82aee01839c4692.png

So it would be nice to have the strands inherit the color of a texture somehow. 

Edited by netherknight

Share this post


Link to post
Share on other sites

Hi,

Instead of plugging a map into the root color (which then may used the uv created by the polywire sop - if any), maybe you should try to transfer Cd attribute from your grid (the one where you have plugged an attributefrommap sop) to the root point of your wires, and see if the hair shader can use the color point attribute as color (instead of the map) ?

Share this post


Link to post
Share on other sites

Yes this definitely works however I can only seem to do this during the creation of the wires. Sadly this means I need to stat the simulation over again because Houdini sees the change in color as a adjustment making the previous simulation moot. (Unless there's a way of avoiding that whilst maintaining the color change) 

This also wouldnt work with rendered out simulations ofcourse due to point color being part of the mesh. 

 

Share this post


Link to post
Share on other sites

if the topology of your wires doesn't change, use a copy of your "initial" wires - where you transfer the Cd attribute on the root - , and transfer attributes between your two set of wires (the one coming from simulation and the one where you have the root color transfered) using the topology : attributecopy SOP

http://www.sidefx.com/docs/houdini/nodes/sop/attribcopy.html

 

Share this post


Link to post
Share on other sites

just store 'uv' attribute from your geo on wires instead of color (you can rename it if you want to have another attrib called 'uv')

then you can bind this attrib directly in the shader and sample any texture to get your colors without resimming anything or any additional sop setups

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×