vtkPointGaussianMapper - SetSplatShaderCode

Dear VTK Users,
I am using vtkPointGaussianMapper and set the SplatShaderCode as below:
mapper->SetSplatShaderCode(
“//VTK::Color::Impl\n”
“float dist = dot(offsetVCVSOutput.xy,offsetVCVSOutput.xy);\n”
“if (dist > 1.0) {\n”
" discard;\n"
“} else {\n”
" float scale = (1.0 - dist);\n"
" ambientColor *= scale;\n"
" diffuseColor *= scale;\n"
“}\n”);
which render the points as spheres as shown below .
image

I want to render these points as Cubes, Can anyone provide me an example shader code for cubes?
Thanks in advance.

Please note that the points are not rendered as spheres but as disks with a fake shading.
You cannot render cubes with this mapper (you can render squares but I guess you do not want that).

You might be interested by vtkGlyph3DMapper (use SetSourceData with a box).

Thank you Michael for the reply .

Yes, I don’t want squares… Even I don’t want to render cubes.

If not with this mapper, Is there any other mapper where there is an option to do fake shading these points as Cubes…

Thank you.

With Kind Regards,

Mallikarjun

Is there any reason why you do not want to render cubes with vtkGlyph3DMapper? This is pretty cheap compared to spheres.