Skip to content
This repository has been archived by the owner on Apr 5, 2023. It is now read-only.

Expected render speed? Voxel selection? #26

Open
davideps opened this issue Jun 4, 2020 · 2 comments
Open

Expected render speed? Voxel selection? #26

davideps opened this issue Jun 4, 2020 · 2 comments
Labels
area/performance area/ui type/question Further information is requested

Comments

@davideps
Copy link

davideps commented Jun 4, 2020

This project looks really interesting. Thank you for sharing it! I have two questions:

My computer includes a NVIDIA GeoForce GTX 1070, but I'm seeing one frame per second performance. Are there any settings that might improve performance?

Is there any way to select a voxel or the containing object (pile of voxels / mountain) ?

@jameshiew
Copy link
Owner

jameshiew commented Jun 15, 2020

Hey, thanks for taking an interest in this project!

My computer includes a NVIDIA GeoForce GTX 1070, but I'm seeing one frame per second performance. Are there any settings that might improve performance?

Unfortunately there probably isn't much you can do without making significant changes to the code. You can try lowering the render distance in default.rs (though it is already at 2 chunks...), you could also switch to a type of world generation that doesn't generate as many blocks (see https://github.com/jameshiew/ave/blob/master/src/world.rs#L181 and worldgen.rs). I haven't profiled but I'm fairly certain that a main reason for the slow rendering is that there is a draw call to the GPU per every visible block, rather than per visible chunk. The offending for-loop is about

for (position, block_type) in game
.world
.at(game.camera.position, default::RENDER_DISTANCE_U8)
{
nearby_blocks_count += 1;
if game.camera.can_see(position) {
blocks_rendered_count += 1;
let vertices =
block::make_cube(display, &position, block_type.color, block::Mask::new());
target
.draw(
&vertices,
self.indices,
&self.program,
&uniform,
&self.draw_params,
)
.unwrap()
}
}

Is there any way to select a voxel or the containing object (pile of voxels / mountain) ?

There is no way currently and I probably won't work on this project any more (though may accept PRs), as I've started work on another (currently closed source) voxel engine in Rust.

I'd recommend looking at https://github.com/Technici4n/voxel-rs if you are interested in voxel game programming with Rust - it is much more featureful and performs well because it is economical with how it interacts with the GPU, amongst other things.

@jameshiew jameshiew added type/question Further information is requested area/performance area/ui labels Jun 15, 2020
@davideps
Copy link
Author

davideps commented Jun 16, 2020 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/performance area/ui type/question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants