Sprite and texture, they both are used to display images in the unity applications. This article explains difference between texture and sprite in unity.
Texture are bitmap images that is used to display the appearance of any object. Textures are applied on the mesh geometry of a 3D model or any primitive shapes (like cube or quad) to display its outer look.
In unity, textures are applied to a mesh surface using materials and shaders.
Example: Change appearance of a primitive cube game object using texture image.
You can see texture of a game object in the shader of a material in the mesh renderer component.
Sprites are 2D graphic objects which uses textures within it. It is used to display images in unity applications. Sprite is like a game object of having flat mesh on which textures are applied. You can create, modify and delete sprite in editor mode or at run time, just like any other game objects.
Sprites are rendered using sprite renderer component rather than mesh renderer component used to load 3D objects.
You can convert texture to a sprite in editor and also at the runtime. Please refer my article Load Image at runtime for more details.
Hope you get an idea about difference between texture and sprite in unity application. Post your comments for feedback and query. Thanks for reading.
Latest posts by Gyanendu Shekhar (see all)
- Difference between Update, FixedUpdate and LateUpdate: Unity Tutorial - July 15, 2018
- Difference between Texture and Sprite in Unity - April 14, 2018
- Create and play animation at runtime: Unity Tutorial - March 18, 2018