lambda-client / lambda

Minecraft utility mod coded in Kotlin
GNU Lesser General Public License v3.0
581 stars 145 forks source link

Optifine shaders compatibility #70

Open omninope opened 3 years ago

omninope commented 3 years ago

Is your feature request related to a problem? Please describe. Using optifine shaders with Lambda's rendering modules causes a lot of problems, in general they stop rendering or render very buggy.

Describe the solution you'd like Compatibility with Optifine shaders, so the user can have nice(r) graphics while still being able to see where things are.

Describe alternatives you've considered Other mods?

Additional context This is a very useful and extremelly important cosmetic feature for anyone that likes to use shaders. I know it sounds a little too much work for little reward but if you play with it you don't want to stop.

An example just because yes: 2021-05-04_01 03 25

Natan515 commented 3 years ago

The new label doesn't fit

omninope commented 3 years ago

Well, in my mind it's a new feature, since Optifine shaders compatibility currently doesn't exist, that is why I used new, but feel free to change to whatever you think fits it best, the important part is the issue itself anyways :)

Natan515 commented 3 years ago

I don't have this permission (:

Avanatiker commented 3 years ago

Thanks for reporting your issue. We will try to do so. Did u try multiple shader? and also what shader are you using?

omninope commented 3 years ago

The shaders tested where BSL, SEUS, SEUS PTGI, Sidurs, MrMeeps and probably others I forgot, but is all honesty I think every single shader in the world will break the rendering. You can actually make literally EVERYTHING compatible by making your render3D event or whatever it's called using a mixin onEntityRenderer injecting at @Inject(method = "renderWorldPass", at = @At(value = "INVOKE", target = "net/minecraft/client/renderer/GlStateManager.clear(I)V", ordinal = 1, shift = At.Shift.AFTER)). Now, why I didn't just open a pr to do that? Well I'm lazy for one, don't know kotlin only java, and i took that from Future so it's kind of a "skid".

czho commented 3 years ago

Mixins are only in java lol

Luna5ama commented 3 years ago

The shaders tested where BSL, SEUS, SEUS PTGI, Sidurs, MrMeeps and probably others I forgot, but is all honesty I think every single shader in the world will break the rendering. You can actually make literally EVERYTHING compatible by making your render3D event or whatever it's called using a mixin onEntityRenderer injecting at @Inject(method = "renderWorldPass", at = @At(value = "INVOKE", target = "net/minecraft/client/renderer/GlStateManager.clear(I)V", ordinal = 1, shift = At.Shift.AFTER)). Now, why I didn't just open a pr to do that? Well I'm lazy for one, don't know kotlin only java, and i took that from Future so it's kind of a "skid".

GlStateManager.clear(256); will clears the depth buffer and breaks the through wall rendering, making everything renders through wall.

omninope commented 3 years ago

Mixins are only in java lol

Yes, I know, but the entire event system isn't, and I would need to know how the event system works so I can post an rendering event in the mixin, remove where it is right now and test everything.

GlStateManager.clear(256); will clears the depth buffer and breaks the through wall rendering, making everything renders through wall.

Sorry but I was unable to understand your comment. Do you mean injecting where I said breaks rendering (everything render trough walls)?. The image I posted when opening the issue is exactly what I described and I didn't encounter this problem.

Luna5ama commented 3 years ago

Mixins are only in java lol

Yes, I know, but the entire event system isn't, and I would need to know how the event system works so I can post an rendering event in the mixin, remove where it is right now and test everything.

GlStateManager.clear(256); will clears the depth buffer and breaks the through wall rendering, making everything renders through wall.

Sorry but I was unable to understand your comment. Do you mean injecting where I said breaks rendering (everything render trough walls)?. The image I posted when opening the issue is exactly what I described and I didn't encounter this problem.

GlStateManager.clear(256); 256 is the gl depth buffer bit. Depth(z) is the value being used to calculate an object is on the front (cover everything else) or on the back (being covered by others). Some module like Breadcrumbs, SelectionHighlight have setting to not render through walls. And those were relied on the depth buffer. So moving the 3d render event after clearing the depth buffer will break those and cause them to render through wall even the setting is off. Not really big deal but still an issue.

The bigger problem is the shader esp doesn't seem to work correctly after that.

omninope commented 3 years ago

Oh, ok I understand now, thanks for explaining.

ASOwnerYT commented 2 years ago

I can confirm there are issues with Optifine shaders on Lambda client. The client freezes forever when I try to apply a shader while in-game, and if I enable a shader and then join a game, it just shows a black screen with the Lambda Client GUI. This issue seems to be in both the latest release and the latest source code.