A 3D Engine in Roblox

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.

1 Like

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.

2 Likes

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

1 Like

You should add some settings and an option to disable the perspective correction on the texture mapping for ps1-like fun

It would probably be good to use the method described here for optimization while using this 3D engine. :slightly_smiling_face: Creating the most optimized Roblox game- runs at 6000+ FPS!

1 Like

Yeah this would probably like make it 20% faster since there is no other rendering and stuff. The reason it is not running at its best is because I don’t know how to optimize the triangle processing like clipping and stuff more.

Not sure if this is a bug for just me but it seems that DynamicImage isn’t working for me. I am on the correct channel and everything and there are no errors. Because of this I cannot update the module until I find a way to fix this bug.

Edit: It seems roblox has removed access to beta channels, so we’ll just have to wait for DynamicImage to come out I guess!

That’s what happens when you mod an unreleased thing into a game, stuff will break.
I am gonna assume you also have the FFlag enabled, so that probably isn’t the cause of the issue.

switch to zIntegration channel, it got removed from LIVE again. also check beta features and try enabling it in there.

1 Like

Wait, what?

Reading “Roblox 3D Engine” is super funny lol

Great work :^)

2 Likes

Well DynamicImage got removed completely DynamicImage - Roblox API Reference
read it you will find that it was removed in version 601
R.I.P DynamicImage
but don’t worry kids Roblox replaced it with EditableImage EditableImage - Roblox API Reference
although i prefered the DynamicImage Name.

2 Likes

Seems like nothing changed, just a name change. I feel like the engine doesn’t allow for classes to change their names, so that’s why they remove the instance and add a new instance with all the behaviors from the removed instance. Could be a theory.

@AsyncHero
I figured out how to change the FFlags, and i’ve been messing around with EditableImage my self and I am now working on CanvasDraw 4.0!

Look at this 320x320 beauty on my raycaster engine.

20 FPS is not bad at all on my mid-range laptop while recording.

I bet I could make it even faster.

12 Likes

Nice! also if you are using EditableImage with looping that is going to affect performance

yes im aware, but I have to anyways. It’s a game engine. Updates every heartbeat

If it was like a paint program, i could easily get maximum performance with a really high res

Blockquote
yes im aware, but I have to anyways. It’s a game engine.

i am not sure how you do it but when i was experminting with RayMarching i found that doing

EditableImage:WritePixels(Vector2.zero,Vector2.new(128,128),ImagePixels)

is much faster and doesn’t cause lag spike

that’s what i’ve been using anyways. If i did that per pixel my game engine definately wont run at 320x320 at 20 fps lol.

I use that method wrapped in :Render() function in my module.

function Canvas:Render()
	EditableImage:WritePixels(Origin, Resolution, Grid)
end

and the :SetPixel stuff is separate from the loops

function Canvas:SetRGB(X, Y, R, G, B)
	local Index = GetGridIndex(X, Y)
	Grid[Index] = R
	Grid[Index + 1] = G
	Grid[Index + 2] = B
end
	
function Canvas:SetAlpha(X, Y, Alpha)
	Grid[GetGridIndex(X, Y) + 3] = Alpha
end

Oh i though you were doing something like:

local index = 0
for x = 0,128 do
  for y = 0,128 do
   index += 1
   EditableImage:WritePixels(Vector2.new(x,y),Vector2.one,{pixelArray[index],pixelArray[index],pixelArray[index],1}   
end
end

As that what i was doing when i first started playing around with DynamicImage

oh god no lmao. I instantly knew I had to treat :WritePixels as like a DrawBuffer/final render method

1 Like