[Feature] Config options to disable features when shaders are enabled
zndrmn opened this issue · 8 comments
Is your feature request related to a problem? Please describe.
Some shaderpacks add their own handheld lighting which is usually colored. With LambDynamicLights, the colors get overridden by LambDynamicLights which causes the shaderpack to use its default light color (ontop of the original). This will make it so that redstone torches don't glow red for example.
Describe the solution you'd like
Making it so that you can disable some features like handheld lighting or dynamic entity lighting when shaders are detected/enabled would be great! I think it would be important for the user to be able to choose what can and cannot be disabled since some shaderpacks can vary in terms of the features they have, like having dynamic handheld lighting or dynamic entity lighting.
Describe alternatives you've considered
Disabling the whole mod while using shaders. But this can get quite annoying when switching between using shaders and disabling them frequently.
Yeah I know, I was wondering if those setting could disable itself automatically when shaders are enabled
@LambdAurora Hi, i think this feature will be good if you can add it, automatically disable "first-hand" when people turn on the shader, really hope you can add this.
Was here to request/recommend specifically the same thing, I hope it gets added!
Please add this feature! Just automatically switch off first person when shaders are enabled. This is a must have feature for everyone who likes to play with both.
Dear Aurora,
Would you be so kind to reconsider our request? LDL is one of the best MODs out there and an essential part of every good modpack. Also checked with Space at Complementary/Euhoria Patches, even their recommendation is to use LDL for everything except the first person lighting, that is smother and faster if handled by the shader. But LDL is still an essential addition, my kids LOVE how a shot fire arrow lights up the environment while flying. You can just create a switch called "Turn off first person lighting if shader is enabled". This can be off by default, so nobody realizes any changes. If somebade wants this functionality, it can be turned on, so with only one button press we can swtich between no shader + first person lighint in LDL to shader + first person lighting in shader.
import com.iris.shaders.ShaderPack;
import com.iris.shaders.ShaderPackManager;
import com.iris.shaders.ShaderRegistry;
import com.iris.shaders.ShaderPack.ShaderPackProvider; // Added for type casting
public class ShaderDetection {
public static boolean isShaderActive() {
// Check if a ShaderPack is currently loaded and active
ShaderPack activeShaderPack = ShaderRegistry.getCurrentShaderPack();
if (activeShaderPack != null) {
// A shader pack is active if the method returns a non-null value
return true;
} else {
// No shader pack is active
return false;
}
}
public static void main(String[] args) {
// This is a placeholder for where you would typically access Iris's API within your mod.
// In a real mod, you would get these objects from the game context.
// Example of how to use the method (requires Iris API setup):
// if (isShaderActive()) {
// System.out.println("A shader is currently running.");
// } else {
// System.out.println("No shader is currently running.");
// }
}
}
Added a keybind to toggle the first person dynamic lighting.
In combination with some other mods (or in Vanilla on 1.21.9), such key can be bound to the same key as Iris' shader toggle.
This solution has been chosen instead of an automatic switch due to the unreliability of detection of whether the enabled shader pack contains dynamic lighting or not.
