@@ -51,8 +51,12 @@ public class PShader implements PConstants {
51
51
52
52
static protected String pointShaderAttrRegexp =
53
53
"attribute *vec2 *offset" ;
54
+ static protected String pointShaderInRegexp =
55
+ "in *vec2 *offset;" ;
54
56
static protected String lineShaderAttrRegexp =
55
57
"attribute *vec4 *direction" ;
58
+ static protected String lineShaderInRegexp =
59
+ "in *vec4 *direction" ;
56
60
static protected String pointShaderDefRegexp =
57
61
"#define *PROCESSING_POINT_SHADER" ;
58
62
static protected String lineShaderDefRegexp =
@@ -1016,15 +1020,8 @@ protected void dispose() {
1016
1020
static protected int getShaderType (String [] source , int defaultType ) {
1017
1021
for (int i = 0 ; i < source .length ; i ++) {
1018
1022
String line = source [i ].trim ();
1019
- if (PApplet .match (line , pointShaderAttrRegexp ) != null )
1020
- return PShader .POINT ;
1021
- else if (PApplet .match (line , lineShaderAttrRegexp ) != null )
1022
- return PShader .LINE ;
1023
- else if (PApplet .match (line , pointShaderDefRegexp ) != null )
1024
- return PShader .POINT ;
1025
- else if (PApplet .match (line , lineShaderDefRegexp ) != null )
1026
- return PShader .LINE ;
1027
- else if (PApplet .match (line , colorShaderDefRegexp ) != null )
1023
+
1024
+ if (PApplet .match (line , colorShaderDefRegexp ) != null )
1028
1025
return PShader .COLOR ;
1029
1026
else if (PApplet .match (line , lightShaderDefRegexp ) != null )
1030
1027
return PShader .LIGHT ;
@@ -1038,6 +1035,18 @@ else if (PApplet.match(line, triShaderAttrRegexp) != null)
1038
1035
return PShader .POLY ;
1039
1036
else if (PApplet .match (line , quadShaderAttrRegexp ) != null )
1040
1037
return PShader .POLY ;
1038
+ else if (PApplet .match (line , pointShaderDefRegexp ) != null )
1039
+ return PShader .POINT ;
1040
+ else if (PApplet .match (line , lineShaderDefRegexp ) != null )
1041
+ return PShader .LINE ;
1042
+ else if (PApplet .match (line , pointShaderAttrRegexp ) != null )
1043
+ return PShader .POINT ;
1044
+ else if (PApplet .match (line , pointShaderInRegexp ) != null )
1045
+ return PShader .POINT ;
1046
+ else if (PApplet .match (line , lineShaderAttrRegexp ) != null )
1047
+ return PShader .LINE ;
1048
+ else if (PApplet .match (line , lineShaderInRegexp ) != null )
1049
+ return PShader .LINE ;
1041
1050
}
1042
1051
return defaultType ;
1043
1052
}
0 commit comments