Closed matthewturk closed 3 years ago
Next up is reducing the geometry shader overhead by determining the clip space vectors for the radius, without doing the 8 corner iteration.
This should be a matter of pulling columns out of the inverse matrix, I think...
The coordinates for the expanded particle views via the geometry shader are now computed via clip space vectors, applied in world space, and transformed back. There might be a way to do this with some matrix math that's consolidated at some point.
The particles are still just flat -- no attenuation or smoothing. The next step is to add a 1D texture with the pre-integrated smoothing in it, and then integrate that.
SPH kernel interpolation is now in, using the yt SPHKernelInterpolationTable class. What I'm seeing at present is that I have -- as per usual -- gotten confused with the smoothing lengths and half-smoothing lengths, and how to pass all of that in via UV coordinates. I'll dig in to this as I am able to.
The frame rate goes pretty far down when I zoom in, which doesn't actually make a lot of sense to me; I suspect this is a result of me not completely understanding where the time is being spend in the various parts of the pipeline.
I've done a bit of reading and I think I need to learn more about instanced rendering to see if it's possible to avoid the geometry shader here. I'm not completely sure it is, but it may very well be.
This is not the end stage of where particle rendering should be -- as it just uses GL_POINTS -- but it is an incremental step.
The next phase is to use a geometry shader to expand the GL_POINTS into overlapping sets of quads/triangles and then properly integrate through them.