3 ms·
This is extremely unlikely to be a good technique (and it isn't new) but here are two alternatives. Even in the demo video, beneath the lens flares and other e
by CyberDildonics 11y ago
This is extremely unlikely to be a good technique (and it isn't new) but here are two alternatives. Even in the demo video, beneath the lens flares and other excess, the particles are aliasing like crazy.
First of all, particles like this are usually only a few pixels in size, so the shape doesn't really matter as much as the area. Because of this, I don't think there is much gained, but there is a lot lost since it aliases so badly.
Renderman actually creates particles as two bilinear patches that make up the same shape as the intersection given by these two triangles. You could do the same thing with a quad strip, which would still also take only 6 vertices. The gpu will deal with the quads itself, possibly by creating two triangles for each quad. This is very unlikely to be a performance hit since it does not affect shading.
A second way of creating a semi-transparent particle would be make a triangle strip that rotates around one center point. The center point has an alpha of 1, the outer points have an alpha of 0. The interpolation takes care of gradient transparency to the edges, and even with 5 outer vertices the shape + gradient should easily look good enough to hold up while taking up around 16 pixels.
Shadows - the best way in these situations to control shadows is usually to scale down the particle (or hair). Remember that the shape or look on a micro scale doesn't matter as much as the integral of the area * integral of the transparency.
- DominikD 11y ago"The gpu will deal with the quads itself, possibly by creating two triangles for each quad. This is very unlikely to be a performance hit since it does not affect shading." No modern GPU (or API in fact) deals with quads. You can't guarantee all vertices to be coplanar when dealing with floating point values so you're much better off pushing triangles and not forcing driver to do conversion for you. Also if vertex data bandwidth is scarce in particle-heavy scene (so you actually care if it's 3 of 6 or whatever vertices), just push one vertex and expand it in GS like everyone else does.
- CyberDildonics 11y agoI would love to see a case, even contrived, where planar quads produce artifacts from floating point precision but I think it would be extremely difficult to demonstrate it even on an enormous ground plane quad, let alone a subpixel quad. I'm not sure why you would say no modern API deals with quads, what would you call the ability to draw quads and quad strips from gpu buffers in OpenGL? Geometry shaders should work well, what I described is an approach for lower tech situations.
- DominikD 11y agoPretty much any set of 4 fp vectors that don't share z coord will end up non-coplanar at some point (if you insist on going barycentric for texture iteration or if you plan on using halfplanes to do intersection or whatever). That's why HW tends to use fixed point internal representation in such places. But yeah, whatever, it's almost 1am and I shouldn't be spending time convincing people online that GPU developers know a thing or two about GPU. :) But at the very least trust me on one thing: quads are dead. They've been dead for a long, long time now, low-end or high-end, quads make no sense at all.