Jump to content
Sign in to follow this  
tjvoll

ramp

Recommended Posts

how do you apply a ramp from cop2 onto a surface of geometry. I know how to do it with the ramp in cop, but I'm having problems using materials, so i can't go that route.

Share this post


Link to post
Share on other sites

float pic (string copname, float U, float V, float color_type)

This function will lookup a single pixel from a COP and return the color

of the pixel. The color_type parameter can be one of the following:

D_CR, D_CG, D_CB, D_CA, D_CHUE, D_CSAT, D_CVAL, D_CLUM

for the red, green, blue, alpha, hue, saturation, value, or luminance of

the pixel. The color returned will be interpolated smoothly between

adjacent pixels.

eg. pic("/comp/ice1/color1", .5, .5, D_CLUM)

See also: picni, tex, texni, res

plug this into the color channel in a point sop...you can use this in other channels within the point sop to get some interesting results.

Share this post


Link to post
Share on other sites

:o woaw!

isn't there any easier way to do this than to use a function?

All i want to do is apply a Ramp from the cop2 to a surface of a sphere.

I did this with a Ramp from the old COPs section and then i'd apply it to the 'texture map' TOP inside of a Constant Material.

I don't know how to do this otherwise and i'm having problems with using Materials.

I figured there would be an easier, or equally easy way to do this with the COP2 because if COPs are going to be phased out, shouldn't COP2s be better and easier to use?

Share this post


Link to post
Share on other sites

Have you tryed using vops?

Try the vpRamp vop. I am working on releasing a shader version of this, but if you're familiar with how to make a shader in vops, then just download the vpRamp optype and construct your own with it.

You can find at here

Cheers,

--Carlos

Share this post


Link to post
Share on other sites

using pic() is pretty simple, all you are doing in this case is taking the color value of the ramp in cops and applying it to the color of your object. you get all the added happiness that comes with cops to!

visualize houdini as a unix file system...in this case you are copying files from one directory to another...make sense? :)

if you have access to the learning CD which comes with apprentice, there is a texturing video which should have the click & apply method you are looking for. or better yet, use carlos's VOP!!! :D

Share this post


Link to post
Share on other sites

Hi there,

I think plan9 is thinking that you are trying to attribute color (Cd) point attributes to your geometry. Is this what you're trying to do? It seems like all you want to do is merely assign the ramp as a surface shader.. and if this is what you're doing then I'd save the ramp out as an image (Preview Full, and save) and then refer to it in a shader like the VEX Layered Surface shader.

The correct procedural way to do this is to avoid the saving of the file in the first place and you can do this... well, theoretically. A bug must be preventing is from working properly. The best way to do this is this:

Create your ramp, called "/img/img1/ramp1"

And in the VEX Layered Surface shader (actually any shader with an image filename field") you put the following:

"op:/img/img1/ramp1"

And the ramp will be executed and passed invisibly to the renderer as an image. If you do this you'll see that the shader ball previews the ramp correctly but for some reason doing a full mantra render shows the red "no texture found" color.

(Mike C, could you log this as a bug? Thanks!)

IMO, all image file fields should have a picker menu associated which will allow the user to select cops to assign and the op:/ syntax filled in for you.

(Mike C, could you RFE that? ;))

Cheers,

Jason

Share this post


Link to post
Share on other sites

Actually, this is one of the main reason behind my effort to build a decent ramp vop. For one, you can not access COPs2 from VOPs. Second, using this method : "op:/img/img1/ramp1" - does not work for me. Peter said that it works for him, but he thinks it may have been fixed in his version which should be out in the next couple of weeks. I am using build 151.

Yes, I would like to see all image fields refer to COPs as well :)

--Carlos

Share this post


Link to post
Share on other sites

"op:/img/img1/ramp1"

'T WAZZABOUT TIME!!! :)

phew! had to get that off my chest...now "if" only these goodies could be documented...

talk about documenting...

umm..hey Jason, do you mind writing a short description about $OS $OBJ (lightdome....) would be nice....

CHeers!

Share this post


Link to post
Share on other sites

and the maestro steps in! ill submit these tommorow ;)

"op:/img/img1/ramp1.......you'll see that the shader ball previews the ramp correctly but for some reason doing a full mantra render shows the red "no texture found" color." ~ bug

"all image file fields should have a picker menu associated which will allow the user to select cops to assign and the op:/ syntax filled in for you. " ~ RFE

thanks j! stop breakin the software, kthnx!!!! :lol:

Share this post


Link to post
Share on other sites

I wanted to see if this was fixed but ran across a slightly different problem. :huh:

I created a simple ramp in COPs2, then in SHOPs referenced the ramp wtih the VEX Decal shader with, "op:/img/img1/ramp1". Then applied the shader to a grid. I created an ascii IFD (mantra driver), to see what the file looked like. Standard scene stuff, and the towards the bottom a bunch of encoding which I assume is the ramp COP.

... SNIP ....

ray_copmap op:/img/img1/ramp1 ascii

200 200 8 0 1 0

M`/___P#___\`____`/___P#___\`____`/_^_P#__O\`__[_`/_^_P#__?\`

... SNIP a lot of lines....

M__W_`/_]_P#__/\`__S_`/_[_P#_^_\`__K_`/_Z_P#_^?\`__G_`/_X_P#_

M]_\`__?_`/_V_P#_]?\`__7_`/_T_P#_\_\`__+_`/_Q_P#_\/\`_^__`/_N

Now when I tried to render this with Mantra, it got all confused and I got a ton of error messages like.

"Unknown command: M_]_`/_/_P#_SO\`_\S_`/_*_P#_R?\`_\?_`/_&_P#_Q/\`_\+_`/_`_P#_"

I tried to render a binary version and it didn't have any errors except "Unable to load texture op:/img/img1/ramp1"

Is mantra suppose to read ascii IFDs with COPs?

Any ideas? I was using Houdini 5.5.230....

Jason Caleb

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
Sign in to follow this  

×