Reading and writing to a buffer is around 20% slower than an array from what I’ve seen, so it isn’t even a better option for performance. It’s only good to reduce memory usage but that’s all.
When i make games, i like to optimize them as much as i can, but seeing people make a whole optimized rendering engine on Roblox feels like another level.
I took your idea and added a way to obtain an ImageData object with roblox TextureIds.
We are now no longer limited to 256x256, now we’re limited to roblox’s image asset res of 1024x1024.
Perfect for texture sampling!
like, look at this skybox in my raycaster engine :o
Only downside to this method compared to using SaveObjects is that the method yeilds (since we have to use AssetService to load the roblox image asset), but that hopefully shouldn’t be problem for this project at all.
-- [New method: yeilds, but can go up to 1024x1024]
local ImageData = CanvasDraw.GetImageDataFromTextureId("rbxassetid://1346999791")
-- i know, very long method name.. I just don't know what else to name it
-- [Old method: doesn't yeild and loads instantly, but can only go up to 256x256]
local ImageData = CanvasDraw.GetImageData(SaveObject)
Hope this contribution helps your project @AsyncHero
CanvasDraw4.0.0EarlyAccess.rbxm (25.5 KB)
You can keep both options, similar to how CFrame animations is still possible but it’s preferred to do Animations using Animation Editor.
Weird example i know
Oh im definitely still keeping the old method too as it is a completely offline and fast alternative. And plus it’s an image storing method that I invented too!
Are editable images faster than just frames?
How in the world did you optimize this?? What FPS are you getting?
its just a texture, you don’t end up actually rendering the whole 1024x1024 image, only a few individual pixels.
This is super cool and impressive!
I just wish Roblox allowed us to execute code on the GPU.
Without GPU acceleration or multi-threading on a CPU with many cores I feel like performance will tank down a lot in graphically intensive scenes.
I’d love to see someone make a game with this but I do feel most people won’t be able to run this on a potato computer very well.
I’m already impressed it can reach a stable 30 fps.
Im getting 60+ FPS at 320x320.
I just used !native, EditableImage, 1D look-up arrays and general code optimisation and a years worth of improvements and optimisations for CanvasDraw.
CanvasDraw 4.0 will be THE custom graphics api.
I think this update may be helpful for improving performance of this module.
Introducing Luau buffer type [Beta] - Updates / Announcements - Developer Forum | Roblox
It wont. Buffers are good for storing or transferring smaller amounts of data. Directly reading and writing to a 1D table is faster I think
This will be amazing for high quality textures! I can’t even wait to start playing around with this. Since I haven’t added support for multiple textures to object files, the resolution is very limited. Now, it is insane! Amazing stuff, thanks so much!
The collision is experimental at best, and so is the physics. If you want, you can make your own since that isn’t really my field of expertise. I started to focus on the more internal and general part of the engine instead of its modules, so I haven’t had time to research more.
Wow, this took a while.
New release v2.3 of the Engine, which dramatically improves performance!
I will be fixing the collision and physics modules as well as integrating image transparency when I have time, but for now you can enjoy some higher performance. (Perhaps I could even use buffers to hold triangles?)
Release 3D Engine v2.3 · HeroShiner46/Roblox-3D-Engine (github.com)
New release that makes textures more efficient. This definitely has some horror game potential! (EPILEPSY WARNING)
- I tested it and it seems like you can only move at a direction at a time. Can you make it so you can move diagonally?
- How do you even add images/models to the engine?
- likes
Yes, I can introduce holding down multiple keys. You can also find out how to add models by viewing the wiki page on github: Home · HeroShiner46/Roblox-3D-Engine Wiki (github.com)
If the current instructions are too confusing, I can always update the wiki so that others can also follow.
Basically, get an object file with a single texture that does not exceed 256x256 pixels.
Then, make a ModuleScript inside the Objects folder in the main module of the Engine.
Third, use the structure that is on the wiki and paste the raw .obj file as a string into the area with the double brackets.
Then, make the texture using the CanvasDraw Image Importer plugin and put it into the modulescript.
Finally, set the texture property of the modulescript to the texture that you just put in.
Do you plan on keeping on this method? Or do u plan on integrating CanvasDraw 4.0 at some point to get 1024x1024 textures and the image objects.
I’d personally keep both image objects and texture IDs as options in the engine since using the assetID method yields ur code