Join Jesse Freeman for an in-depth discussion in this video Pixel Vision 8, part of Unity 5 2D: Texture Rendering.
- [Instructor] Before we begin learning about using Texture2Ds in Unity, I wanted to take a moment to talk about how I use it in my own projects. (uplifting 8-bit music) This is Pixel Vision 8's Game Creator. It's a full development environment for authoring 8-bit games built entirely in Unity. While it may look like a normal Unity project on the outside, all of the graphics you see are created by writing pixel data directly to a single Texture2D on the display.
This technique is called blitting and it was very popular with older game consoles, which Pixel Vision 8 simulates. While blitting is no longer used in modern games, it is an important technique to understand, especially when you want to change the way a texture renders at runtime. For example if we load up this Tilemap demo, you'll be able to see how the individual sprite data is rendered to the display just like the original Game Boy did.
This data is stored as color lookup tables and converted into Unity color data at runtime. Everything you see here is being rendered by compositing individual pixel data to the display, giving us the impression of a single screen rendering the entire game. The Game Creator is built on top of the open-source Pixel Vision SDK framework and is written entirely in C#. After you learn how Texture2Ds work in Unity, you can explore Pixel Vision 8 source code and see how this technique is applied to a commercial product.
The Game Creator is available on itch.io.
- Accessing Texture2D pixel data
- Using raw images
- Reading color data
- Detecting the position of a mouse
- Creating textures
- Drawing and erasing pixels