Pixel Planet Generator
About
A showcase of some shader code for Godot game engine. Currently there are 8 types of planets, also generates black holes, galaxies, stars and asteroids. Each type has a lot of possible variations. Also allows you to export any planets you like in either a png , gif or a spritesheet.
Drag your mouse around the planet to change the lighting.
If you want to use this for yourself you can download the source for the shader code. Lots more options for variations are available in the source.
This project is completely free to use and will stay free, but donations are very appreciated, thanks!
FAQ
- Q: Can i use this in my game, tutorial, project, etc. ?
- A: Yes, it's completely free, use it however you want. Credit is appreciated but not required.
- Q: Is this available in Unity, etc?
- A: The only official version is this one, but here are some ports other people have made:
- Monogame: MonoGame-Pixel-Planets by EnthusiastGuy
- Unity: UniPixelPlanet by hmc
- Defold: defold-pixel-planets by selimanac
- Q: On the downloadable version, where do I find the exported files?
- A: On Windows and Linux, in the same folder the program is. On MacOS under "
~/Library/ApplicationSupport/Godot/
- Q: How do I use spritesheets?
- A: Determine how many frames you want for an entire rotation. Set this amount of frames for the width (or height). If this exceeds the file width limit, try increasing the other dimension (width/height) for more frames. And of course whatever tool you use to display animations has to support spritesheets.
- Q: How do I use color import / export
- A: Paste in a list of html color codes separated by newlines. Keep in mind that using the copy/paste from clipboard requires browser permissions. Also clipboard access seems to be disabled in firefox.
- Feel free to ask me anything if something isn't clear, cheers!
Source
Source on Github: https://github.com/Deep-Fold/PixelPlanets
Available under MIT license. Credit is appreciated, but not required.
Download
Click download now to get access to the following files:
Development log
- Update to Godot 4Mar 29, 2024
- color importing & exportingMar 18, 2023
- Layers!Jul 10, 2022
- Quality of life stuffFeb 27, 2022
- Galaxies & More PixelsDec 24, 2021
- GIF ExportsSep 07, 2021
- Dither togglingJul 03, 2021
- Random color palettesJun 06, 2021
Comments
Log in with itch.io to leave a comment.
do you mind if I use this in my (free) game?
Go ahead, it's completely free to use
Just... WOW ! This looks so good !
Thank you! Glad you like it.
Very useful for word building and making games etc.
Thank you!
You're welcome! Hope you can get some good use out of it
Very interested in figuring out how to export shaders as spritesheets/png's, you implemented that in this project flawlessly, seems like you incorporated another github project to do this. Were there any online resources that helped you with this? Poked and prodded at your project a bit and trying to work through a course on shaders, but my brain struggles to wrap my head around how you pulled it off. Amazing work!
That part wasn't super straightforward, but the way it basically works is that the program sets a time value on the shader, then copies the image output of that shader to somewhere else, and then advances the time value every frame until a full rotation is done.
As you noticed I used another project to save all of those separate frames to a gif, and I have a custom implementation for just stacking all those images together in a spritesheet. But I didn't really use any resources to come up with that, it just seemed like the easiest way to do it.
Hope that makes sense!
Thank you for allowing us to use your asset generator free of charge. This is a seriously impressive piece of work to me, as I myself have tried working with shaders with quite some difficulty.
Here is the project I completed with the help of your work!
Awesome, glad it was useful for your game! Cool to see you have a collection of games made already, thanks for sharing.
EDIT: Just noticed the dev logs - will look at those :)
seriously impressive work - I wanted to try do something similar but find dealing with shaders very difficult - don't suppose you have any advice on learning what's required to do something like this?
I'm an engineer so understand the fundamentals just cannae ken shaders
Glad you enjoy! Shaders can really be quite tricky to wrap your head around at first, it's a different way of thinking from normal programming. I would recommend finding different resources on it until something "clicks".
Personally, I found the book of shaders very helpful for an introduction.
Thank you so much! I'm actually currently porting your solution into rust using the Bevy Engine and it has helped a great deal XD. If it gets to a state I'm happy with I'll do it as a fork of your repo :pray:
I'll also check that book out!
Glad to help! That sounds like an awesome project, and probably also helps a lot in learning about shaders. If you get something going I'd be glad to link to it in the description or something
:heart:
it's been going well XD
https://imgur.com/a/2TTEHBB
Oh, super impressive to get that implemented in another engine! Looks pretty much done aside from some scaling, nice!
Thanks for these! they are great!
You're very welcome, glad you enjoy!
This is awesome. Using it for the Indie Galactic Space Jam 2024.
Nice, glad you like it and well done on making a game!
This is so cool, i wish i had a use for it haha
Haha, glad you enjoy. Just enjoying looking at it is also a good use
I call this planet Oeie :>
add more galaxy shapes!
Any suggestions? You can also adjust a lot more of the shapes and properties of planets and galaxies by using the source in godot.
I used it to make a few planets for my menu: https://iamsul.itch.io/starshooter
Its freaking awesome thanks!
Wow, amazing game! I love the retro look and feel of it, and a lot of fun to play also. Awesome job!
Looks amazing! Would you mind sharing some technical details? Is it using geometry? What procedural generation techniques did you use?
Thanks! This is using only a fragment/pixel shader to generate the planets, using a form of fractal brownian motion to generate noise.
I made a post on reddit some time ago that goes into a lot more detail in how the generator is built up, which you can find here: https://www.reddit.com/r/godot/comments/mobhb5
Unreal! Absolutely love it. Plans to make similar generators in the future?
Thank you! Glad you like it. I have some ideas for other generators but just need to find some time to actually make those.
this is so sick. great job
Thank you, glad you like it
i wanna see custom made moons n stuff
Thank for the suggestion, but this program is really about procedural generation. There's almost certain a lot of custom moon and other planet sprites on itch and other sites
This is one of the coolest art generation tools I've come across. Will definitely be using this and citing you in my spaceship building game!
Awesome, glad you like it and would love to see what you can do with it!
Hey, it’s a really cool tool you’ve created! What’s the license for the generated sprites? Am I allowed to use them in a complete game template and sell it on a marketplace like the Unity Asset Store? I’ll make sure to give proper credit if needed. Thanks!
Thank you, glad you like it. You own the sprites you generate, so feel free to do with that as you wish. Credit would definitely be appreciated if you want, and thank you for asking permission!
Thank you so much for clarifying! I really appreciate it. I’ll definitely give credit to you in the template to show my appreciation for the awesome tool. Thanks again for your work and for being so open about usage!
Hey, I made a game using your generator.
It's called Dr.Planet :D
Thank you, this helped a lot.
Awesome! Nice job on creating a game and getting it on Steam! Hope the launch is doing well and thanks for sharing.
Nice, can you make our Solar System as a pack with this exact theme?
Thanks, I'm not really planning on making a pack out of this, but feel free to generate whatever solar system stuff you need.
Aww, though I wanted a nice Venus, Earth, Mars, Jupiter & Saturn, Uranus & Neptune :( I’m also making a game, 2D Space Engine. Bye :D
Oh, that sounds awesome! Would love to see that at some point
Can u make a port for Game Maker Studio 2 ??? Please
Thanks for the interest, but I don't know game maker studio at all, so that would be way too much work for me.
what i've been doing is downloading the png and importing into gamemaker. btw absolutely amazing program Deep-Fold, this has been a literal lifesaver for my project and you are going at the top of my credits.
Awesome to hear! Glad it's useful and hope you can make something nice with it.
id love to see a randomize all button which randomizes the colors, planet type, seed, and rotation. also where the rings can be their own color too. the game so far is amazing and id love to see more of it.
Love this, it's delightful!
I thought you should know there's a bug when you export the black hole as a spritesheet or gif here on itch. The accretion disk wobbles back and forth for some reason when the frames are assembled. The hole is stationary completely but the accretion disk wobbles about some invisible axis.
Thank you!
The wobbling is something I intentionally left in the code at some point for some reason, but now that I look at it again, it looks a little silly. Thanks for mentioning, I'll probably remove it in a future update.
No problem! Once again, thank you for this amazing tool!
Can I export the planet as an HTML file and still keep its rotating effects?
I'm not sure what you mean exactly? A html file is just some text, while the exports only export as some image.
This is an amazing tool! I will be using this for some game assets and will make sure to include credit. Thank you!
Glad you like it! I hope it comes in useful, and thanks for the credit!
This is perfect for my space game project, I was wondering if there was a way to change or remove the light focus/direction on the planets.
Awesome, glad it's useful! If you're on desktop you can change the light direction simply by holding down the mouse and moving the light where you want it.
Damn, this is cool as hell, it would be nice if there was a setting with Earth in it though
Yeah lots of people have asked for earth already lol. I don't know if there is a seed out there that makes it look really earth-like, but I'm don't really plan on adding an earth shaped planet myself.
Super cool Asset!
Thank you!
One of the most amazing tools on the site! Absolutely love this and the Space Background generator. I've used some images from them in my latest jam game, and it couldn't be easier with the way you set it up. Really fantastic work, thank you very much for putting it out there for everyone.
Thank you! Nice job on making a game in such a short time, good luck in the votings!
Great tool, I'd love a way to change the rings on gas giant 2, or just add rings to different planets either way
Thanks! Yeah, that's a good suggestion, I'll probably add it in the next version.
Hi :) Love this. I found it a year ago and keep coming back to mess around with it. I was just wondering if this can apply a texture onto a sphere or is it only for 2d?
Hi, glad you like it. It's purely a 2d project, so no 3d stuff unfortunately.
how do i find where i exported it. spritesheet wise
On the web it should just go to your downloads, if you use the downloaded program it should be in the same folder as the program.
Hey Deep-Fold, awesome, awesome tool!
It gives me inpiration to work on a game, and I'm reusing your planet scenes directly from a fork of your github repo, as I love the flexibility compared to just using sprite sheets. Thank you for sharing!
Your code is very clean, and it's easy to just instanciate a planet and benefit from its methods; but I noticed a thing that annoyed me: I don't know if it is intentional or not but Asteroid scene and NotAtmosphere scene have a 'custom_minimum_size' of (100,100) instead of (0,0) for the other scenes. No impact on your tool, but for people trying to generate several planets on a screen and resize them, it makes it harder to align correctly compared to the other scenes.
Another tiny thing that can help is also to set all shader materials 'local_to_scene' to allow several different planets of the same type on the screen. I did it programmatically (I hate the UI) within the _ready() func of planet.gd with:
'for c in get_children():
c.material.resource_local_to_scene = true'
Anyway, once more: Thank you for this tool, thank you for the github repo, I hope I will be able to share an exciting demo someday with you :)
Hey, thanks for the good suggestions! I'll make sure to have that changed in the next version.
Glad you like the tool, and would love to see what you're able to make with it. Good luck!
Is there any way to generate more frames with higher resolution? Becasuse when i generate less than 60 frames, star rotates way too fast. Is there any feature to generate more frames, maybe by parts?
Do you mean for the spritesheet? At default resolution you can have thousands of frames. But yeah, if the pixel size is very large then the frames are limited by what the engine can handle.
There currently isn't a way to do an export in multiple parts, but if you need a lot of frames in a high resolution, I recommend just using the shaders directly.
Absolutely love this! Just used it for my latest video, and will definitely be coming back!
Nice! Glad the generator was helpful.
Trying to match the amazing aesthetic of the stars your generator can make is tricky, but I'm getting there :) Here's one of them with a ring world!
Wow, your game looks really cool! Love the UI and the ring. Good luck!
Simply wonderful. I kinda wish I was making a space game now :-D
I assume there is now way to make it resemble earth, right? (I mean with the approximate size, location and shape of the continents).
Thank you for sharing this in any case. I absolutely love the look of the planets this tool generates.
Thank you, glad you like it so much! There might be a seed out there that makes it look roughly like earth, although I haven't found it yet, who knows.
This is amazing... thank you for sharing with everyone!
Thank you! You're very welcome.
Hey there :) Wanted to let you know I'm using this for a title I'm working on:
Cosmic Cosmonaut
I will definitely include you in the credit section on release.
Looks awesome, I'll definitely keep an eye on it. Good luck with the release!
Amazing! Something you should add is rotation sliders for all axes, or some way to rotate the planet in the gif the same way the "rotation" slider works in the editor. Overall this is really cool and ill be using it and the space background generator for a game mod im working on.
Thank you! And thanks for the suggestions. I can't really implement a rotation for all axes because this is just a 2d image simulating a planet. But rotating the image like that in an animation should be doable, I'll consider adding that.
Good luck on the mod! Would love to see it when it's done.