Hello sidefx forum,
I would like to know how to procedurally write point clouds from a vopsop.
I'm scattering points over a surface and I would like to create a point cloud based on these scattered points.
This point cloud will record the ID and position of each point so that a shader can sample the nearest X points and do various fun stuff after that.
Currently the pic/hip file attached is creating a scatterCloud.pc file of Okb (with no information).
(the other method approach in the attached hip file reads a point cloud from an input to the vopsop, I hope this isn't the only method of writing point clouds on the fly because I guess that would mean creating a bunch of geometry attributes to be read by the shader and this seems less elegant ((and I'm confused by how to do it as you can see)) )
Anyway I'd appreciate any advice on procedurally writing point clouds or help with my muddled hip file.
Thanks a lot,
Mat
PCwrite from vops
7691 15 2-
- Candide
- Member
- 14 posts
- Joined: July 2012
- Offline
-
- rafaels
- Member
- 696 posts
- Joined: March 2009
- Offline
I might be wrong, but I've only seen the workflow you're using inside a shader. In that case Mantra reads the shader network and writes out the point cloud.
You could use the ROP output driver or a file SOP to write out your point cloud though…
Cheers
You could use the ROP output driver or a file SOP to write out your point cloud though…
Cheers
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
-
- Candide
- Member
- 14 posts
- Joined: July 2012
- Offline
-
- tamte
- Member
- 8642 posts
- Joined: July 2007
- Online
you can
but instead of writing geometry to pointcloud just access it with from the vopsopREAD like this
op:`opinputpath(“.”,1)`
so it will take geometry from second input as a file, so no need to write it to disk
there is plenty of examples of this on forums
however if you want to write points in SOPs and read them back in the shader you can just save pointcloud to disk as normal geometry through ROP output SOP or geometry ROP
but instead of writing geometry to pointcloud just access it with from the vopsopREAD like this
op:`opinputpath(“.”,1)`
so it will take geometry from second input as a file, so no need to write it to disk
there is plenty of examples of this on forums
however if you want to write points in SOPs and read them back in the shader you can just save pointcloud to disk as normal geometry through ROP output SOP or geometry ROP
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
-
- Candide
- Member
- 14 posts
- Joined: July 2012
- Offline
Thanks,
yeah, I know about the dynamically resolved pathy thing but I'm trying to procedurally write a point cloud so that in can be used in different shaders as you said.
I would like to be able to write this point cloud automatically if some user parameters are changed (number of scattered point e.t.c) and it seems like the geometry rop and rop output driver both need to be activated by physically clicking ‘render’.
I want something that automatically writes the cloud if the values are changed
yeah, I know about the dynamically resolved pathy thing but I'm trying to procedurally write a point cloud so that in can be used in different shaders as you said.
I would like to be able to write this point cloud automatically if some user parameters are changed (number of scattered point e.t.c) and it seems like the geometry rop and rop output driver both need to be activated by physically clicking ‘render’.
I want something that automatically writes the cloud if the values are changed
-
- symek
- Member
- 1390 posts
- Joined: July 2005
- Offline
Candide
Thanks,
yeah, I know about the dynamically resolved pathy thing but I'm trying to procedurally write a point cloud so that in can be used in different shaders as you said.
I would like to be able to write this point cloud automatically if some user parameters are changed (number of scattered point e.t.c) and it seems like the geometry rop and rop output driver both need to be activated by physically clicking ‘render’.
I want something that automatically writes the cloud if the values are changed
You can achieve this with FileSOP set to write/automatic mode. This is error prone though, not sure if it's worth an efforts.
-
- tamte
- Member
- 8642 posts
- Joined: July 2007
- Online
-
- Candide
- Member
- 14 posts
- Joined: July 2012
- Offline
-
- Candide
- Member
- 14 posts
- Joined: July 2012
- Offline
Can I ask one more question?
I am trying to dynamically resolve a path to a scatter sop from the shop context.
I am using the value:
`opinputpath(“/obj/projectionSubnet/combo/POINTS_OUT”, 0)`
in the point cloud texture parameter for the pc open vop. I've also tried:
op:`opinputpath(“/obj/projectionSubnet/combo/POINTS_OUT”, 0)`
but these don't seem to be working. Ideally I'd like to do this by relative path. Something like:
op:`opinputpath(“../../combo/POINTS_OUT”, 0)`
Any help would be appreciated
I am trying to dynamically resolve a path to a scatter sop from the shop context.
I am using the value:
`opinputpath(“/obj/projectionSubnet/combo/POINTS_OUT”, 0)`
in the point cloud texture parameter for the pc open vop. I've also tried:
op:`opinputpath(“/obj/projectionSubnet/combo/POINTS_OUT”, 0)`
but these don't seem to be working. Ideally I'd like to do this by relative path. Something like:
op:`opinputpath(“../../combo/POINTS_OUT”, 0)`
Any help would be appreciated
-
- rafaels
- Member
- 696 posts
- Joined: March 2009
- Offline
The op: command requires an absolute path. You can use the opfullpath expression together with/instead of the opinputpath:
http://www.sidefx.com/docs/houdini12.0/expressions/opfullpath [sidefx.com]
So from the vop SOP it would be something like this:
op:`opfullpath(opinputpath(“.”,0))`
Cheers
http://www.sidefx.com/docs/houdini12.0/expressions/opfullpath [sidefx.com]
So from the vop SOP it would be something like this:
op:`opfullpath(opinputpath(“.”,0))`
Cheers
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
-
- tamte
- Member
- 8642 posts
- Joined: July 2007
- Online
-
- rafaels
- Member
- 696 posts
- Joined: March 2009
- Offline
right… I missed that little part about the shop context!
![](/static/djangobb_forum/img/smilies/smile.png)
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
-
- Candide
- Member
- 14 posts
- Joined: July 2012
- Offline
Cheers guys, this is working OK.
I have a new crisis now. I cannot understand pcexport. I'm trying to accumulate information on shaded points by reading and writing data to/from a point cloud.
As a test I am trying to read data from a point cloud (with a single point), add to it, and export that data back to the point cloud (to accumulate with each shaded point). I have this code in my vex shader:
int handleGlobal;
int success;
int newVar;
int oldVar;
handleGlobal = pcopen(“…/PC/global.pc”, “P”, { 0, 0, 0 }, 1, 1);
pcfilter(handleGlobal, “myVar”, oldVar);
newVar = oldVar + 3;
success1=pcexport(handleGlobal, “myVar”, newVar);
pcclose(handleGlobal);
success1 is returning 1 so the export is sort of working but the point cloud is not getting written to.
Any ideas? Am I using pcexport wrongly?
I have a new crisis now. I cannot understand pcexport. I'm trying to accumulate information on shaded points by reading and writing data to/from a point cloud.
As a test I am trying to read data from a point cloud (with a single point), add to it, and export that data back to the point cloud (to accumulate with each shaded point). I have this code in my vex shader:
int handleGlobal;
int success;
int newVar;
int oldVar;
handleGlobal = pcopen(“…/PC/global.pc”, “P”, { 0, 0, 0 }, 1, 1);
pcfilter(handleGlobal, “myVar”, oldVar);
newVar = oldVar + 3;
success1=pcexport(handleGlobal, “myVar”, newVar);
pcclose(handleGlobal);
success1 is returning 1 so the export is sort of working but the point cloud is not getting written to.
Any ideas? Am I using pcexport wrongly?
-
- symek
- Member
- 1390 posts
- Joined: July 2005
- Offline
-
- Alejandro Echeverry
- Member
- 691 posts
- Joined: June 2006
- Offline
What is the main difference between *.pc and *.bgeo (for point cloud processing); For shading what is the best to use.
Thanks!!!
Thanks!!!
Feel The Knowledge, Kiss The Goat!!!
http://www.linkedin.com/in/alejandroecheverry [linkedin.com]
http://vimeo.com/lordpazuzu/videos [vimeo.com]
http://www.linkedin.com/in/alejandroecheverry [linkedin.com]
http://vimeo.com/lordpazuzu/videos [vimeo.com]
-
- symek
- Member
- 1390 posts
- Joined: July 2005
- Offline
alejandro
What is the main difference between *.pc and *.bgeo (for point cloud processing); For shading what is the best to use.
Thanks!!!
Unlike bgeo, which is general geometry container, pc uses tiled block format internally (the same used by rat textures). They are supposed to be more efficient on load and more graceful for RAM, although it's hard to tell, since ifaik no one has posted any test cases
![](/static/djangobb_forum/img/smilies/smile.png)
-
- Quick Links