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
--[[ | |
Optimized pixel rendering by Hexcede | |
Version 1.0 | |
How do I use it? | |
The only function contained on the PixOptimize module is the Generate function. It takes a 2D array of pixels and returns a Frame containing the generated image. | |
How does it work? | |
This works by using UI gradients to render pixels instead of individual frames. It splits the image into 1x20 (could be increased in the future if Roblox supports ColorSequences with >20 values) strips which are colored using a single UIGradient instance. | |
What are some current problems with this method? | |
Due to the interpolation of UIGradients slight visual artifacting WILL occur. The perlin noise debug mode included in the demo script shows this artificting best. |
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
-- Makes destructors easy to create | |
local FastSpawnEvent = Instance.new("BindableEvent") | |
FastSpawnEvent.Event:Connect(function(callback, argsPointer) | |
callback(argsPointer()) | |
end) | |
local function createPointer(...) | |
local args = { ... } | |
return function() |