THIS WORK:
surface mixer(float tValues[10] = {0, 0, 0, 0, 0, 0, 0, 0 ,0 ,0};
string textures[10] = {"","","","","","","","","",""};
)
{
float count;
float tVal = 0;
color mix = color(0,0,0);
for (count = 0; count < 10; count=count+1)
{
tVal = tValues[count];
if (tVal > 0)
{
string texturename = textures[count];
mix = mix + color texture(texturename)*tVal;
}
}
Ci = mix;
}
THIS CAUSE SEGMENTATION FAULT
surface mixer(float tValues[10] = {0, 0, 0, 0, 0, 0, 0, 0 ,0 ,0};
string textures[10] = {"","","","","","","","","",""};
)
{
float count;
float tVal = 0;
color mix = color(0,0,0);
for (count = 0; count < 10; count=count+1)
{
tVal = tValues[count];
if (tVal > 0)
{
mix = mix + color texture(textures[count])*tVal;
}
}
Ci = mix;
}
The difference is only that, in first case, we use:
string texturename = textures[count];
and in second case:
mix = mix + color texture(textures[count])*tVal;
Tested in Ubuntu, using aqsis version 1.6.0 (revision 0)
compiled May 22 2010 07:48:28
I couldn't reproduce the crash.
Can you reproduce the issue with the latest version?
Last edit: Alistair Leslie-Hughes 2014-07-11