AnOpenSauceDev / Methane-mod

A 1.19+ performance mod for the Fabric and Quilt modloaders.
MIT License
49 stars 12 forks source link

[Enhancement/Suggestion] When Methane is toggled off, use Starlight's light engine if mod is found #31

Closed R00tB33rMan closed 1 year ago

R00tB33rMan commented 1 year ago

💡 The Idea:

Methane is an incredibly useful full bright tool that ensures users' performance is at its very peak. In order to make this mod more fluid and implementable into larger performance modpacks and so forth, it'd be nice to see side compatibility with Starlight when Methane is deactivated, so you reap the benefits in any instance.

I'm fully aware that this may be incredibly problematic and time consuming, so I do not expect this to be a feasible feature; especially given how many modifications may potentially have to be made.

🤔 How should it be accomplished?

Well, I can't entirely provide a sufficient summary, since you'd have to determine its feasibility; however, I'd assume that instead of it swapping to vanilla when Methane is deactivated, it'd instead swap over to Starlight's engine mode for better performance with base lighting activated.

📝 Anything else.

Nope! That's about it. I have no expectations whatsoever in regards to the integration of this feature; however, it would be incredibly cool to see if it is at all within reason/feasibility.

AnOpenSauceDev commented 1 year ago

While I really like this idea, and it is legally possible (Methane probably should become LGPLv3 anyways), it is a lot of work and probably has no easy answer. I'll see what I can do anyways though.

AnOpenSauceDev commented 1 year ago

after doing some quick testing, the performance seemed to be the same with Methane ON, so I think Methane is working fine with starlight. (vanilla seemed to have starlight-levels of performance) I think my CPU setup is a little overkill though, so it might not be noticeable for me. (and i'm too lazy to grab my slow laptop)

TL:DR: A lot of benchmarking is going to have to be done to find out if Starlight works with Methane.

R00tB33rMan commented 1 year ago

No worries! I appreciate the brief overview/look through. I'm excited to see what may come of this, if it's at all feasible at any given time but I do like to see that you've given this a little whirl.

AnOpenSauceDev commented 1 year ago

Starlight might actually work with methane, as almost no mixin code runs when it's disabled, so in theory it should work with methane off.

Cyclopropinon commented 1 year ago

when it just works when methanes off, what the point having methane aditionally?

AnOpenSauceDev commented 1 year ago

[...] what the point having methane aditionally?

@Cyclopropinon I don't think you understand, Methane only improves performance when the mod is active, and does so by removing the light engine while active. Methane will always be faster than any other lighting engine, but when methane is off, you can use Starlight's optimized engine, instead of the slow (at least for 1.19.4 and lower) mojang lightmapper.

Cyclopropinon commented 1 year ago

yeah ik, but doesnt you mean it will crash with methane on?

Starlight might actually work with methane, as almost no mixin code runs when it's disabled, so in theory it should work with methane off.

or did i understand it wrong

AnOpenSauceDev commented 1 year ago

yeah ik, but doesnt you mean it will crash with methane on?

Starlight might actually work with methane, as almost no mixin code runs when it's disabled, so in theory it should work with methane off.

or did i understand it wrong

basically, when methane is on, ci.cancel(); will prevent any of Starlight's code from running. when methane is OFF, almost nothing runs from Methane itself (minus some fog stuff, which means that starlight should run as usual.

Cyclopropinon commented 1 year ago

ah ok i got it

AnOpenSauceDev commented 1 year ago

issue can be closed because starlight doesn't actually exist anymore