Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Most performant image format for SCNParticles?

I've been using 24bit .png with Alpha, from Photoshop, and just tried a .psd which worked fine with OpenGL ES, but Metal didn't see the Alpha channel.

What's the absolutely most performant texture format for particles within SceneKit?

Here's a sheet to test on, if needs be.

It looks white... right click and save as in the blank space. It's an alpha heavy set of rings. You can probably barely make them out if you squint at the screen:

enter image description here

exaggerated example use case:

https://www.dropbox.com/s/vu4dvfl0aj3f50o/circless.mov?dl=0

enter image description here

// Additional points for anyone can guess the difference between the left and right rings in the video.

like image 428
Confused Avatar asked Sep 02 '15 01:09

Confused


1 Answers

Use a grayscale/alpha PNG, not an RGBA one. Since it uses 16 bits per pixel (8+8) instead of 32 (8+8+8+8), the initial texture load will be faster and it may (depending on the GPU) use less memory as well. At render time, though, you’re not going to see much of a speed difference, since whatever the texture format is it’s still being drawn to a full RGB(A) render buffer.

There’s also PVRTC, which can get you down as low as 2–4 bits per pixel, but I tried Imagine’s tool out on your image and even the highest quality settings caused a bunch of artifacts like the below:

PVR artifacts

Long story short: go with a grayscale+alpha PNG, which you can easily export from Photoshop. If your particle system is hurting your frame rate, reduce the number and/or size of the particles—in this case you might be able to get away with layering a couple of your particle images on top of each other in the source texture atlas, which may not be too noticeable if you pick ones that differ in size enough.

like image 148
Noah Witherspoon Avatar answered Oct 18 '22 13:10

Noah Witherspoon