Hi,
I am creating a new Texture2D in code that will have blue-red stripes on. The problem is that the lines are not with constant color, but instead fuzzy:
The texture generation is like this:
if(go.renderer.material.mainTexture==null){
go.renderer.material.mainTexture = t = new Texture2D(textureSideLength,textureSideLength);
}
t = go.renderer.material.GetTexture(“_MainTex”) as Texture2D;
if(cd.blueColorId==0){
for(y=0; y<t.height; y++){
for(x=0; x<t.width; x++){
t.SetPixel(x,y,cd.redColor);
}
}
}
else{
for(y=0; y<t.height; y++){
for(x=0; x<t.width; x++){
if(a){
if(cd.redColorId!=0)
t.SetPixel(x,y,cd.redColor);
else
t.SetPixel(x,y,color);
}
else{
t.SetPixel(x,y,color);
}
c++;
if(c==2){
c=0;
a=!a;
}
}
}
}
t.Apply();
Where textureSideLength is 64. When I UV mapped mesh in blender then I also used 64x64 size image.
Can anybody please tell me how I can make the lines crisp?