gboisse / gfx

A minimalist and easy to use graphics API.
MIT License
502 stars 36 forks source link

Rendering PointClouds #10

Closed petrasvestartas closed 2 years ago

petrasvestartas commented 2 years ago

Hi,

Is it possible to render large point-clouds? E.G. 1000 000 points.

gboisse commented 2 years ago

Hey, you certainly can.

One way to do this is have a buffer of float4's storing all your points positions, then load that position in a vertex shader and output a camera-aligned quad for the pixel shader to draw. You'll probably want to enable some alpha blending using gfxDrawStateSetBlendMode() if you want those to be transparent.

For more details, I'd recommend you look into some basic particles tutorials, which I am sure you can find around the net 🙂

gboisse commented 2 years ago

Closing due to inactivity.