Revision 36d65d88
Added by Leszek Koltunski almost 4 years ago
src/main/java/org/distorted/library/program/DistortedProgram.java | ||
---|---|---|
185 | 185 |
|
186 | 186 |
if( subline.startsWith(mAttributeStr)) |
187 | 187 |
{ |
188 |
//android.util.Log.e("program", "GOOD LINE: " +subline+" subLen="+subLen); |
|
189 |
|
|
190 | 188 |
for(nameBegin=subLen-1; nameBegin>mAttributeLen-2; nameBegin--) |
191 | 189 |
{ |
192 | 190 |
currChar=subline.charAt(nameBegin); |
... | ... | |
209 | 207 |
{ |
210 | 208 |
String attribute, attrList="", uniform; |
211 | 209 |
String[] lines = shader.split("\n"); |
212 |
int length = lines.length; |
|
213 | 210 |
|
214 |
for(int i=0; i<length; i++)
|
|
211 |
for (String line : lines)
|
|
215 | 212 |
{ |
216 |
if( doAttributes )
|
|
213 |
if (doAttributes)
|
|
217 | 214 |
{ |
218 |
attribute = parseOutAttribute(lines[i]);
|
|
215 |
attribute = parseOutAttribute(line); |
|
219 | 216 |
|
220 |
if( attribute!=null )
|
|
217 |
if (attribute != null)
|
|
221 | 218 |
{ |
222 |
//android.util.Log.d("program", "new attribute: "+attribute); |
|
223 |
if( attrList.length()>0 ) attrList+=" "; |
|
219 |
if (attrList.length() > 0) attrList += " "; |
|
224 | 220 |
attrList += attribute; |
225 | 221 |
} |
226 | 222 |
} |
227 | 223 |
|
228 |
uniform = parseOutUniform(lines[i]);
|
|
224 |
uniform = parseOutUniform(line); |
|
229 | 225 |
|
230 |
if( uniform!=null )
|
|
226 |
if (uniform != null)
|
|
231 | 227 |
{ |
232 |
//android.util.Log.d("program", "new uniform: "+uniform); |
|
233 |
if( mUniList.length()>0 ) mUniList+=" "; |
|
228 |
if (mUniList.length() > 0) mUniList += " "; |
|
234 | 229 |
mUniList += uniform; |
235 | 230 |
} |
236 | 231 |
} |
... | ... | |
323 | 318 |
{ |
324 | 319 |
String begin = code.substring(0,place-1); |
325 | 320 |
String end = code.substring(place+length); |
326 |
/* |
|
327 |
int len = begin.length(); |
|
328 | 321 |
|
329 |
android.util.Log.d("Program", begin.substring(len-40)); |
|
330 |
android.util.Log.d("Program", effects); |
|
331 |
android.util.Log.d("Program", end.substring(0,40)); |
|
332 |
*/ |
|
333 | 322 |
return begin + effects + end; |
334 | 323 |
} |
335 | 324 |
else |
Also available in: Unified diff
Progress making it possible to apply Vertex Effects only to some Components of a Mesh.