Skip to content
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

Shader breaks when activating Normal or Specular Mapping on Iris 1.7.0 and DH 2.0 #126

Closed
pnk2u opened this issue Apr 5, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@pnk2u
Copy link

pnk2u commented Apr 5, 2024

What happened?

Activating Normal or Specular Mapping breaks the shader (Minecraft falls back to Vanilla shaders).
Given the error code and through trial and error, one solution I found was to change these lines in the deferred3.glsl file:

#ifdef DISTANT_HORIZONS
		if (!is_dh_terrain) {
#endif

	#ifdef NORMAL_MAPPING
		normal = decode_unit_vector(gbuffer_data_1.xy);
	#endif

	#ifdef SPECULAR_MAPPING
		bool parallax_shadow;
		vec4 specular_map = vec4(unpack_unorm_2x8(gbuffer_data_1.z), unpack_unorm_2x8(gbuffer_data_1.w));
		decode_specular_map(specular_map, material, parallax_shadow);
	#elif defined NORMAL_MAPPING
		bool parallax_shadow = gbuffer_data_1.z >= 0.5;
	#endif
#ifdef DISTANT_HORIZONS
		}
#endif

to

//  #ifdef DISTANT_HORIZONS
			

	#ifdef NORMAL_MAPPING
		 if (!is_dh_terrain) {
		normal = decode_unit_vector(gbuffer_data_1.xy);
		 }
	#endif

	#ifdef SPECULAR_MAPPING
		bool parallax_shadow;
		if (!is_dh_terrain) {
		vec4 specular_map = vec4(unpack_unorm_2x8(gbuffer_data_1.z), unpack_unorm_2x8(gbuffer_data_1.w));
		decode_specular_map(specular_map, material, parallax_shadow);
		}
		
	#elif defined NORMAL_MAPPING
		if (!is_dh_terrain) {
		bool parallax_shadow = gbuffer_data_1.z >= 0.5;
		}
	#endif
	
//  #endif

which leads to the both Normal and Specular Maps and seperately the DH chunks to render as expected and the shader to not break, effectively fixing the issue.

Minecraft Version

Other

Which shader mod are you using?

Iris

Shader mod version

1.7.0

Shader settings

shadowDistance=128.0
COLORED_LIGHTS=true
BLOCKLIGHT_G=0.69
PIXELATED_SHADOWS=true
SNELLS_WINDOW=true
POM_DEPTH=0.15
WATER_WAVE_ITERATIONS=7
WATER_WAVE_LACUNARITY=1.23
DIRECTIONAL_LIGHTMAPS_INTENSITY=0.45
WATER_CAUSTICS=true
WATER_WAVE_FREQUENCY=0.78
WATER_REFRACTION_INTENSITY=1.01
BOX_MODE=BOX_MODE_COLOR
SPECULAR_MAPPING=true
WATER_ABSORPTION_B_UNDERWATER=0.01
WATER_WAVE_PERSISTENCE=0.71
WATER_ABSORPTION_G_UNDERWATER=0.04
WATER_WAVE_STRENGTH=0.63
WATER_ABSORPTION_R=0.26
WATER_SCATTERING_UNDERWATER=0.02
BLOCKLIGHT_B=0.81
WATER_ABSORPTION_R_UNDERWATER=0.14
BOX_LINE_WIDTH=3.0
WATER_WAVE_SPEED_STILL=0.77
POM_SAMPLES=70
POM_SHADOW=true
POM_SHADOW_SAMPLES=60
BOX_EMISSION=0.36
HANDHELD_LIGHTING=true
SH_SKYLIGHT=true
NORMAL_MAPPING=true
BLOCK_ENTITY_SHADOWS=true
MOON_B=0.95
BOX_COLOR_B=0.42
WATER_ABSORPTION_B=0.19
MOON_G=0.91
BOX_COLOR_G=0.01
WATER_ABSORPTION_G=0.22
POM=true
WATER_SCATTERING=0.05
SHADING_STRENGTH=2.00
shadowMapResolution=1024
PIXELATED_SHADOWS_RESOLUTION=128
DIRECTIONAL_LIGHTMAPS=true
MOON_R=0.68
CLOUD_SHADOWS=true
WATER_WAVE_SPEED_FLOWING=0.90

Relevant log output

deferred3.fsh: deferred3.fsh: 0(1685) : error C1503: undefined variable "parallax_shadow"
@pnk2u pnk2u added the bug Something isn't working label Apr 5, 2024
@sixthsurge
Copy link
Owner

fixed in dev branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants