Skip to content

Rendering points as circles instead of squares #4238

Open
@heethesh

Description

@heethesh

Point cloud rendered as circles looks nicer than the current squares!

If anyone wants to try it out, add these lines:

vec2 coord = gl_PointCoord - vec2(0.5);
if (length(coord) > 0.5) discard;

to cpp/open3d/visualization/gui/Materials/defaultLit.mat (the new visualization GUI)

fragment {
    void material(inout MaterialInputs material) {
        prepareMaterial(material);

        material.baseColor.rgb = texture(materialParams_colorMap, variable_colorMapUV.st).rgb;
        vec2 coord = gl_PointCoord - vec2(0.5);
        if (length(coord) > 0.5) discard;
    }
}

and to cpp/open3d/visualization/shader/glsl/SimpleFragmentShader.glsl (for the old visualizer)

void main()
{
    FragColor = vec4(fragment_color, 1);
    vec2 coord = gl_PointCoord - vec2(0.5);
    if (length(coord) > 0.5) discard;
}

You might have to also add this change to other *.mat or *FragmentShader.glsl files as required.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions