is the P in sop vop type different with it is in vop?

   5846   11   2
User Avatar
Member
288 posts
Joined: July 2005
Offline
Is the P in sop vop type different with it is in vop?

I created an attribute in sop vop type, so, does each P on the model has the attribute value? Does the P mean to the points on the model?

If this attribute is in the vop(to make shader), does P mean to shading point. not the P on the model?

Is there any way to convert my attribute on each P in model(sop type vop) to the shading P value? I want to use the sop type vop attribute to make the displacement shader, so I can visualize the attribute in the viewport, also use this attribute for displacement shader.

Thanks for any anwser.
^_^
User Avatar
Member
58 posts
Joined: Sept. 2007
Offline
P simply stands for position.

In SOP context it means Point Position.(sinse were essentially loop thrue all the points)

In shading Context it means the position on the model that corresponds to the pixel that is being rendered.

Be amazed of my Picture !

Pixels, Ray per pixel, Intersection Point AKA: Position “P”
Pixel||————————–>/X
Pixel||———————— >/XX
Pixel||————————>|XXX
Pixel||————————>|XXX OBJECT
Pixel||————————>|XXX
Pixel||————————->\XX
Pixel||————————–>\X


So “N” will mean the Normal of the object at that position “P”.
Or “Cd” Texture color at that position “P”

ect ect.
User Avatar
Member
519 posts
Joined:
Offline
Hmmm didn't know mantra could render ASCII….
User Avatar
Member
288 posts
Joined: July 2005
Offline
thanks for these information. but I still want to know how to convert attribute P in sop value into attribute shading P value.
^_^
User Avatar
Staff
2593 posts
Joined: July 2005
Offline
ykcosmo
thanks for these information. but I still want to know how to convert attribute P in sop value into attribute shading P value.

In your surface/displacement shader, if you do:

vector pp = transform(“spacebject”, P);

Then pp will be in the same space as the SOP.

However, the initial space in a mantra shader is in “camera” space. So, the P in your shader is dependent on which camera you are rendering from. I hope this helps.
User Avatar
Member
58 posts
Joined: Sept. 2007
Offline
Srry i skimmed thrue your post to fast. :roll:
User Avatar
Staff
2593 posts
Joined: July 2005
Offline
Tamis
Srry i skimmed thrue your post to fast. :roll:

I sure liked your picture though.
User Avatar
Member
288 posts
Joined: July 2005
Offline
vector pp = transform(“spacebject”, P);

hmm….. understand, so can I transform the P in vex into sop? from shading object P into sop P?

I want to use the displacement value to affect the model, then create attribute based on this value and emit particles.
^_^
User Avatar
Staff
2593 posts
Joined: July 2005
Offline
ykcosmo
vector pp = transform(“spacebject”, P);

hmm….. understand, so can I transform the P in vex into sop? from shading object P into sop P?

I want to use the displacement value to affect the model, then create attribute based on this value and emit particles.

Try the attached .hip file.

There's a displacement shader attached to the flat grid which transforms the P into “spacebject”. There's also a SOP which deforms the SOP's P using the same set of VOPs.

The image you render should be similar (but a little smoother) than the deformed geometry.

Oh, the grid is turned on for rendering, the deformation SOP is turned on for templating.

I believe this technique was first used in X-Men for Senator Kelly's death (since the heart monitors had to be animated to match the displacement shader).

Attachments:
spaces.hip.gz (10.7 KB)

User Avatar
Member
288 posts
Joined: July 2005
Offline
thanks for help.

I am making the ocean wirlpool, I want to use the attribute from displacement to emit particles, I will study your hip, thank you!!
Edited by - Aug. 20, 2009 14:08:03
^_^
User Avatar
Member
288 posts
Joined: July 2005
Offline
oh.. use the template displaced object to emit particles and render the grid with displacement shader, right?

cool!!!
^_^
User Avatar
Member
26 posts
Joined: Nov. 2008
Offline
I would like to set the color of points to the color of a background image, as seen through the camera. I tried using the transform command, but it I don't think it works in a VOP SOP.

The spaces.hip example goes the wrong way for me (i.e. the shader converts camera -> object space). I need object-> NDC in a VOP SOP.

Any ideas?
Scott Peterson, Machine Learning Graphics Engineer, Unity
  • Quick Links