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
Add a cloud renderer that uploads geometry to the GPU, rendering much faster than vanilla. #2872
Conversation
Updated to use an enum singleton and have a config entry to disable the feature. Side note, this renderer should work on all hardware that vanilla Minecraft works on, so if you test it and it doesn't work, let me know. |
/* Passes: | ||
0 - Write depth buffer to prevent insides rendering, | ||
1 - Render clouds */ | ||
for (int pass = 0; pass < (WIREFRAME ? 3 : 2); pass++) |
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.
Why in the world is this a for-loop? Just write the case
statements one after the other with an if around the 3rd one. This is just... confusing.
I feel like this should be a separate mod, while Forge should only have the necessary hooks. (Also, target the 1.9.4 branch, please.) |
I'll leave the decision on whether to include it in Forge up to Lex and fry, but I feel that having some of the most extreme render time hogs fixed would be a big benefit. Some people on IRC have noted they always turn the cloud setting to fast because the fancy clouds are too slow, but this makes fast and fancy clouds perform almost exactly the same. It may also be worth noting that this implementation is a bit better than Optifine's, since Optifine just updates a display list every 20 ticks with injected hooks around the vanilla renderer (from what I could tell). Indeed, it hadn't occurred to me to target the 1.9.4 branch. Is 1.9.4 in a state where that would be a good thing to do? |
Absolutely. |
@williewillus added labels [Performance] |
Master is what you should target, it's merged with 1.9.4 now. |
@@ -288,9 +295,10 @@ public static void updateNag() | |||
@SubscribeEvent | |||
public void onConfigChanged(OnConfigChangedEvent event) | |||
{ | |||
if (getMetadata().modId.equals(event.getModID()) && !event.isWorldRunning()) | |||
if (getMetadata().modId.equals(event.getModID()))// && !event.isWorldRunning()) |
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.
This doesn't look like it's left here intentionally
24bf578
to
15e29f8
Compare
Does this actually replace vanilla clouds if enabled? Where does it do that, I must've missed it? |
Whoops, forgot to run genPatches. :| Edit: Gonna take a bit, fresh workspace. |
…ter than vanilla clouds.
Done. :) |
Rebase to 1.10.x @Zaggy1024? Would love to see this in |
I'd rather have confirmation that this type of change is appropriate in Forge before I put more work into it. (I haven't touched modding in quite a while.) |
The main problem is that you havent given any performance statistics or profiler data to justify these changes. |
I'm still of the opinion this should be a separate mod. I do not think a 2016-08-13 0:14 GMT+02:00 LexManos notifications@github.com:
|
^So encourage more community driven ASM usage on high traffic classes? @Zaggy1024 original post says ~0.47% v ~9-11% game render time. That's quite substantial if it can be proven. Try doing what mezz did here in #3093: standardized test scenario, and outcome for standard forge and modified forge. |
@asiekierka your opinion doesn't matter. The only real issue is that we has no hard verification to justify the changes. |
Besides, if we're hooking the cloud renderer anyway, why not let mods provide their own cloud renderers for their own worlds? That way, the optimization itself could be an addon which doesn't use ASM, and mods would benefit as well. I'm sure many would appreciate that, even mods which don't add dimensions like CloudMaster. |
There is actually a hook for custom cloud renderers already, if I remember correctly. It's been a long time since I touched this code, though, so I can't remember why I decided against using that to hook this renderer. |
Yes there is already a sky and cloud renderer, And Asi you're just sitting here pissing me off. Your opinion is not wanted. Shut up. Stop spamming my issue tracker. No need for any more discussion beyond what has been requested of @Zaggy1024, if he can create a test harness that actually validates his claims of performance improvements then we can move on from there. |
In the profiler, this new renderer gets ~0.47% of gameRenderer time when I have a 16 chunk render distance, as opposed to vanilla clouds' ~9-11%.
It may be preferable to make this use WorldProvider.cloudRenderer instead, but I wasn't sure where to register the renderer class from to handle WorldEvent.Load (assuming this is the best way to set cloudRenderer).