Can I increase the distance the camera's focus affects?

I am making a game where terrain is of great importance, however, after being a bit distant from the camera’s focus, it doesnt render as well the terrain.

image

Are there any ways to prevent this behavior?

1 Like

workspace.CurrentCamera.Focus = workspace.CurrentCamera.CFrame * CFrame.new(0, 0, -10)

Put this into a render stepped loop, and probably increase the number at the end.

What are you aiming to do with this, setting the focus to the character’s position? I am doing that.

This is setting the camera’s focus to be 10 studs infront of the camera. From what I see the camera is too high up, making the terrain not render as well. So if you put the focus more infront, the focus is closer to the terrain making it render better. If that doesnt work then you can increase the number to -20, -50, etc.

Sorry, I just realised I put too little context into the post. This is on a 2D game, so the camera ends up as something around these lines:

I am setting the focus to the character as it is always in the center of the screen and it is on the same Z axis as the terrain.

The camera is already quite closer, the terrain should be rendering the best it can. I’m pretty sure it’s not a problem with focus or camera. The terrain just looks like that normally. You can try to smooth out the terrain if you want.

In that image it is alright, but there are situations that the picture on the original post happens.

To be able to achieve smaller erosion on the terrain, I have scaled up the character. The higher scale of the distances might be the culprit for that glitch happens, but, gameplay wise, I can not afford to make things smaller, so it seemed to me that the only option would be finding a way to change the focus’s effective distance.

When destroying terrain with the tool, you could try to remove more terrain. Not actually make it bigger, but like.

Imagine you are looking through the eyes of the character right now. Now image if the terrain you remove isn’t so thin, but it goes out the sides. Instead of remove cubes of terrain, remove rectangles. Instead of removing a burger (square), remove a sideways hotdog (rectangle). You know what I mean? I know it sounds weird but I don’t know how else to explain it without drawing it out. I say this because it looks like a little bit of the terrain is being left, and that could be because you are removing it like how I said.

1 Like

I understand what you mean, however, I feel that could have effects that are undesirable for balancing purposes and what not. It will be my last resource if there are no other methods I can’t use.

Roblox terrain naturally have LoD systems that, as far as I know, you don’t really have control over. It might be a better idea to make your own terrain system using parts organized into voxels, slopes using marching squares, and optimizations such as greedymeshing.

1 Like

I appreciate the suggestion. It would be an unfortunate thing to go for, but might be the only solution if voxel resolution is not implemented.

I have briefly looked over the techniques you mentioned. I am still a bit lost on how erosion would be implemented, in such a scenario.

You could simply just use raycasts/shapecast to find any intersecting voxels from the projectile. Spatial query could also work.