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)
- Create fake shadow using blob shadow projector: Unity tutorial - October 2, 2018
- Using Reflection Probe: Unity Tutorial - October 1, 2018
- Difference Between Material and Shared Material: Unity Tutorial - September 23, 2018