TWO ways to scroll the background:
TWO ways to scroll the background:
Script (CPU)
Script (CPU)
Shader (GPU)
Shader (GPU)
This is a more traditional method.
This is a more traditional method.
It requires us to write a script to continuously update
It requires us to write a script to continuously update
and reset the position of the tiles on the screen.
and reset the position of the tiles on the screen.
The work is done by the CPU and so could impact the performance.
The work is done by the CPU and so could impact the performance.
This is an alternative method
This is an alternative method
It requires us to write a shader script
It requires us to write a shader script
to continuously update the position of the tiles over time.
to continuously update the position of the tiles over time.
The work is done by the GPU and is faster as the GPU processes in parallel.
The work is done by the GPU and is faster as the GPU processes in parallel.