|
@@ -43,30 +43,28 @@
|
|
vec4 col2 = texture2D( map, coords.xz * scale);
|
|
vec4 col2 = texture2D( map, coords.xz * scale);
|
|
vec4 col3 = texture2D( map, coords.xy * scale);
|
|
vec4 col3 = texture2D( map, coords.xy * scale);
|
|
|
|
|
|
- col1.xyz = col1.xyz * vec3(2.0) - vec3(1.0);
|
|
|
|
- col2.xyz = col2.xyz * vec3(2.0) - vec3(1.0);
|
|
|
|
- col3.xyz = col3.xyz * vec3(2.0) - vec3(1.0);
|
|
|
|
|
|
+ col1.xyz = col1.xyz * vec3(2.0, NORMAL_TYPE * 2.0, 2.0) - vec3(1.0, NORMAL_TYPE * 1.0, 1.0);
|
|
|
|
+ col2.xyz = col2.xyz * vec3(2.0, NORMAL_TYPE * 2.0, 2.0) - vec3(1.0, NORMAL_TYPE * 1.0, 1.0);
|
|
|
|
+ col3.xyz = col3.xyz * vec3(2.0, NORMAL_TYPE * 2.0, 2.0) - vec3(1.0, NORMAL_TYPE * 1.0, 1.0);
|
|
|
|
|
|
// blend the results of the 3 planar projections.
|
|
// blend the results of the 3 planar projections.
|
|
vec4 tex = normalize(col1 * triBlending.x + col2 * triBlending.y + col3 * triBlending.z);
|
|
vec4 tex = normalize(col1 * triBlending.x + col2 * triBlending.y + col3 * triBlending.z);
|
|
- tex.y *= NORMAL_TYPE;
|
|
|
|
|
|
|
|
return tex;
|
|
return tex;
|
|
}
|
|
}
|
|
|
|
|
|
// triplanar blend for Normal maps in a TextureArray:
|
|
// triplanar blend for Normal maps in a TextureArray:
|
|
vec4 getTriPlanarNormalBlendFromTexArray(in vec3 coords, in int idInTexArray, in float scale, in sampler2DArray texArray) {
|
|
vec4 getTriPlanarNormalBlendFromTexArray(in vec3 coords, in int idInTexArray, in float scale, in sampler2DArray texArray) {
|
|
- vec4 col1 = texture2DArray( texArray, vec3((coords.yz * scale), idInTexArray ) );
|
|
|
|
- vec4 col2 = texture2DArray( texArray, vec3((coords.xz * scale), idInTexArray ) );
|
|
|
|
- vec4 col3 = texture2DArray( texArray, vec3((coords.xy * scale), idInTexArray ) );
|
|
|
|
|
|
+ vec4 col1 = texture2DArray( texArray, vec3((coords.yz * scale), idInTexArray ));
|
|
|
|
+ vec4 col2 = texture2DArray( texArray, vec3((coords.xz * scale), idInTexArray ));
|
|
|
|
+ vec4 col3 = texture2DArray( texArray, vec3((coords.xy * scale), idInTexArray ));
|
|
|
|
|
|
- col1.xyz = col1.xyz * vec3(2.0) - vec3(1.0);
|
|
|
|
- col2.xyz = col2.xyz * vec3(2.0) - vec3(1.0);
|
|
|
|
- col3.xyz = col3.xyz * vec3(2.0) - vec3(1.0);
|
|
|
|
|
|
+ col1.xyz = col1.xyz * vec3(2.0, NORMAL_TYPE * 2.0, 2.0) - vec3(1.0, NORMAL_TYPE * 1.0, 1.0);
|
|
|
|
+ col2.xyz = col2.xyz * vec3(2.0, NORMAL_TYPE * 2.0, 2.0) - vec3(1.0, NORMAL_TYPE * 1.0, 1.0);
|
|
|
|
+ col3.xyz = col3.xyz * vec3(2.0, NORMAL_TYPE * 2.0, 2.0) - vec3(1.0, NORMAL_TYPE * 1.0, 1.0);
|
|
|
|
|
|
// blend the results of the 3 planar projections.
|
|
// blend the results of the 3 planar projections.
|
|
- vec4 tex = normalize(col1 * triBlending.x + col2 * triBlending.y + col3 * triBlending.z);
|
|
|
|
- tex.y *= NORMAL_TYPE;
|
|
|
|
|
|
+ vec4 tex = normalize(col1 * triBlending.x + col2 * triBlending.y + col3 * triBlending.z);
|
|
|
|
|
|
return tex;
|
|
return tex;
|
|
}
|
|
}
|