Jump to content
Adam Ferestad

Using a Point Cloud in a Shader?

Recommended Posts

I have been fiddling with making a rust texture that has features that are able to be controlled from a point cloud.  That way I can have a bit more artistic control, while still being entirely procedural.  That is kind of the essence of the assignment I am working on.  Unfortunately I am pretty sure that I am doing something wrong with the point cloud in the VOP network, because It will go ok without an error for a bit, but then it will suddenly start giving me an error that some shader doesn't exist, and the name is something like Ѣæŗ.vfl or some other random ascii code.  I go reoutput my .sc file and it works for a bit, then suddenly breaks again.

Also, I tried to use an op reference to it at one point, and it didn't really like that either.  Any ideas?


Share this post

Link to post
Share on other sites

pcimport function work inside while loop in pair with pciterate function:

while (pciterate(handle))

You can make such while loop in VOPs. Or, as simpler alternative, import by index.


Share this post

Link to post
Share on other sites

yeah, don't use pcimport unless you're manually looping over your point cloud.  from your shader code, it looks like you're really just using the point cloud to isolate areas so a pcfilter vop instead of the pcimport is what you're looking for.  that will do the loop for you and put out a single filtered(averaged) value based on what it finds in the point cloud.  in this case, the point position coming out will be an average of those points found in your file.

also, you need to transform the incoming search P to whatever space the point cloud is in.  shaders operate in camera space.  depending on how your point cloud was written, it's probably in world space or more likely in some object's space.  you should make sure it's exported in world space (ie, it's in an object that has no rotate/translate/scale).  then transform your shader P to world space (from "current").


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