This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Global : | |
- Only optimize when you need to! Pixi can handle a fair amount of content off the bat. | |
- Be mindful of the complexity of your scene. The more objects you add the slower things will end up. | |
- Order can help, for example sprite / graphic / sprite / graphic is slower than sprite / sprite / graphic / graphic | |
- Some older mobile devices run things a little slower. passing in the option 'legacy:true' to the renderer can help with performance | |
- Culling, is disabled by default as its often better to do this at an application level. If you are GPU it will improve performance, if you are CPU bound - it will degrade performance | |
Sprites: | |
- Use spritesheets where possible to minimize total textures | |
- Sprites can be batched with up to 16 different textures (dependent on hardware) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/ | |
// Start with a temperature, in Kelvin, somewhere between 1000 and 40000. (Other values may work, | |
// but I can't make any promises about the quality of the algorithm's estimates above 40000 K.) | |
function colorTemperatureToRGB(kelvin){ | |
var temp = kelvin / 100; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This work is free. You can redistribute it and/or modify it under the | |
* terms of the Do What The Fuck You Want To Public License, Version 2, | |
* as published by Sam Hocevar. See the COPYING file for more details. | |
*/ | |
/* | |
* Easing Functions - inspired from http://gizma.com/easing/ | |
* only considering the t value for the range [0, 1] => [0, 1] | |
*/ | |
EasingFunctions = { |