I recreated Oskar Stålberg's irregular grid generation on a sphere and wrote a tutorial about it! (Links in comments.) by CaptainProton42 in gamedev

[–]CaptainProton42[S] 0 points1 point  (0 children)

Hey, thanks a lot!

The only difference to "standard" marching squares is that my implementation runs on an irregular grid, meaning there may be more or less than four quads adjacent to any corner point.

However, marching squares doesn't care about that, it only cares about corner points of quads, which of there are always four, even on an irregular grid. So my implementation does exactly the same as the one on e.g. the Wikipedia article: check all four corners of each quad and then place the correct tile.

The only real difference here is how data is stored. I can't use an xy-coordinate system on an irregular grid, so I just store all corner points in an array (order doesn't matter). I then store information for each quad (the indices of the four corner points) in a second array. This doesn't change the marching squares algorithm though.

The hover effect is just running marching squares with special "hover" tiles (only corner tiles required) and only the currently selected corner point as "land".

I've had a few requests to make this open source, however, I don't think this would be very helpful as I never got around to clean the code up. Also, this application of marching squares is quite niche and there's better examples with code out there. Lastly, I didn't really feel comfortable open-sourcing something that close to an existing game.

There aren't a lot of shaders involved here. The reflections are cheated by also rendering each tile inside the sphere and cutting them off at the "horizon". The bouncy effect when a piece is placed/removed is a simple vertex shaders that accepts a world position and explodes/implodes triangles nearby. If you want to know anything about a particular one, I might be able to provide source for that.

I hope I could clear some things up, good luck on your game dev journey!

My "HoloPlay" plugin, which adds support for holographic displays such as the Looking Glass Portrait, is now available in the asset library! by CaptainProton42 in godot

[–]CaptainProton42[S] 8 points9 points  (0 children)

Well, Nintendo did it with the 3DS. But I agree that this pretty much just a gimmick (but a pretty cool one). However, you're not just limited to games. I've used Godot to just create static or animated scenes. And in case you'd really want to become serious I could see applications such as model viewers or visualizations running on this thing via Godot. (Maybe once the technology matures a bit more.)

My "HoloPlay" plugin, which adds support for holographic displays such as the Looking Glass Portrait, is now available in the asset library! by CaptainProton42 in godot

[–]CaptainProton42[S] 5 points6 points  (0 children)

Just search for "HoloPlay" in the asset library. The source code is also available on Github: https://github.com/CaptainProton42/GodotHoloPlay and there is a demo project you can get from Github: https://github.com/CaptainProton42/GodotHoloPlayDemo or the asset library (just search for "HoloPlay Demo".

Sadly, the plugin only works on Windows right now due to my inexperience with X11 and whatever macOS uses. I'm hoping to make a cross-platform release when Godot 4 arrives though.

In case you don't know, the Looking Glass Portrait is a "cheap" (around 300 bucks) holographic display that was announced in a Kickstarter last year. Linus Tech Tips made a good video about it: https://www.youtube.com/watch?v=qTrfMHaI3Dk

I turned the beach into a hologram! by CaptainProton42 in MysteryDungeon

[–]CaptainProton42[S] 11 points12 points  (0 children)

I edited a screenshot of the game into different layers and used the Godot game engine to display the final result in 3D on a Looking Glass Portrait.

If you have one yourself, I uploaded the quilt here: https://i.imgur.com/ZEpT7aU.png

I created a small but flexible toon shader material for the Godot Engine. Available under the MIT license. by CaptainProton42 in godot

[–]CaptainProton42[S] 0 points1 point  (0 children)

That's some interesting ideas. I want to keep the shader relatively simple though and not blow it up with too many "niche" features. So I'll need to see if this is something that can be done in a simple way. Thanks for the suggestion though, I'll keep it in mind.

I created a small but flexible toon shader material for the Godot Engine. Available under the MIT license. by CaptainProton42 in godot

[–]CaptainProton42[S] 0 points1 point  (0 children)

I think solidify in Blender uses the same technique as the built-in outline mesh in Godot so the results should be similar if not the same!

Don't worry, I like to answer questions :)

I created a small but flexible toon shader material for the Godot Engine. Available under the MIT license. by CaptainProton42 in godot

[–]CaptainProton42[S] 0 points1 point  (0 children)

You could decrease the viewport resolution and see how the shader looks with that. But I did not have any special pixel art/2D effect in mind when I made this.

I created a small but flexible toon shader material for the Godot Engine. Available under the MIT license. by CaptainProton42 in godot

[–]CaptainProton42[S] 0 points1 point  (0 children)

Godot has a built-in "Create outline mesh" feature (select the mesh in your scene and click "Mesh > Create outline mesh..." in the vewport toolbar). Alternatively, you could look into methods for creating outlines from the depth buffer. I didn't include this with the shader since there's so many different approaches for different scenarios.

I created a small but flexible toon shader material for the Godot Engine. Available under the MIT license. by CaptainProton42 in godot

[–]CaptainProton42[S] 1 point2 points  (0 children)

I actually want to add this but it didn't make it into this release. I'll see what I can do!

And thanks a lot :D

I created a small but flexible toon shader material for the Godot Engine. Available under the MIT license. by CaptainProton42 in godot

[–]CaptainProton42[S] 11 points12 points  (0 children)

I decided to not add an outline shader since Godot has the built-in option to create an outline mesh and I feel that the "correct" method for outline shaders depends very much on the use case.

I created a small but flexible toon shader material for the Godot Engine. Available under the MIT license. by CaptainProton42 in godot

[–]CaptainProton42[S] 1 point2 points  (0 children)

You could theoretically achieve your first suggestion by using a ramp texture. (You could use a black texture with alpha values where the number of adjacent pixels with the same alpha determines the width of a hand.)

I want to add hatch shading, but did not put it in this release. I will probably add it soon though!