This message was posted on behalf of Intel Corporation
Thank you for your interest in Intel® RealSense™ Technology.
For this question, we recommend you to use Unity forums because it is more relevant to Unity than to the Intel® RealSense™ Technology.
The current versions of Intel's Realsense SDK for Unity contains all of it's own parameters within the C# scripts, and does not rely on an external Unity Event System or Particle Generator in the editor. It is wholly self-contained.
By your statement you are effectively stating that there are no correlated methods, values, objects or lines of code in the Realsense SDK 2.0's Unity wrapper, that have an impact on the point cloud generation, it's size, or the ability to tweak the attributes of the point cloud. Can you please confirm this?
If confirmed, that would mean the script PointCloudGenerator.cs is relying on some point cloud system built into Unity or another dependency. Can you please let me know what system within Unity the SDK is relying on?
1 of 1 people found this helpful
I have resolved this issue, as expected it was capable to modify point size from within the RealSense SDK scripts itself, and was not inherently a Unity issue.
For the curious:
A recent update to the Realsense 2.0 SDK included a new point cloud shader, with a public variable 'Point size' defaulted to 4. This is only functional by changing Graphics API to GL, by going to Edit > Project Settings> Player. For me, I had to disable 'Auto API,' and remove the DX11/12, to replace it with OpenGL Core.
My project is using a derivative of the Realsense SDK (called Extended Realsense), which includes an older point cloud shader that does not allow point size change. Many of the component and method names are different in 'Extended Realsense' so importing the new shader AS-IS would not be compatible. Thankfully, the two shaders share a very similar structure, so it simply required carrying a few lines of code over to make it work.
In Properties, I added:
_PointSize("Point Size (GL only)", Float) = 4.0
in 'struct v2f' I added:
float size : PSIZE;
After 'struct v2f' and before 'v2f getVertexOut()' I added:
Finally in 'v2f getVertexOut() ...' I added:
o.size = _PointSize;
That's it! Now I can select point size on my point cloud shader (even works at runtime).