Normals acquisition

The documentation of Krakatoa shaders says something about possibility of generating normals for a pointcloud, but nothing specific.
I have an XYZRGB pointcloud and would like to test out different shaders. Is there any way / receipe to generate normals for the pointcloud in Krakatoa only basing on the pointcloud itself?
I assume that might be also possible with Frost via acquiring them from a mehsed geometry.

Let me know your workflow and approach recommendations.
Thanks.

There are several approaches, and some of them are actually documented.

PRT Loader Normals Acquisition
The PRT Loader has a feature to acquire Normals from Culling geometry, even when no Culling is actually performed.
The drawback is that the Culling is performed after the modifier stack AND transforms are processed, in other words in World Space. This means that you cannot really visualize the result using, say, Magma, because the data is calculated much later. But the Normals can be displayed as lines by the PRT Loader and will be used by the Phase Functions (mainly the Phong Surface Shader needs Normals).

thinkboxsoftware.com/krak-pa … g_Geometry
thinkboxsoftware.com/krak-ma … e_Geometry

Magma Normals Acquisition On the Stack
You can acquire Normals from the closest point on surface using a Magma modifier. This is similar to what the PRT Loader does, but happens on the stack and can be part of more complex flows. Other Magma modifiers above that one can also see the Normals and use them for other things, including writing your own shaders (if the built in Phong etc. are not doing what you want).

Magma Normals Acquisition via Global Channel Override
Like the method above, but it would be performed globally on all particles just before they end up in the PCache. So it is similar to the PRT Loader Normals From Culling Surface in that is is performed in world space, and similar to the Magma method because it would use a NearestPoint node in a Magma modifier.

In all above cases, you could create a Frost mesh and acquire its Normals. We have tested this (but did not end up using it) for G.I.Joe where we tried to give the Nanomites cloud some shininess and env. reflections.

We have also discussed adding a built-in feature to the renderer itself to produce Normals in a similar way, but it isn’t in yet. We already have a Particle Multiplication feature in Krakatoa SR that used Frost as inspiration, but doesn’t have to build an actual mesh to perform the operation, so it is even faster.

PFlow Normal Acquisition
Krakatoa also provides a Geometry Lookup operator for PFlow which is a few times faster than comparable solutions available in PFlow. It is meant to be used with dynamic moving particles, so it does not apply to your case, but I had to mention it…

If you need a Frost license, please let us know. :wink:

Many thanks. So looks like all these methods actually require geometry.
I was counting on an option that would allow doing that just basing on the particles themselves and just was curious if Krak has such an option.
I guess in this case probably it’ll be better do it externally.

Well, there ARE ways to calculate Normals without geometry, but it is up to you to implement the rules in Magma, and who knows what the results would look like…
Generally, we use Frost to mesh LIDAR data and steal the surface info from it. When we have Density gradient data, we can also use that to build Normals. You would need Ember for that to build Gradients from arbitrary particle clouds, and Ember is not available as product yet.

I got it.
I’ll check the frost variant - I already got the license access, but thanks for an offer :slight_smile: