Scripting RenderFidelity

I am making a settings system for a game which includes graphics, and i wanted to script the RenderFidelity on the client, so that low graphics can render all mesh parts and unions in performance mode no matter how far the cameras distance for an extra performance boost. However, when I attempt to script this, a following error occurs.

"The current thread cannot write 'RenderFidelity' (lacking capability Plugin)"

I’m not sure what this means, and I don’t see the point in having this Enum if i cannot make a simple graphics setting for a game. All I know is that RenderFidelity is used for LOD, and is changed depending on the cameras distance.

image

“RenderFidelity” is only accessible through plugins and the command bar. It cannot be changed through a script.

1 Like

So there is no possible way of doing this feature? Atp Roblox is just missing out on a simple performance optimisation for potato mode devices.

1 Like

you can do that using InsertService:CreateMeshPartAsync() and then doing :ApplyMesh on other mesh objects

I don’t think that is really optimal, calling it on every mesh part in the game.

no.
You can create one meshpart and then applying it to other meshparts and also there no other way of doing so.
You have to recompute entire mesh to do this operation “other way” so roblox did a pretty good solution with that.

local lowRes = InsertService:CreateMeshPartAsync()

meshPartHere:ApplyMesh(lowRes)

I would actually advise trying to modify the RenderFidelity property altogether, I don’t think the effort of setting certain meshes to performance at runtime really will do much of a difference. Setting it to Automatic is a lot less hassle, and if your meshes are not that complex it shouldn’t be too much of an issue.

I want to use realistic meshes by default so high end devices can have graphics, but at the same time allowing users who have low end devices to still play, hence why I’m trying to set RenderFidelity to performance at runtime. I’m trying to maximise my game’s audience.

1 Like

In that case I don’t think there will be a better answer other than manually setting each Mesh to a lower quality like Yarik suggested. You could also keep a copy of a different RenderFidelity model in ReplicatedStorage to maybe reduce some asset loading time and replace each Mesh with that one, but that personally seems like a lot of hassle. There wont be “an easy way” and if you are experiencing lag on phone I would instead try to tweak the streaming distance and try to lower the trig count on meshes by importing them on Blender and trying to optimize them, but then we get into the topic of optimizing meshes and thats a whole other topic! (MeshPart Usage, Performance & Optimizations)

1 Like