Fixed an issue with the ShaderNodeGenerator that was missing some variable names in cases like that ',myVar,myVar.x'

This commit is contained in:
Nehon 2015-02-10 22:41:23 +01:00
parent 2066c98dd0
commit 0ebb3acb16
2 changed files with 1 additions and 2 deletions

View File

@ -517,7 +517,7 @@ public class Glsl100ShaderGenerator extends ShaderGenerator {
* @return the modified source code
*/
protected String replace(String nodeSource, ShaderNodeVariable var, String newName) {
nodeSource = nodeSource.replaceAll("(\\W)" + var.getName() + "(\\W)", "$1" + newName + "$2");
nodeSource = nodeSource.replaceAll("(?<=\\W)" + var.getName() + "(?=\\W)", newName);
return nodeSource;
}

View File

@ -71,7 +71,6 @@ public abstract class ShaderGenerator {
/**
* Generate vertex and fragment shaders for the given technique
*
* @param technique the technique to use to generate the shaders
* @return a Shader program
*/
public Shader generateShader() {