Itās not anywhere near as complicated as it looks⦠we are the masters of cheapass effects.
The neon look⦠well, thatās just additive blending. Know this about blending:
- When you load a .png you must premultiply the RGB values by the alpha value. I was using coerceAlpha() to do this but was having some strange issues with it, Iāll revisit thatā¦
- When youāre using premultiplied alpha textures, you use the blending mode GL_ONE, GL_ONE_MINUS_SRC_ALPHA for both transparent and additive sprites.
- More recently discovered by theagentd, if youāre doing actual glows, a mode of GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA might look better. Weāre experimenting with that in a new game to see if itās better or not. Iād prefer not to use it because it means a state change at awkward moments. Only significant if youāve got tens of thousands of sprites to draw though.
The other trick up our sleeve is Chaz, who has some sort of enlightened sense of colour. I think he may be a tetrachromat. Chaz tends to define colours using HSB rather than RGB as well, which can make it a lot easier to pick colours that look good together by twiddling values.
Chaz takes extreme pains to make animations and particle emitters. The emitters are surprisingly complex. Not only are the particles themselves often actually animated sprites, they animate in size, colour, and alpha over time too, and often have slave emitters attached to the particles (which in turn emit more particles). He can spend a whole day on a single emitter.
One more tip⦠keep your frame rate at a rock solid 60Hz and almost anything looks professional. Vary your framerate and itāll look amateur. Werd.
Cas 