Jump to content

Vex shading?


jimmyb

Recommended Posts

Since I couldn't remember all of the samplerInfo's "info" so I had to google around a bit until I found this screenshot.

So here are my guesses =)

Bah....it will take to long to write, so here is a sample file. Go to VOPs then enter the surface1 VOPnet.

I'm not 100% on everything, mainly the direction of Maya's "I". Knowing Maya it probably is point in the wrong direction. :P

Here is the sample file.

Mayaish.zip

jim.

ps.

Maya's samplerInfo = Bicycle with training wheels

Houdini's VEX = ATV with a cooler of Red Bull attached to the back.

Link to comment
Share on other sites

Sampler Info

Provides you with information about each point on a surface as it is being sampled, or calculated, for rendering purposes. Sampler Info can give you information about a point's position in space, its orientation and tangency, and its location relative to the camera.

Many of the attributes for this node provide values in camera coordinate space, the local object space of the camera. Each camera (in its own space) is located at the point 0, 0, 0. It looks straight along the negative Z axis, and the positive Y axis points up.

Find this utility in the Create bar.

To use the Sampler Info utility, see Use the Sampler Info utility.

Point World

Provides the position currently being sampled relative to the X-,Y-, and Z-axis of the world.

Point Obj

Provides the position currently being sampled relative to the X-,Y-, and Z-axis of the object.

Point Camera

Provides the point of the object being shaded. This point is located in XYZ camera space. You can connect this surface point in materials for the object being shaded to show some interesting effects based on the camera view.

Normal Camera

Provides the orientation of a face relative to the camera.

Uv Coord

Provides the UV coordinates of a point to be shaded. The convention is that UV coordinates are measured from 0 0 to 1 1.

Ray Direction

Indicates the direction in which the current point is seen from the camera. Use this attribute in materials for objects to provide the direction towards the camera for every pixel in the object.

Tangent UCamera, Tangent VCamera

Sets the surface tangents in camera space (as opposed to world space or object space). For polygons, the tangents are generally not defined. NURBS have a well-defined tangent space (as visible in Maya; create a NURBS object, display its CVs and notice the NURBS object has a U direction and a V direction).

Mathematically, tangents provide an instantaneous direction perpendicular to their point of origin on a surface. Their magnitude is affected by the rate of change (curvature) of the surface. A good math book should have a diagram showing the tangent to a curve, which can then be extrapolated to give you an idea of what tangents on a surface look like. Tangent U and Tangent V Camera attributes are for advanced users only.

Pixel Center

Provides Pixel Center X and Pixel Center Y. The result depends on the image, not on the geometry.

Facing Ratio

Produces a value that varies between 0 and 1 depending on the angle between the surface normal and view direction.

Flipped Normal

Turn on or off depending on whether the object is textured differently on either side. The flipped normal attribute indicates if the surface normal is flipped which also tells you which side of the surface Maya is shading.

-----------------------

handy little fella...great for x-ray style shaders etc

Link to comment
Share on other sites

Ray Direction

Indicates the direction in which the current point is seen from the camera. Use this attribute in materials for objects to provide the direction towards the camera for every pixel in the object.

Well wouldn't you know, -I, figures. <_<

In my example slap down a negate VOP and it will be right. =)

I wonder if you affect these properties or just view them? Is this the only way for users to access this in Maya?

IIRC, these are provided to you only as a courtesy at render time and are read only.

Reminds me of Maya's marketing slogan.

"Can you imagine?"

jim.

Don't let this message fool you, this author does infact like Maya, he just likes Houdini 100 times more. :P

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