Jump to content

How To Extract Colour Value Of A Texture At A Pt?


phiru

Recommended Posts

check in texport expressions:

>> exhelp pic

>> exhelp tex

check also in VOPs SOP: there is a texture VOP, you can apply texture colour to points (you will need to apply UV first) VEX way will be also much faster what can be important if you deal with heavy geometry.

cheers,

sy.

EDIT:

there is also a plenty posts about this here and on SESI forum. Just search ;)

Edited by SYmek
Link to comment
Share on other sites

hey thanks for giving me some direction....i used tex() to colour the geometry according to its texture, but i managed to do this only with an image stored on disk...i feel like a real dud for asking this but i think ull have to break this down even further for me. when i want to use the tex option to extract the colour of the texture exactly the way its mapped on the geometry could i use the same function?if yes what would my string diskfile have to read...does just the name of the image mapped on the geometry suffice?

right now my expression reads tex("name of the image mapped on the geometry", $MAPU,, $MAPV, D_CR) and then with D_CG and D_CB in the three parameter values for ad colour in a point sop

this just colours my geometry a bit but there is no sign of colour based on the image...

Im very unfamiliar with vops so i opted for this method...:/

hellp!!!!

Link to comment
Share on other sites

well, I don't have Houdini at the front of me (11 inch display ;) ) but:

1) I'm not sure what does it mean "extract the colour of the texture exactly the way its mapped on the geometry"? Since both tex and pic use UVs in exactly the same way as Mantra during render.

If you mean that you'd like to process your texture the way it's done in your shader, you should possibly recreate this process in COPs (colour correct etc)

2) I strongly encourage you to try VOPs. They are easy, nice and fast!

You need to apply your UVs first in SOP. Add VOPSOP and jump into it (press "i"). Add Global Variables VOP and Texture VOP. Wire U and V from Globals into Texture VOP, RMB on File input of Texture VOP to add Parameter. Wire Cd Texure VOP to Cd in Output VOP. Done.

(I hope I remember this correctly).

If you want to point your VOP to image operator inside Houdini use syntex:

op:/full_path_to_operator (e.i.: op:/img/image1/brightness)

Link to comment
Share on other sites

  • 10 months later...

I'm interested in the same subject, I know how to get texture and pic infos,

but how can I get the colour info from a shader attached to an object and use the value to emit particles?

I hope it makes sense...

Thanks

Peppino

well, I don't have Houdini at the front of me (11 inch display ;) ) but:

1) I'm not sure what does it mean "extract the colour of the texture exactly the way its mapped on the geometry"? Since both tex and pic use UVs in exactly the same way as Mantra during render.

If you mean that you'd like to process your texture the way it's done in your shader, you should possibly recreate this process in COPs (colour correct etc)

2) I strongly encourage you to try VOPs. They are easy, nice and fast!

You need to apply your UVs first in SOP. Add VOPSOP and jump into it (press "i"). Add Global Variables VOP and Texture VOP. Wire U and V from Globals into Texture VOP, RMB on File input of Texture VOP to add Parameter. Wire Cd Texure VOP to Cd in Output VOP. Done.

(I hope I remember this correctly).

If you want to point your VOP to image operator inside Houdini use syntex:

op:/full_path_to_operator (e.i.: op:/img/image1/brightness)

Link to comment
Share on other sites

Thanks, that would work but it's not what I'm looking for, what I'm trying to do is sample the shader attached to a geometry and use the color information for emitting points. This is simply an academic exercise but it would help me quite a lot understanding those gray areas of Houdini :)

If you have a look at my file, you'll find I've put three different tecniques for emitting points based on color and the rightmost one is the one I can't get to work.

Since you're coloring points with your image.. the geo needs to have enough resolution if you need to have small details visible.

To emit the particle from the geo just use one/all of the color channels in the probablity field on the source pop. Here's an example..

emission_based_on_color_tecniques.hipnc

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...