Since I’m using Roblox to do some of the heavy engine calculations (which lessens overall strain since Luau is still interpreted for now). I’m also able to get away with using roblox functions that can determine if something is being “rendered” (Camera:WorldToScreenPoint()) to ignore it from doing project_points() or any other expensive math calculations (It’s pretty much just scuffed culling).
I was wanting to manipulate CFrames of separate meshes that are in one obj. I was testing this Quake 3 model for an experiment but it would result in this error.
Not sure what’s going on. But after doing a bit of digging I found a few culprits but not a solution:
For whatever reason, it would start in here
If parts[1] and voffset are equal or if voffset is greater, the face_verts table would now have invalid indexes (peep the warnings) therefore causing the problem
TLDR: vertoffsets and texoffsets are causing issues.
Note: This only occurs with LoadGroupFromName and not LoadFromName quakeguy.lua (46.9 KB)
Yeah LoadGroupFromName was kind of experimental when I was creating the engine, and I guess I didn’t really fix it. I realize now how ugly and inefficient my past code was, and I’m now rewriting the whole thing with full obj file support.
Could you give a basic tutorial on how to import .obj models? Last time I tried to do it the textures weren’t mapping correctly. I think there are export settings that need to be set and im not sure what they need to be for your .obj renderer
I am working on support for more features, but for now this is what you need to do:
Get an object file with only one texture (or merge the textures),
Make sure the object file only includes triangle faces,
Make sure all the uvs and stuff are written (this is probably automatic),
Export it, make a new ModuleScript, and paste the object file data into it. Make sure it is a variable called “obj” and it is wrapped in [[]].
Use your CanvasDraw image importer and create the image.
Put it as a child of the ModuleScript and then set a variable called “texture” to it.
I will write this down and make like a Wiki section in Github. It’s just kind of hard to do all of these things at once and make the module user friendly.
Rewrote the entire module with fixes, optimizations, and support for other things. Also, the object works now! (Using missingtexture.png). If you ever have any other issues, please make a post on the issues tab of the repository so it is easier for me.
I don’t know if that update includes this, but you should implement alpha transparency for the textures as CanvasDraw texture sampling includes Alpha values (since we’re working with PNG images)
Oh I forgot about the textures! Yes I can add those easily by changing the color property to include alpha from your canvasdraw module. I use GetPixelFromImageXY, does that also return the color and alpha too?
Edit: This requires a lot more work than I thought. I have to individually now separate every triangle and render the opaque ones before the transparent ones, which will slow down performance (maybe?). I will add this update, but I will try to find a better way to do this.
It will slow down performance a lil bit, but it’ll be worth it for some of your maps you have here.
Also you might wanna just do a boolean check on a transparent pixel rather than doing alpha blends if you wanna keep your framerate up.
Yes and it’s fine to use, but that function is deprecated as ImageData:GetPixelXY is slightly faster and more efficient as it has direct access to the pixel look-up table.
It seems it is impossible for me to use the alpha value on DynamicImage because no matter what it blends with the background from the original image (white). I’ve tried drawing the triangles before others, but it still doesn’t work. This is why I am using alpha blending since it is all I can do. Maybe when DynamicImage comes out and you implement it in CanvasDraw it will work.
Edit: The biggest challenge is sorting the triangles since there are two transparency values for each triangle now. I might have to just make Transparency change the texture’s internal alpha instead.
I’ve been following the whole “Making Roblox Pixelated” quest from the start, and I think it finally is starting to reach its end. You did it. You made Roblox pixelated with astonishing performance compared to any other design. You literally just need DynamicImage, a bunch of updates/fixes, and optionally some documentation. Fantastic work. Pixel Roblox has been a lot harder than it has seemed.
3d engine inside a 3d engine? 3d engineception O_O
i actually have a good use for this so if you want your game to look like its on the playstation 1 then use this and it will make your game look like that