Jump to content

How could I extract shop's material color to obj level?


Recommended Posts

It's about not just only shaders, so I ask in general Houdini Question.

I was studying shaders.. like fractal (mandelbrot)

and

https://sdm.scad.edu/faculty/mkesson/vsfx319/wip/best_winter2011/ali_jafargholi/project_4.html

This is the references(maya works - end of the line final works)

 

I create a fractal vex code in shop level.

I want to use the material's color value. It is used as velocity of particles..

When I apply a material shader which I created to a grid, I don't know how to use color(Cf) values(->shader applies to my grid)

Is there any way to get Cf value on my grid?

Link to comment
Share on other sites

Probably a few ways.... You can use an "attribfrommap" SOP. This works on prims or points. Drop one down and connect it to your geometry, add the file you want to get info from in the Texture Map field. If the geometry had UV's this texture will lay in the same spot as your shader texture. After the attribfrommap SOP the color from the image is now on the geometry. You can use something like a point SOP to attach it to velocity. In a point SOP under the particle SOP "Add Velocity" then use something like @Cd.x @Cd.y @Cd.z to get the color on to the velocity.

This isn't going to impart a particular direction to anything, just vary the velocity.

velFromColor.hip

 

 

kf

Link to comment
Share on other sites

On 2016. 6. 11. at 2:44 AM, kungFu said:

Probably a few ways.... You can use an "attribfrommap" SOP. This works on prims or points. Drop one down and connect it to your geometry, add the file you want to get info from in the Texture Map field. If the geometry had UV's this texture will lay in the same spot as your shader texture. After the attribfrommap SOP the color from the image is now on the geometry. You can use something like a point SOP to attach it to velocity. In a point SOP under the particle SOP "Add Velocity" then use something like @Cd.x @Cd.y @Cd.z to get the color on to the velocity.

This isn't going to impart a particular direction to anything, just vary the velocity.

velFromColor.hip

 

 

kf

Thank you. But it's the using pre-maked map.pic.  I mean the object applied shop's shader(.vfl code) and extract the Color Value From that. 

Link to comment
Share on other sites

On 6/12/2016 at 9:51 AM, faxingberlin said:

Thank you. But it's the using pre-maked map.pic.  I mean the object applied shop's shader(.vfl code) and extract the Color Value From that. 

If I understand your first question, you want the velocity from a shader. That means you have to calculate (render) the shader to get the color value to transfer it to the grid as velocity. Am I missing something?

If it is a series of images you want, then you have to render the series out and put it in the attribfrommap SOP.  You could pipe the render into a COP and then reference the COP in the attribfrommap SOP so it updates every frame.

Alternatively, you could put the mandelbrot functions onto points, with a point SOP, crank up the resolution and just render that (with color).

 

Why don't you post what you have so far as a file?

 

kf

 

Link to comment
Share on other sites

On 2016. 6. 13. at 11:12 PM, kungFu said:

If I understand your first question, you want the velocity from a shader. That means you have to calculate (render) the shader to get the color value to transfer it to the grid as velocity. Am I missing something?

If it is a series of images you want, then you have to render the series out and put it in the attribfrommap SOP.  You could pipe the render into a COP and then reference the COP in the attribfrommap SOP so it updates every frame.

Alternatively, you could put the mandelbrot functions onto points, with a point SOP, crank up the resolution and just render that (with color).

 

Why don't you post what you have so far as a file?

 

kf

 

Thank you for answering. I use Cop and finally I use instance I solve! Thank you!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...