-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Experimental] Drop fast faces #6903
Conversation
Note: as a side effect, this fixes #6777 . |
src/content_mapblock.cpp
Outdated
void MapblockMeshGenerator::drawSolidNode() | ||
{ | ||
bool faces[6] = {0, 0, 0, 0, 0, 0}; | ||
static const v3s16 tile_dirs[6] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for this you already have this in directiontables.h if i'm correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sadly no, the order is different, and it is important here.
Upon initial testing, FPS seems to be a bit higher, but movement is significantly more choppy, dtime jitter tends to skyrocket, and there are significant visual artifacts. OS: Linux Mint 18.3 x86 Edit: I received the same results on my main device (minus the significant choppiness), that one being: OS: Linux Mint 18.3 x64 |
Why drop 'fast faces' if that seems to be an optimisation? |
@paramat Depends on how fast these faces actually are. If they are significantly faster than this simple solution, it doesn’t worth that. |
@Fixer-007 Only 15%? I was afraid it would rather double CPU usage. Nevertheless, I added several optimizations, it should be significantly faster now. Note: I just realized it computes lighting wrongly. Fixing that is possible but is non-trivial. |
What's the benefit and what PRs are relying on this? |
No PRs currently rely on this. |
That's according to Process Explorer figures. CPU cycles are good as benchmark, right? I don't use profilers or other fancy stuff. |
So. Much. Simpler. :) I definitely like that part of it. |
I see a measurable drop in FPS. Without the patch FPS is capped at 60 (have not tried with a higher limit), with the patch it hovers around 49. If that's typical we should keep fast faces. |
@lhofhansl The reason for lower FPS may be lack of tiling, as the mesh my PR produce should be identical otherwise, and meshgen time shouldn’t affect FPS much. On my GPU, that does not affect FPS at all, vertex shaders take way less time than fragment ones. On your GPU the situation seems to be different. |
@numberZero Yeah, vanilla MTG. This was a "scene" with water, some islands, and some mountains visible. |
@numberZero I'm looking at this one again, as fast faces prevent many vertex shader effects, since you get lines between long faces. |
No-no, draw call number is not affected. Vertex number would be higher, sometimes (on plains) significantly. |
I see, not reducing the number of meshes, just the (average) count of vertices per mesh. I'm going to try this again. The patch obviously does not apply anymore. I assume you did not keep a current version... (Had to ask, just in case.) Tiling is already turned off for water (when waves are enabled). |
@lhofhansl to test rendering performance, just forcing |
@numberZero I did that already :) I see the extra vertices rendered (F6 shows 8.8m instead of 6.9m), but FPS stays the same (31 FPS). This is a new laptop, so not sure whether that is typical. I'll play with it some more. |
Minetest is probably limited by drawcalls and not rendering itself on any more-or-less modern discrete GPU (except of maybe some nVidia® cards under nouveau which just can’t get them off the power-saving mode), and the former is mostly unaffected by fast-faces. But there are also integrated GPUs... |
And here I am looking at this again. This time for large view_ranges, where the fastface (getTileInfo) is the CPU hog. |
@Fixer-007 @paramat Can you test performance, please? This mostly affects CPU, and only solid and liquid nodes.
I plan to base several features on this part, but if it affects performance significantly I will have to rethink my decision.