Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/main/java/rs117/hd/HdPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,7 @@ public ShaderIncludes getShaderIncludes() {
.define("APPLY_COLOR_FILTER", configColorFilter != ColorFilter.NONE)
.define("MATERIAL_COUNT", MaterialManager.MATERIALS.length)
.define("WATER_TYPE_COUNT", waterTypeManager.uboWaterTypes.getCount())
.define("WATER_SUN_REFLECTION", config.waterSunReflection())
.define("DYNAMIC_LIGHTS", configDynamicLights != DynamicLights.NONE)
.define("TILED_LIGHTING", configTiledLighting)
.define("TILED_LIGHTING_LAYER_COUNT", configDynamicLights.getTiledLightingLayers())
Expand Down Expand Up @@ -1814,6 +1815,7 @@ public void processPendingConfigChanges() {
case KEY_PARALLAX_OCCLUSION_MAPPING:
case KEY_UI_SCALING_MODE:
case KEY_VANILLA_COLOR_BANDING:
case KEY_WATER_SUN_REFLECTION:
case KEY_WIND_DISPLACEMENT:
case KEY_CHARACTER_DISPLACEMENT:
case KEY_WIREFRAME:
Expand Down
21 changes: 17 additions & 4 deletions src/main/java/rs117/hd/HdPluginConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -764,12 +764,25 @@ default boolean underwaterCaustics()
return true;
}

String KEY_WATER_SUN_REFLECTION = "waterSunReflection";
@ConfigItem(
keyName = KEY_WATER_SUN_REFLECTION,
name = "Water sun reflection",
description = "Controls the reflective sunlight highlight on water surfaces.",
position = 13,
section = environmentSettings
)
default boolean waterSunReflection()
{
return true;
}

String KEY_WIND_DISPLACEMENT = "windDisplacement";
@ConfigItem(
keyName = KEY_WIND_DISPLACEMENT,
name = "Wind displacement",
description = "Controls whether things like grass and leaves should be affected by wind.",
position = 13,
position = 14,
section = environmentSettings
)
default boolean windDisplacement() {
Expand All @@ -781,7 +794,7 @@ default boolean windDisplacement() {
keyName = KEY_CHARACTER_DISPLACEMENT,
name = "Character displacement",
description = "Let players & NPCs affect things like grass whilst walking around.",
position = 14,
position = 15,
section = environmentSettings
)
default boolean characterDisplacement() {
Expand All @@ -793,7 +806,7 @@ default boolean characterDisplacement() {
keyName = KEY_HIDE_VANILLA_WATER_EFFECTS,
name = "Hide vanilla water ripples",
description = "Hide vanilla ripples found around objects floating in the water.",
position = 15,
position = 16,
section = environmentSettings
)
default boolean hideVanillaWaterEffects() { return true; }
Expand All @@ -803,7 +816,7 @@ default boolean characterDisplacement() {
keyName = KEY_POH_THEME_ENVIRONMENTS,
name = "Player-owned house themes",
description = "Change the environmental lighting based on the POH style.",
position = 16,
position = 17,
section = environmentSettings
)
default boolean pohThemeEnvironments() { return true; }
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/rs117/hd/utils/constants.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#endif

#include VANILLA_COLOR_BANDING
#include WATER_SUN_REFLECTION
#include UNDO_VANILLA_SHADING
#include LEGACY_GREY_COLORS
#include DISABLE_DIRECTIONAL_SHADING
Expand Down
7 changes: 5 additions & 2 deletions src/main/resources/rs117/hd/utils/water.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ vec4 sampleWater(int waterTypeIndex, vec3 viewDir) {
vec3 lightOut = max(lightDotNormals, 0.0) * lightColor;

// directional light specular
vec3 lightReflectDir = reflect(-lightDir, normals);
vec3 lightSpecularOut = lightColor * specular(IN.texBlend, viewDir, lightReflectDir, vSpecularGloss, vSpecularStrength);
vec3 lightSpecularOut = vec3(0);
#if WATER_SUN_REFLECTION
vec3 lightReflectDir = reflect(-lightDir, normals);
lightSpecularOut = lightColor * specular(IN.texBlend, viewDir, lightReflectDir, vSpecularGloss, vSpecularStrength);
#endif

// point lights
vec3 pointLightsOut = vec3(0);
Expand Down