A downloadable asset pack

This is a canvas item shader for the Godot game engine that renders a starfield with simulated parallax scrolling. It can be configured to scroll the stars horizontally or vertically. See the comments in the shader for more details.

I used it in my games Beam and NeonBlast!

The shader is released under the MIT licence and so may be freely used in your projects.

It has been written in Godot's shader language which is similar to GLSL ES 3.0 and so it can probably be easily adapted to work in other game engines.

15-7-2023: Updated to version 5, adding code for rendering the stars using textures.

9-7-2023: Updated to version 4. Slight changes which make the shader work by default with Godot 4 but there are comments explaining how to use it with earlier versions of Godot.

10-4-2023: I have updated the shader to version 3 which adds:

An extra layer of large stars.

Variable star size and color based on their distance.

Different star rendering options: hard and soft edged circles, hard and soft edged crosses, squares, and diamonds.

Guidance on replacing the TIME constant with a time uniform that you can update from your game’s _physics_process function to control the scrolling direction and pause scrolling.


I have move freely usable shaders on Godot Shaders.

Download

Download
Starfield Shader MIT Licence.rtf 1 kB
Download
starfield_shader_v5.gdshader 7 kB

Leave a comment

Log in with itch.io to leave a comment.