Random things about rendering, and Vector3

On Roblox, rendering is one of the most important things, it allows parts to actually be seen visually, and it is very cool. This is why I’m sharing some cool things I’ve noticed about rendering, and collisions.

Wireframe Rendering

Images


Talking

Wireframe Rendering is a setting which shows you what is currently rendering, for example, if you turn it on, and position your camera behind a wall, everything behind the wall will be hidden, causing it to not show up in wireframe rendering.

Wireframe rendering makes everything look transparent, with some lines so you can still see there is an object there.

If it is a mesh, then it will show the vertices, so if the mesh barely changes when you turn on wireframe rendering, that is a problem and you need to optimize that mesh.

You can put your camera very high up and look down at the map, the things that look the most normal could potentially be a problem, in my case it is the desert biome in my game.

Scripting

Scripts
--bad script
local zero = Vector3.new(0,0,0)

workspace.Part.Position = zero
--good script
local zero = Vector3.zero()

workspace.Part.Position = zero
Explaining

Vector3.zero() should be used rather than Vector3.new(0,0,0), here is why:
Vector3.zero() is already pre-programmed into Roblox, while Vector3.new(0,0,0) creates a new position right there, so Vector3.zero() should be used if it is constantly using Vector3.new(0,0,0) a lot.

Also, Vector3.zero() is shorter, which may optimize scripts just slightly, not anything noticeable though.

Vector3.zero is not a function, it is the constant itself.

Name length does not change how fast code runs. If you want to talk about performance micro-optimization, you can consider the vector type and library.

4 Likes

“The only man who never makes a mistake is the man who never does anything.”

1 Like