Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    31
  • comments
    55
  • views
    46649

More fun with shaders, and a new direction for SeedWorld

Sign in to follow this  
CC Ricers

1928 views

Here's what I have been working on for the past week:

B_hHLRdU8AALdOI.png

Just a 3D scene of space. But all programmed in HLSL! I have been inspired by Inigo Quilez's work and also his other website, ShaderToy with the impressive technical approaches to computer art, and wanted to learn a new way to put my shader coding abilities to the test. I still don't know how to do most of the techniques for all the most popular effects, but ray marching is no longer the intimidating dark magic I once took it to be, and I think I did well for the first week. It could come in handy in games, maybe like using the shader that made this particular image as a background for a space shooter/sim.

Also, I got the program to compile successfully with MonoGame. I finally got around the problems with compiling custom shaders and corrupt MGFX files, and figured out the build configuration needed to run them with Windows 7/8 on the SharpDX API. I mean, it's about time. Vulkan was just announced in detail to the public, and up until last week I was still using Shader Model 3.0. I think I needed to step beyond the limits of older graphics APIs and try at least learning something new.

Here's the project configuration I used for MonoGame on Win7, in case someone else is trying to figure it out:

mono-settings.png

This compiles the entire project perfectly and you don't need to use any external tools to build the shader content.

Going in a New Direction

And now back to Project SeedWorld.

This project, which I also talk about exclusively on my own blog, has been put on the side for a couple of weeks. What really happened is that I needed to reconsider the scope of my project. I felt out of my depth. See, what I really wanted to make all along is something like Cube World but with a different set of game features and more focused questing, and the added perk of being regularly updated by yours truly. But that didn't end up going the smooth trail I wanted it to be.

For most of the project I was working on getting the voxel generation and rendering engine to work well and mostly bug-free. It can now render large procedural landscapes. Physics is all custom made and I can make a player avatar walk and jump around in the world. I finished fixing the last major graphical bug that it had and then- well I have a large world. That I can run and jump in. Suddenly I felt overwhelmed with how much more I still had to do.

I started adding some GUI code to test rendering and controls, but I needed to add something that resembles gameplay, even if it were the most vague. I could throw in a bunch of objects into the world, what they are isn't important, but just to make the player pick them up. But I needed to add an inventory menu to track those objects. I felt that it wasn't interesting enough.

A Change of Genre

I have also been taking a look at other games (completed and in-progress) to inspire me, and in particular voxel games such as Staxel and The Deer God has been so influential for making the decision to scale down my game. So as of now Project SeedWorld will be a platform game in the vein of the 2D Super Mario games. It might still have item management and RPG-like progress elements, but most of the focus will be on run-and-jump platforming action. I think I would have more fun making a game of this genre, and also stand a greater chance of making the game fun.

But the voxels will stay. I am gonna keep most of my voxel engine as it is, just with changes necessary to fulfill the needs of making a platform game. Voxels will be reduced in size, so it will be like Staxel. I will probably restrict the movement to mostly 2D, but graphics will still be full 3D. Just now with the added benefit of being portable with MonoGame (possibly the next big challenge).

Will the worlds/levels be procedurally made? That depends on how easy it is to making procedural levels. I've researched a bit and read an article or two, and it's not like throwing a bunch of noise functions and tweak their parameters till you get something that looks nice. The world generation will depend greatly on the actions of the player and this could mean many, MANY hours of play testing.

So there you have it, and now begins my work with a new type of game. Guess I just needed a break again from the project to think more clearly on what I should do. Also, because I already have most of the voxel engine already made, hopefully the start will be a lot easier.
Sign in to follow this  


7 Comments


Recommended Comments

If you're awesome and you know it give me the source. If you're awesome and you know it give me the source. If you're happy and you know it and you really want to show it then give me the source.

Share this comment


Link to comment

Nice.

 

@Migi: You didn't say the magic [s]number[/s] word. :wink:

"Stealing shaders", eh ?  Can't speak for Saturn but the background is probably this...

...Pfff, bookmarking is useless if stuff just disappears. That nice starfield shader is gone from shadertoy: [url="https://github.com/shiffman/The-Nature-of-Code-Cosmos-Edition/blob/master/stars/StarNestShader/data/stars.glsl"]Here it is again.[/url]

It (ab)uses a "fractal" which I didn't even know before [url="http://www.fractalforums.com/3d-fractal-generation/kaliset-3d-fractal-used-as-coloring-and-bump-mapping-for-de-systems/?PHPSESSID=e3a87cce8d4e6f58a30c7b55e325bd22"]Kali set[/url]


Anyway: Jup, Quilez and shadertoy are quite amazing, sometimes mind blowing. Just browse Quilez's site, he's got tons of demos and theory.

Share this comment


Link to comment

Yep, Unbird beat me to the code before I could. Though I got it from ShaderToy. Then I just removed the lines related to the "darkmatter" variable as they didn't have any visible effect when I used it. Tiling pattern is also modified.

 

Also +1 for that forum post which I didn't know about. That finally explains how the fractal pattern work, as I was scratching my head on how the star pattern emerges seemingly without any functions for hashing or noise reproduction.

 

I'm on my laptop so I don't have access to my full code. The Saturn planet was done with the raymarching sphere code and a very thin cylinder for the rings, subtracting a taller cylinder with a smaller radius to cut out the middle. This was easy enough for me to understand, at least.

 

I add color varied bands using a 2D noise function (in a FBM pattern) setting Y both times for the X and Y parameters (I know 1D noise is more appropriate here, need to replace that function). Ring bands are also noise, here using the distance from the planet's center as the variable.

Share this comment


Link to comment

that looks really nice. Maybe a stupid question, but what do you mean with 'complete programmed with/in HLSL'?

Share this comment


Link to comment

You don't have meshes and sometimes you don't even have textures. You run a full screen quad (in DX10+ you don't need buffers for that) and do everything in the pixel shader. The only thing you feed from application side is usually just camera settings and a time (for animation).

 

[url="https://www.shadertoy.com/view/Xds3zN"]This[/url] is particularly nice raymarch example on shadertoy. Make sure you got a browser which supports WebGL.

 

Edit: @CC Riders: Sorry for hijacking.

Share this comment


Link to comment

Nice.

 

@Migi: You didn't say the magic number word. wink.png

"Stealing shaders", eh ?  Can't speak for Saturn but the background is probably this...

...Pfff, bookmarking is useless if stuff just disappears. That nice starfield shader is gone from shadertoy: Here it is again.

It (ab)uses a "fractal" which I didn't even know before Kali set


Anyway: Jup, Quilez and shadertoy are quite amazing, sometimes mind blowing. Just browse Quilez's site, he's got tons of demos and theory.

 

Uhh, 21!

 

As people are generally lazy i submitted a copy version, here is a working link:

https://www.shadertoy.com/view/Mtf3Ws

Share this comment


Link to comment

You don't have meshes and sometimes you don't even have textures. You run a full screen quad (in DX10+ you don't need buffers for that) and do everything in the pixel shader. The only thing you feed from application side is usually just camera settings and a time (for animation).

 

This is particularly nice raymarch example on shadertoy. Make sure you got a browser which supports WebGL.

 

Edit: @CC Riders: Sorry for hijacking.

 

It's no problem.

I also updated the journal article with my MonoGame config settings, so it may help others to get their shaders properly working in Windows with MonoGame.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!