- Home /
Texture looks horrible in Game but ok in Scene
The tiles are ridiculously ugly because i made them only for testing purposes.
Tiles in Game tab:
Tiles in Scene tab:
Why is this happening?
I'm making a 2d game using this tutorial
I made a quad in blender, i'm using exactly the same shader (pure copy / paste) and for UVs i made a custom code:
x_aux = (float)x;// the first pixel of the tile in the x axis
y_aux = (float)y;// same above
texturesize = 512f;// the total size of texture
tile_size = 32f// The size of a single tile
//--------------------------
uvs[0] = new Vector2((x_aux / texturesize), (y_aux / texturesize));
uvs[1] = new Vector2(((x_aux + tile_size) / texturesize), ((y_aux + tile_size) / texturesize));
uvs[2] = new Vector2(((x_aux + tile_size) / texturesize), (y_aux / texturesize));
uvs[3] = new Vector2((x_aux / texturesize), ((y_aux + tile_size) / texturesize));
//--------------------------
my_mesh.uv = uvs;
What could be wrong?
I'm using unity for a few weeks and could be a very noob mistake but i realy don't have a clue of what could be causing the texture seem correct on Scene and in Game completely scratched.
Realy sorry for the english.
Your answer
Follow this Question
Related Questions
Tracing in Unity3D 2 Answers
Shader Texture Change 3 Answers
uv not being passed through from vertex to surface shader 1 Answer
glTexSubImage3D in unity 0 Answers
how to solve shader/texture problem: putting white icons on colored planes 1 Answer