A 3D Engine in Roblox

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.

@HeroShiner46
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

oh lol. i was new to game development and overall i always felt i was doing something wrong.

1 Like

ah, yeah iā€™m the opposite. Iā€™ve been making rendering engines on roblox like these since late 2021

1 Like

Amazing! How were you able to get EditableImage to work? Is it on the current channel now?

I think I used the previous version of the Studio Mod Manager, which has the LIVE channel, and seems to work fine for me. I had problems with latest version

we could make a pixelated games with this one cuz u know roblox doesnā€™t have much properties to change like distortion like in old tv like the top edge is bend if u know what i mean and much more even making it looks like low quality like changing the pixels

2 Likes