Point Cloud Visualizer

some updates:

0.9.25 color adjustment (filter), faster boolean - see below, also boolean is faster by first determining if point is in bounding box of mesh, so it is faster only in some cases…
0.9.24 project colors - see below, just an addition to project filter to optionally change colors from various sources on target mesh
0.9.23 fixes - ehm, i forgot what these were, some minor stuff, like drawing normals as lines was not affected by global alpha setting, etc… edit: one more - position shader rotates colors in cube grid of length 1.0


Color Adjustment

Point Cloud Visualizer

Adjust exposure, gamma, brightness, contrast, hue, saturation, value or invert colors. Click Enable to enable color adjustment shader, adjust values as needed, click Apply to apply colors to points. Click Reset to set all to default value. Shader can be disabled without changes anytime unchecking Enable. When color adjustment shader is enabled, all other shaders are disabled.

  • Enabled - Enable color adjustment shader, other shaders will be overrided until disabled
  • Exposure - formula: color = color * (2 ** value)
  • Gamma - formula: color = color ** (1 / value)
  • Brightness - formula: color = (color - 0.5) * contrast + 0.5 + brightness
  • Contrast - formula: color = (color - 0.5) * contrast + 0.5 + brightness
  • Hue - formula: color.h = (color.h + (value % 1.0)) % 1.0
  • Saturation - formula: color.s += value
  • Value - formula: color.v += value
  • Invert - formula: color = 1.0 - color
  • Reset - Reset color adjustment values
  • Apply - Apply color adjustments to points, reset and exit
Project

… Projected points can be optionally colorized by vertex colors, uv texture and vertex group from target mesh. …

  • Colorize - Colorize projected points
  • Source - Color source for projected point cloud
    • Vertex Colors - Use active vertex colors from target
    • UV Texture - Use colors from active image texture node in active material using active UV layout from target
    • Vertex Group Monochromatic - Use active vertex group from target, result will be shades of grey
    • Vertex Group Colorized - Use active vertex group from target, result will be colored from red (1.0) to blue (0.0) like in weight paint viewport

0.9.26 color adjustment fixes
applied adjustments were slightly different then previewed

Nice update Carbon2, thanks for your work!
the only thing I miss now is oversampling for render, to avoid flickering
do you think it’s possible?

what you mean? antialiasing or when you rotate slightly and some points get in front of another? do you have an example?

yes antialiasing
when render 1 pixel point size, the points are sometimes between 2 pixels, and disappear

update: 0.9.27 render supersampling and draw smooth circles

render has two new options

  • Supersampling - Render larger image and then resize back to anti-alias, 1 - disabled, 2 - render 200%, 3 - render 300%, etc.
  • Smooth Circles - Currently works only for basic shader with/without illumination and generally is much slower than Supersampling, use only when Supersampling fails
Render smoothing/anti-aliasing notes:

Use Supersampling for most of the time with lowest value (to be exact, 2 works great) that look still good. If you run into problems due to very large supersampled image sizes Blender or hardware cannot handle, you can try to disable Supersampling and use Smooth Circles to draw smooth points directly in target resolution, but you are limited to basic shader and points before drawing have to be depth sorted manually which can be very slow with large point counts.

pcv-supersampling
left without supersampling, right with supersampling 3

2 Likes

PTS files with color consist of X,Y,Z,I,R,G,B for each. If you would like to skip Meshlab at this point. Using a text editior such as gVim, to open LARGE PTS files quickly, and then add the following header
lines.

ply
format ascii 1.0
element vertex “PLEASE CUT THE FIRST LINE OF THE PTS FILE AND PASTE IT HERE, THIS IS THE VERTEX COUNT RECORDED IN THE PTS FILES”
property float x
property float y
property float z
property uchar intensity
property uchar red
property uchar green
property uchar blue
end_header

Then simply save the file as a .ply …import and now you have all the colors
from your registered pointcloud.

Example of the element vertex line below

element vertex 1250541

Hi carbon2,
Amazing add-on. You should be very proud!
I create/use large dense point cloud scenes that I hope to be able to render/animate in Cycles/Eevee which will contain other models/objects. Blender keeps crashing after attempting to Convert. Do you have any suggestions of which settings to use in your add-ob to avoid the crash.

2 Likes

hi, how many points do you have? what type of instance do you using? sounds like you are getting out of memory. lower point counts works?

Sorry for the late reply. The scene I am working on now has 32.7m points. That was after I subsampled it down… from 500m+
I have tried all the instances and they all crash. (i7 processor with 32g ram)
Its crazy that the viewport renders the point cloud really nicely, and when you create and add primitives or other objects, they place perfectly in the scene, but thats where the magic stops (for me)

i guess you went out of memory, 33m is too much. in cubes it is mesh with 33 * 10^6 * 8 = 264m vertices, try with 5m for start, and try converting to particles, you can change instanced mesh afterwards and emitter will be most basic mesh while keeping point orientation

update: 0.9.28 clipping planes from object bounding box, faster all numpy export, many minor fixes

Clip

Shader with 6 clipping planes. Planes can be enabled/disabled independently with eye icon, first 3 values are plane normal (x, y, z), last value is plane distance from origin. These can be set from different object bounding box, choose object from scene in Object and hit Set Clip Planes From Object Bounding Box, object can then be hidden/deleted, set values will stay until operator is executed again. X reset all the settings to their defaults.

Point Cloud Visualizer

  • Enable Clipping Planes Shader - enable shader
  • Plane 0 - plane 0 normal (x, y, z), plane 0 distance from origin
  • Plane 1 - plane 1 normal (x, y, z), plane 1 distance from origin
  • Plane 2 - plane 2 normal (x, y, z), plane 2 distance from origin
  • Plane 3 - plane 3 normal (x, y, z), plane 3 distance from origin
  • Plane 4 - plane 4 normal (x, y, z), plane 4 distance from origin
  • Plane 5 - plane 5 normal (x, y, z), plane 5 distance from origin
  • Object - object to use as bounding box source
  • Set Clip Planes From Object Bounding Box - set planes from selected object bounding box
  • X - reset all the settings to their defaults
1 Like

Clipping was a really needed feature for modelling over the scan as a reference. Great update!

Extremely powerful addition to the tool… Thank you!:partying_face: