Tuning the output; looking for full resolution (and less particles?)
Joshfindit opened this issue · 1 comments
Joshfindit commented
On the iPad Air 2, getting 8mil particles at 20-30fps and stunned.
It feels fuzzy though; not pixel-accurate on the retina display. If this is due to computing particles at a lower resolution then scaling up, how can the code be modified to change this behaviour so that particles are sharp?
To make it work, will the number of particles need to be reduced so that the fps can stay high?
FlexMonkey commented
Hi,
To get "retina" particles, you just need t double a few numbers. Try these:
// init()
bytesPerRow = 4 * imageWidth * 2
region = MTLRegionMake2D(0, 0, Int(imageWidth * 2), Int(imageHeight * 2))
blankBitmapRawData = [UInt8](count: Int(imageWidth * imageHeight * 4 * 2 * 2), repeatedValue: 0)
drawableSize = CGSize(width: CGFloat(imageWidth * 2), height: CGFloat(imageHeight * 2));
// reset particles...
let imageWidthDouble = Double(imageWidth * 2)
let imageHeightDouble = Double(imageHeight * 2)
The particles still run quickly, but the Metal Performance Shaders are pretty slow which is why I have the demo at a lower resolution.