The ShaderNodes system now correctly handles swizzle of types like ivecn, uvecn, bvecn

experimental
Nehon 11 years ago
parent d5f6058e85
commit e898f26cf4
  1. 4
      jme3-core/src/main/java/com/jme3/shader/ShaderUtils.java

@ -117,7 +117,7 @@ public class ShaderUtils {
card = 0;
}
} else {
card = Integer.parseInt(type.replaceAll("vec", ""));
card = Integer.parseInt(type.replaceAll(".*vec", ""));
if (swizzling.length() > 0) {
if (card >= swizzling.length()) {
@ -138,6 +138,6 @@ public class ShaderUtils {
* @return true if a variable of the given type can have a swizzle
*/
public static boolean isSwizzlable(String type) {
return type.equals("vec4") || type.equals("vec3") || type.equals("vec2") || type.equals("float");
return type.indexOf("vec4")>-1 || type.indexOf("vec3")>-1 || type.indexOf("vec2")>-1 || type.equals("float");
}
}

Loading…
Cancel
Save