@@ -100,12 +100,10 @@ vec4 get_material(vec2 uv, vec4 index, vec2 uv_center, float weight, inout float
100100 float rand = r * texture_uv_rotation_array[int (material)];
101101 vec2 rot = vec2 (cos (rand), sin (rand));
102102 vec2 matUV = rotate(uv, rot.x, rot.y) * texture_uv_scale_array[int (material)];
103- vec2 ddx = dFdx (matUV);
104- vec2 ddy = dFdy (matUV);
105103
106- vec4 albedo = textureGrad (texture_array_albedo, vec3 (matUV, material), ddx, ddy );
104+ vec4 albedo = texture (texture_array_albedo, vec3 (matUV, material));
107105 albedo.rgb *= texture_color_array[int (material)].rgb;
108- vec4 normal = textureGrad (texture_array_normal, vec3 (matUV, material), ddx, ddy );
106+ vec4 normal = texture (texture_array_normal, vec3 (matUV, material));
109107 vec3 n = unpack_normal(normal);
110108 normal.xz = rotate(n.xz, rot.x, - rot.y);
111109
@@ -114,11 +112,9 @@ vec4 get_material(vec2 uv, vec4 index, vec2 uv_center, float weight, inout float
114112 float rand2 = r * texture_uv_rotation_array[int (materialOverlay)];
115113 vec2 rot2 = vec2 (cos (rand2), sin (rand2));
116114 vec2 matUV2 = rotate(uv, rot2.x, rot2.y) * texture_uv_scale_array[int (materialOverlay)];
117- ddx = dFdx (matUV2);
118- ddy = dFdy (matUV2);
119- vec4 albedo2 = textureGrad(texture_array_albedo, vec3 (matUV2, materialOverlay), ddx, ddy);
115+ vec4 albedo2 = texture(texture_array_albedo, vec3 (matUV2, materialOverlay));
120116 albedo2.rgb *= texture_color_array[int (materialOverlay)].rgb;
121- vec4 normal2 = textureGrad (texture_array_normal, vec3 (matUV2, materialOverlay), ddx, ddy );
117+ vec4 normal2 = texture (texture_array_normal, vec3 (matUV2, materialOverlay));
122118 n = unpack_normal(normal2);
123119 normal2.xz = rotate(n.xz, rot2.x, - rot2.y);
124120
0 commit comments