Comments

Log in with itch.io to leave a comment.

Hi! I'm thinking about switching to GameMaker Studio for a pixel art/top-down game and would like to use your lighting engine. From the demo and the images here, it looks absolutely stunning and exactly like what I've been trying to do myself, but much better and more flexible! I'm still a little unsure about some aspects after playing around with your demo and reading some of the documentation, maybe you could help me out. I'd appreciate any help!

1. Is the shadow-color adjustable and can you determine how much blur you apply? In general, but also for sprite shadows specifically.

2. In the pixel art/castle room, it looks like the shadows of the bushes below the tree are sprite shadows that can be stretched/bent similar to the video here: https://www.youtube.com/watch?v=haU-lUkitas. Is that actually possible? It looks like the sprite shadow projection from one of the images does that, but I would like to make sure. I would like to use this for sprite shadows the imitate how the shadow of objects changes over the course of the day.

3. Can a daylight cast dynamic sprite shadows without actually altering the scene visually? In other words, I would like to add a daylight that casts sprite shadows, but the scene otherwise looks as it would if no light is placed.

4. If you place a light, can you determine where the falloff should start and how fast it should end? I.e., can I create a light with the shape of a circle and, say, a radius of 50 pixels and decide up until 40 pixels out, the light strength stays identical and then falls off in the last 10 pixels or is this predetermined and the same for all lights?

5. For your other projects, you mention that all platforms are supported (including consoles and iOS). Do you think this one does as well or is there a specific reason why it might not work on consoles, for example? I'm asking because the demo crashes for me on the latest macOS version and I can only run the Windows one.

6. At worst, my game would have around 4000 sprites to render, of which maybe 50-250 are visible on screen at any time and would cast a sprite shadow from daylight as well as, in theory, multiple sprite shadows from additional lights (campfires, streetlights, etc.). These would be dynamic shadows. Will I presumably run into an issue here on (lower end) mobile platforms or is that fine from your experience?

7. Is it okay to make changes to your code when using your lighting engine in a project?

Hello Elias, thank you so much!

Of course, if you want to join Discord, you're also welcome 😊

1. Yes, the color of the shadows is defined by the ambient light. It is possible to add blur natively to sprite shadows, and you have full control of the blur amount, resolution and others.

2. Yes, in fact, this video was one of my inspirations ^^, but in Crystal I optimized to use vertex buffers that are frozen instead, and rendered with just a single draw call, if they are baked, making it more performant.

3. Yes, you can add lights with shadows even if the ambient light is at 0 intensity, and you have full control over the intensity of the shadows.

4. Yes, you can use "inner", "falloff" and "radius" parameters to get this result.

5. Crystal uses pure GML code, with no external dependencies, so if it doesn't work on other platforms it could be a GameMaker issue. The shaders are written in GLSL ES, which is highly supported on all platforms, and I don't use noise functions currently, which are known to cause issues, so it should work fine. The MacOS demo was not compiled by me, as I don't have a Mac computer, a user helped me with that, so it's a bit out of my reach. If something goes wrong, just tell me how to reproduce it and I'll fix it quickly.

6. Currently shadows that have dynamic projections are somewhat limited. They cannot move x and y, as they were made for scenery, using a shader to move the shadows. Only normal sprites (without projection) can do this. I have plans to improve this in the future.

You can use vertex shadows instead, which can be used both dynamically and statically, and can be moved freely.

7. Yes, you should :)

Crystal offers a lot of customization, including using crystal_pass_submit() to submit custom code for a render pass. It is possible to completely replace the final shader using .SetRenderClass()

(+1)

Thank you so much for your detailed answer, I really appreciate it!😊 Sounds like Crystal is perfect for what I'm trying to do!

I was reading the license and I just wanted to confirm; It says that it needs to be bought again every time a commercial project is published.
I think that's understandable, but what about non-commercial/freeware projects? Does it need to be re-licensed again? Does a free game published on a store like Steam count as a commercial project?

Hello!

If there is no capital gain in the project, you can use it in as many projects as you want. Just remember that the project cannot be open-source, as it would fall into the redistribution category.

(+1)

Understood. Thank you!

This engine is pretty cool and I'm pretty sure it'll have what I need but I'm still learning how do specific stuff with it.

I'm making a top down shooter (hotline miami perspective) and I'm trying to implement overhead lights but I don't really know how to do that. I'm looking for a way to make a light that'll cast longer shadows on objects further away, but as the object moves closer to the center of the light the shadow becomes shorter until when the object is directly under the light, there is no shadow and the object is fully basked in light. 

There are two ways to increase the shadow length:

A) Using the shadowLength variable in Crystal_Shadow. You can set it to 20, 40, or more, so that the shadows will go further.

B) Modifying the shadowScattering variable, per light.

Thanks for the kind words ^^ Crystal will be perfect for the hotline miami style.

How is the shadowLength variable used? In my tests it looks like it multiplies the size of the base shadow mesh in order to achieve its length, but I'm not 100 percent sure.

Additonally, how does the depth of light and shadow casters affect anything? I'm also having trouble getting certain objects to render above/below light sources and I figure this has something to do with that.

Apologizes in advance if I have a lot of questions, I'm pretty new to this and sometimes the documentation can be a bit unclear to me.

(1 edit)

By setting shadowLength to 1, the length of the shadow will be equivalent to the distance from the light to each vertex of the shadow, in pixels. 2 will be twice that, 3 will be three times that distance, and so on.

To modify the variable, just do shadow.shadowLength = value;

All relevant information related to depth can be found here: Troubleshooting.

No worries, feel free to ask any questions you may have :)

(1 edit)

Alright, thanks. I'm also having issues with soft shadows. On the documentation under the light types section, the direct light preview shows the shadow almost fading out into the light, and I've also seen this behavior in some of the test rooms provided. However, my shadows appear to have hard cutoffs instead (im using SHADOW_SOFT_TRANSFORMED) and don't fade out.  (see img, i'm using a spotlight here but the same issue is still there when i do use a direct light)


Also, soft shadows with a low shadow length appear to not be completely softened, and only the vertexes of the shadow are not the edges in between, however I'm assuming this is intended behavior. Either way, how do I replicate the effect shown in the direct light preview?

This can be solved by setting the light's shadowUmbra to 1

(+1)

Yet another amazing extension! I really like that you utilizing the depth buffer to limit the number of surfaces needed for render pipeline sorting

This definitely makes a big difference, especially on low-end platforms with little VRAM :D

Thank you, constlet!

(+1)

Congrats on the release, looks great!

So in my 2d side scrolling game game I have lots of layers  grouped into foreground, middle ground and background, each has their own lighting system and is not affected by previous group. IE backgroun should not be lit by lights on middle ground. Right now I am drawing middle and foreground on different surfaces, not a fan. Would you suggest your engine for my game?

(1 edit)

Yes! It is entirely possible to use Crystal for your game. You can illuminate the layer using a Direct Light and a different litType. Thanks ^^

(1 edit)

Thanks! I have actually looked around since I posted and I see I can accomplish it per layer via LIT_EQUAL. But I have 20 different background layers, 30+ middle ground layers, 10 + foreground layers. I don't think I can do the lighting on a range of layers, ie light  layers from depth 100 to 2000, and another light to light layers from 2000 to 3000 for example?

(2 edits)

You have some options:

  • Having a Crystal_Renderer for each surface (which is not ideal);
  • Add a Direct Light to each layer you want to illuminate;
  • Use a Crystal_MaterialLayer, which allows you to render the layers in range in some pass, at different depths.
(+1)

Ah I see, thank you!

(+2)(-1)

Been waiting for this lighting system! Got the holy foxy trinity of managix, crystal, and post processing FX! Can't wait to really put them to use in our HD game, you're saving me thousands of hours! Special thanks indeed, and to all wondering if you need this? BUY YOU FOOLS

This means a lot to me! I’m so glad the holy foxy trinity is going to good use and I can’t wait to see what you’ll do with it in your game 😁
Saving thousands of hours seems totally worth it, isn't it? 😌 Thanks for the kind words!

(+1)

Absolutely fantastic, been waiting for this to release, so excited to give this a try as soon as possible ^^

I'm glad you like it!! If you have any questions, don't hesitate to ask :D

(+1)

Looking awesome, is there going to be a demo for Mac?

(2 edits)

Thank you! I can't provide it, sorry... If you wish I can provide videos demonstrating (or see my Twitter)

I can provide you with a Mac demo, now that I have purchased this great pack! Let me know if you are interested?

Kind of you, that would be interesting ^^ in your time

I have put up a blog post, https://conceptalpha.co.uk/crystal-lighting-engine if you just want to download and it add it to this page that's fine. I can remove the post when you're done.

Added, thanks! ^^

(1 edit)

Will this only be applicable to GM? Are there plans to support other game engines in the future? Ex: Godot,Unity etc...

Hello! Only GameMaker this time - my knowledge of other game engines is limited

(+1)

I've been brewing a few Spine projects, so this is well timed.

Looking forward to seeing what you cook with Crystal :D

(+1)

Epic! Can this be used for an Art App, practically and legally?  Anyhow, this is really impressive!

Yes, anything made with GameMaker! =] Thanks ^^

(+1)

Congratulations on the release! It's been a fantastic journey from first discovering your previews earlier this year to this moment. Cannot wait to take our games to the next level with such a powerful tool.

I'm extremely flattered! I can't wait to see what you're going to do with Crystal! ^^ Feel free to tag me on Twitter/X and I'll repost :D

(+1)

Nice, does it work with tilemaps or just objects?

(+1)

Works with everything =], tilemaps, backgrounds, instances/objects, etc. Check out what else is here

(+1)

Congrats on the release, looking forward to trying it out soon! <3

(+1)

Thank you kindly!! If you have any questions, feel free to ask =]

(+1)

OMGG :D

(+1)

🔥

(1 edit) (+3)

I’ve been checking for this page every hour for the last month and finally here it is 

That makes me so happy to hear! I can't wait to see what you'll do with Crystal! :D