Shadowy Chickens
Yes I have a chicken obsession.
Implementing shadows is a good way to make a 3D scene stand out, and really feel like the world has some depth to it. Here's a handful of shaders for doing that!
This extension is, once again, based on my Luminous Chickens 3D lighting library, so if you've used that, it should look very similar.
Works on Windows, Linux, OperaGX, HTML5, and probably everything else.
What's Included
- All of the stuff which Luminous Chickens includes: light types, ambient light, fog, etc.
- Editable shadow parameters:
- Shadowmap resolution
- Shadow bias
- Shadow brightness
- Shadow filtering
- Shadowmap edge feathering
- Chickens
- A demo project
Documentation
can be found here.
Performance
Real-time shadowmapping is a bit more expensive than regular 3D lighting, owing to the need for the scene to be rendered from the perspective of the shadowmap. Bear this in mind, as well as the fact that you're allowed to skip rendering fine details to the shadowmap, or render objects at a lower level of detail.
Vertex Formats
Like most 3D-games-in-GameMaker shaders, these shaders expect a 36-byte vertex format defined with a 3D position, a 3D normal, a 2D texture coordinate, and a 4D color. If your game builds vertex buffers with a different format, you will need to edit the attribute list in each shader. (If you're at a level where you know how to use this stuff, that probably won't be too hard for you.)
How They Work
I've made an extensive tutorial series on my YouTube channel about 3D lighting effects in GameMaker. This includes four videos about toon shaders, plus a large number of others.
- Shadowmapping Setup
- Shadowmapping Implementation
- Surface formats make shadowmapping in GameMaker easier
Obviously, these are not beginner-level subjects. These (and others) would also be helpful to watch.
- 3D in GameMaker Studio 2 (full playlist)
- - - - - -
- 3D Directional Lights
- 3D Point Lights
- Fragment Shader Lighting (vs vertex shader)
- 3D Spot Lights
- 3D Spot Lights (advanced stuff)
- Surface Formats in GameMaker
Price
It's $5. If you pledge to (in past or present tense) my Patreon for a lifetime total of $5 or more, send me a message there and I'll give you a key.
If you don't want to pay, you can also learn how to write these things yourself via the YouTube links above - they're free, and probably more useful in the long run.
Repository
N/A this time.
Credits
- The chicken icon and walking sprite was created by @alemunin
- The skybox and 3D meshes in the demo were created by the excellent synty studios
- The planet image maps came from somewhere on NASA's Jet Propulsion Laboratory gallery
Other Relevant Projects
I've made a bunch of other things for 3D in Gamemaker that you might be interested in:
- Collisions
- Basic 3D lighting
- Toon shading
- Terrain editor
- 3D model converter
- Better D3D emulation
Purchase
In order to download this shader you must purchase it at or above the minimum price of $5 USD. You will get access to the following files:
Comments
Log in with itch.io to leave a comment.
Are the demo files missing from the asset package?
I didn’t include the demo files in the yymp since most of the 3D assets are from synty and not really supposed to be distributed outside of finished games. Is there something you need to look at?
I was struggling to integrate it (I'm somewhat of a newbie lol) and thought It'd be easier if I had an example project to look at. Great asset though, performance is superb.
I’ll throw together a smaller demo with free assets later today or tomorrow. Guess I might as well also email synty and ask them if I can distribute the demo files since it’s just a dozen or so files in there or so…
Thank you so much!
Okay, there’s now a sample project in the downloads section, see what you think. I should probably include them for the other lighting assets at some point as well…