Comments

Log in with itch.io to leave a comment.

Viewing most recent comments 1 to 40 of 60 · Next page

hey so what would you recommend when trying to cast shadows on tile set walls I have been having a hard time with it drawing micro shadows from the bottom corners of the tiles up onto the walls. 

Hello! It depends on your game's perspective, but you could use paths and draw the shadows vertices in the room.

I experimented with lighting and normal mapping today, and it brought noticeable changes to the image! However, the lights or normal mapping flicker from time to time, and I can't figure out what's wrong.

Wow! That looks amazing!!

Regarding the flickering, do you have a video demonstrating it? My guess is that you need to use floor() at the final position of your camera; or increase the resolution of application_surface.  I've had something similar before and this solved it.

Hi there, are you planning on discount soon?

(+1)

Hello! Follow me on Itch.io to receive notifications when I have promotions :D

(+1)

Thanks, already am

It's now available, enjoy! :D

Thanks, bought it and the reflection!

Thanks a lot! I Hope you like it :D

(1 edit)

Quick question. Is it possible with this system to only darken certain areas in the game room? For example, in my top down game, I have a bright outside world, but you can walk into an area that has a roof and should be dark inside. Can I tell Crystal to only darken that area under the "roof"? By the way, how do I find the discord server?

(3 edits) (+1)

Hello sully,

Yes, it's possible: The first room in the demo is more or less an example of this: the background is illuminated, and the interior is dark with lights. You can add a Direct Light of any color (like white - for a neautral color) in the background to illuminate the exterior environment, with the depth of light below the depth of the "dark area". Ideally, the dark area will need occluders/shadows for walls to block internal light from passing out, like below (shadows are optional):


The Discord server link is on my Itch.io

I'm a little nervous buying this and adding it to my project. It is a bit expensive for me. I want to make sure it ends up working properly. What is the best way to request help if I need help? Also, my game has a camera that sets up the display size, window size, and then resizes the application to make everything pixel perfect. Will this lighting system mess with any of that?

Hello, sully!

I'm happy to help with any questions through my Discord server, which is on Itch.io. There's also a Getting Started guide that will help you add Crystal to your game.

To make you comfortable: I'm one of the developers who best understands how graphics work in GameMaker, so you can rest assured.

Crystal was designed with pixel art in mind as well, so depending on what you've done, it should be compatible. But if you're interested, I have another library called Rezol that handles pixel-perfect from the box and works well with Crystal as well.

Hi! I'm sorry if this is really obvious, but I'm having trouble finding it in the documentation. Is there a way to do a simple "cut-out" light without any color influence?

Something like this, that just removes the ambient color without adding any kind of overlay of its own?

Hello, Brittle Lizard!

Yes, for this to work, the ambient light intensity usually needs to be above 0 (so you can see the darkness area), and you need to set the intensity of the lights to 1 (default) using .SetLightsIntensity() and .SetLightsCompensation(). It might also be helpful to change the global blending type of the lights if desired.

Even with adjusted intensity, the lights still seem to affect the colors of anything caught in them slightly. ^^'

It doesn't look bad on its own, but I'm wondering if there is a way to actually, explicitly and exclusively cut a hole through the ambient lighting. I.e., I want to be able to color-pick a screenshot of the player and know definitively 100% I will get the same hexcode if I color-pick the raw sprite in my art program. Basically how a lot of simpler lighting frameworks (like Bulb) do things by default if you don't explicitly try to color the lights or add any extra effects.

Low-intensity spot lights can get close, but they still seem to brighten the image under them a bit.

Hopefully this image illustrates what I'm looking for a bit better. 

Thanks for the screenshots, they're very helpful :D

You can try disabling HDR for the lights using .SetLightsHDRenable(false). Let me know if this helps.

Disabling HDR didn't really have an impact. I never specifically enabled it, so I'm not sure if it would have been visible regardless...? I messed around a little more with what you gave me, and I think I figured out what works though:


or alternatively:



Basically, as long as you force the actual lights to be the exact inverse of the ambient color like this:
...it will perfectly punch out a hole in the ambient color, hitting the ambience with the exact inverse of itself at the exact same intensity to cancel it out. (The default black/white of the ambience and lights respectively works fine for this, of course.)

Like the comment in the second screenshot says, I think what mixed me up a bit is that the default light compensation is 3, but the jsdoc says it's 1. I was just getting a little confused trying to get here lol

Thank you for offering your time! I'm really excited to dive deeper into Crystal.

(1 edit)

Lights compensation works similarly to intensity, but it multiplies after blending (basically an exposure control). Oh yes, the default "lights compensation" is 3. I was going to change it to 1 and even wrote it in the documentation, but at the last minute I went back to 3 because I realized that this could cause confusion like "my lights got weak in this update" ^^'.

That's an interesting observation; I believe it must be due to the mathematical equation of blending, but basically, the lights are "multiplicatively additive" in the scene, so perhaps that explains the behavior.

No problem, thanks for the kindness =]

This looks incredible! I always thought that something like this should be included with Gamemaker right out of the box. Anyway, I was wondering if everything included in the demo will be possible with the asset itself, or did you add other *paid* assets to achieve anything? 

Hello!

Everything in the demo is included when you obtain the Crystal, except for the Post-Processing FX for the bloom effect, as it was the only way to demonstrate the emissive materials working with glow ^^

Thank you for your kind words! I hope you enjoy it :D

(1 edit)

Hi! I have a question. I'm rendering an object using chunks. It's drawn in sections. The initial shadow works fine, but when I delete a chunk, the shadow remains intact. How can I re-render the shadow? Any advice?

And another question, how can I prevent light from passing through the walls?


// Shadow

_shadow = new Crystal_ShadowSprite(id, sprite_index, image_index, CRYSTAL_SHADOW.DYNAMIC);

_shadow.shadowLength = 0.1; 

_shadow.fixedBase = false; 

_shadow.followLightAngle = false; 

_shadow.Apply();

(+1)

Hello!

I think in this case you could use shadow.Destroy() when deleting the chunk, and shadow.Apply() to re-add the shadow to the renderer.

Regarding preventing light from passing through walls, see: Light leaks through the wall (even with shadows)

(+1)

Thx!

(1 edit)

Hello! I played the demo and have a few questions:
1) Is it possible to detect "brightness" at a specific room position? For example, to determine if a point or instance is hidden in shadow?
2) In the Light Collision demo, instances can be hidden when untouched by light. Would it be possible to only trigger this with specific lights, or modify the threshold that triggers visibility?
3) Rather then simple being visible / hidden, can instances instead only be partially lit / obscured by lights? Similarly to how games like Darkwood handle it. For a more advanced example, having only the pixels touched by a specific light object be drawn for a given instance.
4) Can you set some instances to be completely unaffected by certain lights?

(+1)

1 - Yes, this is done with the .GetLightsCollisionAt() function. It returns the pixel color at the specified position, and with that, you can use color_get_value() to obtain the brightness of the color and thus create gameplay mechanics.

2 - Lights are objects, so you can do this without relying on Crystal; Crystal only provides the function of detecting the color of the light at that position.

3 - Yes, but you would have to create a shader that darkens the object's sprite according to the light's position. Since the lighting system is 2D, and the sprites are simple quads with two ultra-thin triangles, that's why there's such a drastic change when altering the light's depth.

4 - Yes, see: How to have any layer or graphic unlit (without being affected by lights)

(+1)

Perfect - thank you!

This is a wonderful system. Thank you so much for sharing it and making it so user friendly to work with. I've only really just started working with it but I can already tell that it's going to be a game changer

(+1)

I'm more than happy to hear that! My focus is on ensuring it remains simple to implement while still being powerful. Thank you! :D

Amazing tool! This is well worth every penny! I was just stumbling across an issue with intense lights. Some of my lights add up to eachother like intense point lights and emmissive sprites creating a "negative color"-like effect. What could I possibly do to fix this?

(1 edit) (+1)

Hello Meister! It's truly an honor to have the creator of Palpus X: Annihilation as a customer :D

Is this negative effect probably happening because of the normalized blend mode? I recommend using the "multiply" mode with renderer.SetLightsBlendmode(0). You can also try using "Multiply LDR" if you're using HDR, to create a "clamp" on the pixels.

Another thing that might be happening is that the overall light intensity is too high. You can reduce it to 1 using the renderer.SetLightsCompensation(1) function. By default it is currently 3.

And you could also disable the HDR of lights by using .SetLightsHDREnable(false)

tbh im confused , i followed the guide but nothing happens, i checked the template however it has much more code compared to the guide so im just lost, i cant even get a basic light set up 

(+2)

Hello theyakuzi!

Sorry to hear, which part exactly confused you? Did you follow this guide specifically? Could you tell me what have you tried to do so far so I can give you some direction?

The .yyz project actually has more code because I needed to demonstrate how Crystal works in different situations. I know it might seem intimidating at first, but the process is simple. Sometimes it can be something silly that caused something not to work. I also have a Discord server for a more extensive discussion.

i got it! it seems i missed the part  application_surface_draw_enable(false);

(+1)

Oh! that makes sense :D Since when this is enabled, GameMaker automatically draws the application_surface over the Crystal drawing, which makes it seem like it didn't work. I'm glad it worked now!

(1 edit)

This looked really good and I'm sure it is once you figure out how to use it, I have spent about 5 hours on it and cant get it to work, not even the most basic of setup, followed guide up to Shadows


EDIT - Clearing cache and reimporting resolved issue, great tool!!

(1 edit) (+1)

Hello! Thanks ^^

Did you follow the Quick Start guide? Which part exactly are you having trouble getting to work? Take a look at Troubleshooting.

Edit: Oh, I'm glad it works now ^^ thanks!

(2 edits)

Hello! I have a strange problem: the shadow is drawn on top of the sprite, not underneath, as in the demo.


CREATE: 

// Shadow

_shadow = new Crystal_ShadowSprite(id, sprite_index, image_index, CRYSTAL_SHADOW.DYNAMIC);

_shadow.shadowLength = 0.1; // Numbers close to 0 will prevent the shadow from moving too much with the light. 1 = same distance as the light.

_shadow.fixedBase = false; // The shadow WILL offset

_shadow.followLightAngle = false; // The shadow will NOT rotate based on the light position

_shadow.Apply();


STEP:

//Shadow x/y/depth

_shadow.x = x;

_shadow.y = y;

_shadow.depth =  depth + 1;


UPDATE: Sorry! My fault: gpu_set_ztestenable(true);

(+1)

Hi, oh yes, you need to enable depth buffer so you can depth sort things


I have it all enabled, ztest, depth is seemingly correct but it doesn't go under the sprite for me, am i missing something?

How are you doing it? Are you explicitly setting the shadow depth to a greater depth than the tree depth? Using `shadow.depth`. Don't use the same depth as the tree, as there's no guarantee of depth sorting

I was mimicking one of the demo versions trees(castle) to see if the sprite shadows would work.
Basically copied the code but the same effect doesn't come even with me trying to mess with most settings.
Step event:


as for the create event its this. Every other variable is basically for just setting image alpha to 0.5 when player goes behind it. No idea what could interfere.

depth=-y
spritename = sprite_index

active = true

alphacount = 1

init = false

shadow = new Crystal_ShadowSprite(id, sprite_index, image_index, CRYSTAL_SHADOW.STATIC);

shadow.angle = 0;//random(360);

shadow.fixedBase = true;

shadow.followLightAngle = true;

shadow.Apply();

i wish this plugin would be available for godot as well 😢 it looks incredible

(+2)

Thanks for your interest, Godot is a great engine, but I only use GameMaker ^^', maybe you could try GameMaker? 👀

Gdscript feels simpler for me plus,the benefits on godot are outweighing gamemaker for me.i wish you well on your projects 😁

(+1)

Thank you! I wish the same for you too :D

(+1)

thanks 😁

Hello, this is a magnificent lighting engine! 

I 've been working on making my particle(depth sorted) effects not affected by lights and shadows, referring to the documentation and sample project.

Is there a recommended approach that allows rendering that is excluded from light/shadow  with depth sorting?

I first tried using the EMISSIVE pass, with the following code: crystal_pass_submit(CRYSTAL_PASS.EMISSIVE, draw); 

However, using EMISSIVE changes the appearance of the particles. So I tried the COMBINE pass, which rendered the particle with the exact appearance I wanted, but it did not support depth sorting. 

Thank you so much!

(+1)

Hello! Thank you for the kind words ^^

Yes, this is indeed a common problem, and depending on the effect, such as smoke, it might be better to draw the particle system manually at the desired depth and use a Direct Light with litType = LIT_EQUAL and intensity 1. This way, the light will illuminate only the depth where the particle is (you need to modify the light depth all the time in your case). And in fact, the Combine pass doesn't support depth because this is drawn after the lighting system is drawn (but on the same final surface).

Thank you for the prompt reply! 

I tested the suggested method on my project, but since the depth of my effects and objects changes dynamically, unintended objects get illuminated when they share the same depth. 

Is there any way to bind the light to illuminate only specific instances, instead of restricting by depth using `LIT_EQUAL`?

Or any other good approaches would be appriciated.

(+1)

You're right, this is a limitation compared to forward rendering, where shaders are applied to each object individually (you just need to skip the lighting calculation to get something unlit). Since Crystal uses deferred rendering, everything naturally receives lighting, so to get something "unlit", you need to light it. The other alternative is to use the Combine pass, but it can only be drawn after everything.

(+1)

OK, I get how the engine works now! 

The "unlit" issue (excluding objects from lighting) is something I think I can work around in my project now, so that's solved for me.

However, the issue with the "EMISSIVE pass visual change" is definitely getting into the engine's internal settings, so I'd like to send you a few more detailed questions via email to discuss it further!

Thanks a bunch for your help! :)

I asked it on the GM forums, but figured I'd ask here too. The "castle" scene in the demo is almost exactly what I need, but the transition from "in front of light" to "behind light" is really jarring, going from fully dark to fully lit immediately.

Is there anyway to utilize something like the "light penetration" feature to give it a 1px edge light while the light is behind or beside the sprite? Or maybe more than 1px, depending on light angle, so that as the sprite comes up alongside the light, it lights it more fully, rather than just snapping to a lit state?

If there was a way to do this, I might be convinced, but $60 is a high price tag to experiment with, you know?

(Also the "toggle dithering" feature on the castle demo doesn't work. Nothing toggles on or off for me.)

(+1)

Hello!

Regarding the depth change, this is because I'm using depth = -y for depth sorting, and since the game is still 2D, the light is just a "plane," and they're organized into layers, like other things. You can simulate smooth transition by applying a shader that darkens the tree depending on the light's position (but this isn't included).

I need to make it clear that it's more difficult to deal with depth in 2D if you're trying to imitate 3D perspective, like in top-down Zelda-like games, but it's possible to get good results.

Yes, you can change litType to LIT_ALWAYS. This will make the light always stay on regardless of the depth. You could also experiment "normal maps".

What graphics card do you have? AMD or NVidia? I can try to fix that.

I understand the price issue. I sometimes offer discounts, so you can follow me to be notified. You can get a refund if Crystal does not deliver what was described.

I guarantee you won't regret getting Crystal, it's currently the most complete library for GameMaker, and you have complete freedom with it.

Thanks for the quick reply! And the pricing would completely be worth it if it solves what I need. I'm on NVIDIA, if that helps.

I'm definitely not good enough with shaders to write something that would give that gentler lighting effect I'm after. Shaders are hard as hell, so kudos for what you've written.

Is it possible to toggle both "plane" lighting and put a normal map edge lighting effect on top of it, like you demonstrate in the docs you sent? I know that often times these different draw methods are organized as separate functions in libraries like this.

(3 edits)

You're welcome

Yes, it is completely possible to combine both methods. Edge lighting is a property of the light (light penetration), and normal map is a property of the material

What is your specific GPU model if I may ask? I have a GTX 1050 TI and it works fine

(+1)

RTX 2060, but the laptop version. (My understanding is that desktop and laptop version of graphics cards differ slightly.)

Hello! This looks absolutely awesome, thank you so much for your work! Just wondering - If I were to use this and design my game using the default 2D room editor, but then used projections to make my game 2.5D, would that break the lighting system? Or would it continue to work in 2.5D?

Hello!

Thank you for being kind! ^^ Crystal only works with orthographic projection cameras.

(1 edit)

Of course, your libraries look like must haves! I'm hoping they'll continue to be updated to work with GMRT. ^^ And I see! Does that mean if you were to technically have a 3D scene, but the camera was orthographic then it would continue to work too? =O

Hello, could we possibly get a manual to see how the library is structured and used before purchase? Also, is the Tokyo Ride showcase screenshot using any other libraries? By that, I mean the "Post Processing FX" library.

Hello! Of course, the manual is publicly available here:

https://kazangames.com/assets/crystal/docs

Yes, I used Post-Processing FX for the bloom effect, and Crystal's emissive materials for the stuff

(+1)

Thanks for the quick response :)

(1 edit)

Sorry for asking how to create such a shadow 

Maybe there is a code for creating a shadow exactly like a branch, so that it is reflected without rotation, etc.

(+1)

Hello! I just added it to the documentation about Sprite shadows, I hope this helps ^^

Thx. But x, y dont work. If I do shadow.x = x, shadow.y = y in step, nothing works... 

(+1)

The shadow should be dynamic and not static.

Hi! After updating to new versions of Light and Postprocess Engines, the light stopped working. Before that, everything was ok... Maybe something changed?

(+1)

Hello! Check if lights are still children of light parents after updating. Is there any other additional information about this?

I've bought this engine and am enjoying getting started; however, I am still confused by how to generate shadows for an animated 2D player character. I believe I need to create a dynamic shadow and a Crystal_ShadowMesh(). 

But I'm confused by the workflow--the documentation links to a tool here (https://web.archive.org/web/20240712103410/https://adriano-t.github.io/meshgen/) for creating a list of points by hand, but it appears I need to do that for every frame of my character and then use the Crystal_ShadowMesh().FromJson method. That seems like a lot of manual work. Is there no automated method, or is that indeed how to create an animated shadow?

(+2)

Hello! What you want will be available in the next update (v2.0), which is scheduled to be released soon.

(+2)

Deleted 342 days ago

Will such shadows be built automatically?

(+1)

These shadows are sprites, so yes. Additionally, I also added functions to create vertex shadows using ray tracing.

OH MY F. GOD! Bro, WHEN? I can't wait to touch them)

(+1)

Just released! :D Have fun :)

(+1)

Hey, it seems that I was late for the vacation sale. Does anyone know when it's going on sale again?

Strange problem, I create a normal material (in the example when I insert everything works ok), and my normal map does not work when lighting... I've racked my brains and can't find the problem...

material = new Crystal_Material(id);

material.normalSprite = spr_floor_s04_n_1;

material.Apply();

// Create system responsible for rendering lights, shadows, materials, etc.

renderer = new Crystal_Renderer();

renderer.SetRenderEnable(true);

renderer.SetDrawEnable(true); // disable it if using post processing

renderer.SetMaterialsEnable(true);

renderer.SetHDREnable(true);

renderer.SetCullingEnable(true);

renderer.SetCullingSettings(300);

renderer.SetLightsBlendmode(CRYSTAL_LIGHTS_BLENDMODE.MULTIPLY);

renderer.SetAmbientColor(c_black);

renderer.SetAmbientIntensity(0);

// Enable depth buffer and alpha test

gpu_set_zwriteenable(true);

gpu_set_ztestenable(true);

gpu_set_alphatestenable(true);

gpu_set_alphatestref(1);

application_surface_draw_enable(false);

(1 edit)

Hello!

You can only see materials if the light's shader is Phong or BRDF. By default, the light's shader is Basic. Also, take a look here.

I hope this helps :)

The Mac demo doesnt seem to want to run on OSX 15.5 Mac Studio.

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)

Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000030

Exception Codes:       0x0000000000000001, 0x0000000000000030

Termination Reason:    Namespace SIGNAL, Code 11 Segmentation fault: 11

Terminating Process:   exc handler [44161]

Hello Matt

I think your OS version is too recent compared to the compiled file (?) Could you test the Windows version?

(1 edit)

Hey. I followed the instructions in your documentation, both in my main project as well as in a blank project. I can't get a single point light working. Even copied code from the example project, still doesn't work. It's just a black screen. I'm using IDE v2024.13.1.193

Hello! Could you send me your project privately in Discord so I can take a look? Sometimes it can be a silly mistake like an incorrect configuration, but I can help you. Are you sure the object is in the room?

Hi, is it possible to exclude certain object instances from being affected by the lighting system? For example, I want some instance's icons or markers in the game to remain unaffected by lights, shadows, or day/night cycles.thanks!

Hello!

Yes, I prepared a tutorial recently explaining this, check out this link (Troubleshooting).

I hope this helps ^^

(+1)

Thanks!!! got it.

I have another question.  When I set SetMaterialsEnable(true), the instance is drawn twice—once in Draw and once in Draw GUI (with one being a ghost image that doesn't update when the object moves). Why does this happen?thanks

(1 edit)

Crystal should never be drawn in the Draw GUI unless you are calling the .Render() function in the Draw GUI event (which is not recommended)

(1 edit)

Hi, I purchased your asset today, but I’m not seeing the bloom effect in your Example project. I tried modifying the objInit Create event by adding instance_create_layer(0, 0, "Managers", objPostProcessing); but this causes the game to crash.

Do you have any recommendations on how to properly enable the bloom effect or set up the post-processing? Any help would be greatly appreciated!

Thank you!

(3 edits)

Hello! Thank you for purchasing Crystal, I hope you like it ^^

As mentioned in the welcome message, I used Post-Processing FX (my other library) to demonstrate Bloom support with Crystal for emissive materials (since this is the only way to see it working), but this is not included in the source code, as it is a post-processing effect (screen-space effect), which is outside the purpose of Crystal, which is a light and shadow system in world-space.

Hope this helps :D

(2 edits)

Yes, I have both assets, and I’ve already imported Post-Processing FX.
However, when I try to set it up, I get this error in the Create Event :

Variable <unknown_object>.PPFX_Renderer(102732, -2147483648) not set before reading it.
 at gml_Object_objPostProcessing_Create_0 (line 4) - renderer = new PPFX_Renderer(); 

Could you please help me figure out what’s causing this and how to properly connect the bloom effect with Crystal?

Any guidance or example would be really helpful.

Thank you!

(3 edits)

Join my Discord and send me the project privately so I can take a look if possible, but I believe it is because in v5.0 of PPFX, "PPFX_System" became "PPFX_Renderer", and in the example this change has not yet been reflected yet.

Edit: User's issue has been resolved.

Man I've been waiting for a sale for months to buy this, you telling me there still isn't one during the summer sales TT ?

Vacation Sale is now available, enjoy! :)

(+1)

Oooo nice timing then- I just gotta wait to get my salary and I'll finally be buying this :)

Thanks! I'm sure it will be very useful in your projects :D

So I've bought it and literally nothing works idk what I'm missing- I'm gonna sound like the guy that didn't read the documentation but I swear I did TT I'm on IDE v2024.11.0.179 and Runtime v2024.11.0.226

 I imported the package in my game and I've just followed the Getting Started tutorial in an empty room separated from my entire game, put on a background, enabled view port, checked the parent objects... Nothing appears. Not even the debugging tool can appear. The only weird thing in the code that might help find the solution is that I get a yellow "String Not Found" underline on a couple of lines such as renderer.PreRender(),  renderer.Render(...) and others, but I don't know what to make of that.

I would appreciate some guidance because I don't know what did I miss 

(1 edit)

Oh, send me the project on Discord (privately) and I can diagnose it for you. Sometimes it's something silly like the object not being in the room ^^

Edit: User's issue has been resolved.

looks like I just missed it

(1 edit)

I waited like 6 months for this to go on sale and it didn't so i guess we're done waiting, though.. i'm still looking out for a sale on ppx.. But hey, i finally have a summer to mess around with it and maybe put it into some games, Bulb is currently doing pretty alright for me but light depthing, normals, light sprite animation, and pixel art light effects are pretty appealing. I doubt i'll need some of the fancy stuff like reflections but you never know, eh? Maybe some art direction makes that feel like it belongs and suddenly i'm glad to have it. Anyway, thanks for making this foxy, time to see what I can manage to use it for.

Vacation Sale is now available, enjoy! :) 

Thank you very much for the support! have fun ^^

(+1)

Well that means I can get ppx now too, why not. Price aside these are some damn good assets foxy, you're doing a service to the GM community and I for one appreciate the opportunity to use this level of lighting tool without having to get into the mechanics myself lol. I'll try to make some scenes worth showing off and make you proud. Until then, see ya 🫡

Hi. I bought it! First of all, I checked how Spine 2D animation works.

Do I understand correctly that it is necessary to make 2 spine animations - albedo and normal? (This will be easy inside Spine2D).

For metallicity, emissivity and roughness, do I also need to create each Spine sprite?

Hi!

In principle it works the same as bitmap sprites, you need different sprites (albedo/color, normal, roughness, etc), each of which will be drawn in a different pass: normals, etc. You can use Crystal_Material() or submit your own code for each pass using crystal_pass_submit(). I suspect it is possible to do this using skins in Spine? (but I believe you have to use crystal_pass_submit for this).

Thank you for purchasing, I hope you enjoy it ^^

Does this support diffraction shadows (e.g. sharp edges when close but fuzzy/blurred edges far away from the occluding object)? Also, do you ever offer sales on this asset? It looks very powerful!

Hello AlaskaWorks,

Yes, there is support for penumbra and umbra for shadows.

I usually do sales during periods when Itch.io announces sales. Follow me so you can stay up to date with future sales ^^

(+1)

Vacation Sale is now available, enjoy! :) 

(2 edits) (+1)

This looks absolutely incredible, I can't believe I haven't stumbled upon this sooner, before spending an unhealthy amount of time trying to implement some of these features into other lighting systems. 

Special thanks for the .GetLightsCollisionAt(), just what my stealth game needs. 

That's great to hear! Thank you so much, it means a lot to me ^^ have fun

Hi, it's me again. I have 2 questions.

1) is it possible to use a fixed value in edge lighting (light penetration) that does not depend on the distance to the light source?
For example, I want the penetration to always be 16px.

2) is there an implementation of fake AO for topdown in the lighting engine like in the screenshot here? (look at the floor around the object)

Thank you very much in advance!

Hello Nakkazuka!

1) Yes, but you wouldn't use the light penetration feature, but rather draw it using normal maps. This way you can customize how many pixels the light will pass through and stuff like that. You need to change the light shader to Phong or BRDF too, to support normal maps. See: Creating Assets

2) Yes, there is support for Ambient Occlusion, through materials (sprites) or AO pass in general (cystal_pass_submit()).

Thank you! I will be buying the asset soon.

This light engine has everything I need, especially spine2D support (normal/material rotation, bone scaling, etc.)

Thank you! I hope you like it, and if you have any questions, there is the Discord server :)

Hi! I really really like the asset as of now and it was really easy to setup. I have two issues at the moment, however:


1. Maybe I'm misunderstanding how to use sprite shadows, but it seems they always have the same depth. If I have two trees with one behind the other, is there any way to have the sprite shadow cast to also "hit" the tree behind? Maybe I'm missing something here, but I can't figure out how to have different depths for sprite shadows. If this is not intended, is there some workaround?

Also, is there support for the shadow being distorted by the object behind? So for example, if part of the front tree's shadow hits the tree behind, the shadow would not be cast in the same wayas on the flat ground but look a little distorted (on the tree behind)


2. Is there a way to have a fall off for sprite shadows? Kind of like a mixture between the shadow for the character in the top down/castle demo and a sprite shadow.


Thanks in advance for any help!

Hello!

- What determines the depth of sprite shadows is the depth of the ShadowGroup, since sprite shadows are drawn inside a surface, to apply a blur later (if desired).

Remember that all these shadows and lights are 2D simulations with depth, and do not work like in 3D, where the shadow reaches everything dynamically, so it can be a bit tricky to adjust the depth, unfortunately this is a problem in 2D games in general.

- This is only possible for Vertex Shadows currently.

You're welcome ^^

Thanks for your quick reply! :)

Ahhh, I see. Performance wise, is it an issue to create a group per sprite shadow/object to have individual depth values per shadow? 

Can we access the buffer/surface the sprite shadows are drawn on and render them individually?



Also, ist it possible to find out whether and where an object is collides with a (sprite) shadow? This would be interesting because - if there is access to the sprite shadow buffer(s) - the shadow could be distorted by other objects behind the one that casts the shadow to mimic a more three dimensional shadow.


Vertex shaders look really cool, but they act more like occluders, right? Or are the mesh shadows able to cast shadows similar to sprite shadows where there is a certain shape to them?

Creating a group for each shadow would be extremely cumbersome, since it would mean 1 full-screen surface for each shadow.

I was looking at the code and it looks like I can add depth support via the depth buffer. This would make it possible to have just 1 group with multiple shadows at different depths. I'll look into that later.

You can detect collisions with shadows and lights using .GetLightsCollisionAt()

Yes, all shadows have the functionality of blocking light, except sprite shadows, which also allow drawing in ambient occlusion pass.

(2 edits) (+1)

Depth support via the depth buffer would be amazing, thanks for looking into that!

I see, so only when using vertex shadows, you could have objects blocking light? My only issue with vertex shadows is that they seem to be less fitting for games with a 3/4 perspective whereas sprite shadows look more natural to me in those settings. But I'll look into what you can do with vertex shadows a little more.


Edit: This video by FriendlyCosmonaut shows the type of shadow I'm trying to integrate. Thag's only possible with Sprite Shadows, right?

It is possible to create this type of shadow with vertex shadows as too, but you would have to draw the shape per vertex. Otherwise, yes, Sprite Shadows will use the shape of the sprite. In the next Crystal update, there will be a function that creates vertices based on the sprite's outline.

Is it possible for the Crystal_TimeCycle() method to exclude specific objects or instances from being affected?

Hello!

The day and night cycle only changes ambient light (using LUTs), so you have a few options to do this:

A) Add an emissive material;
B) Add a direct light (with the same depth and litType = LIT_EQUAL);
C) Draw it in the combine pass, using crystal_pass_submit;

Thank you. I have another question: When I add an outline shader in the draw event, it causes issues with the rendering of lighting and shadows. How can I correctly use the shader without affecting the display of lighting and shadows?

Hmm, any shader should work normally, I suspect it might be the alpha testing? (gpu_set_alphatestenable etc)

Could you show how you're doing this on Discord? 


The first image shows the mouse is not on the chair, while the second image shows the mouse placed on the chair. An outline shader has been added to the second image. I don't understand why this is happening—gpu_set_alphatestenable is set to true.

(1 edit)

See: 2. When a transparent object passes over another, it occludes

"If you are using shader_set(), you may have to do the alpha test manually within the fragment shader. This is because GameMaker does not add the DoAlphaTest() function to the shader internally"

Heyo! Thank you for the amazing libraries! I was just wondering if you offer any bundles or deals?

(1 edit)

Thanks ^^ I usually do sales during periods when Itch.io announces sales. Follow me so you can stay up to date with future sales ^^

(+1)

Hope for sale soon im interested too this looks good :)

Hello. Nice engine.
1) I might have missed this, but does this light engine implement ambient occlusion for objects? For a top-down perspective, this is pretty relevant.I want to get a very soft black outline around an object (with adjustable thickness and strength), for example for a box.
2) for a top-down perspective, can I implement a reflection of a puddle? for example, so that the puddle would reflect the nearest box and light? I'm thinking about creating wet floors with puddles.
Thank you!

(1 edit)

Hello!

1) Yes, a Crystal_Material() can be applied to objects and allows you to add ambient occlusion. It can also be applied to layers using a Crystal_MaterialLayer (I am using it in the first platformer example - the brick wall)

2) Yes, you can add reflections using Materials too, and it is also possible to write your own code and submit it to the renderer using crystal_pass_submit()

I hope this helps, thanks ^^

Hi! Thinking about getting the engine, it looks great!. I read through *some* of the documentation. Quick question: my game currently makes heavy use of tile layers in rooms, I assume it's also possible to get materials (normal maps mostly) to work with tilesets/tile layers?

Hello! Thanks for the kindness ^^

Yes, definitely 😁 it's possible to use Crystal_MaterialLayer and select many ranges of layers (tilesets, backgrounds, assets, instances etc), being normal maps, PBR Materials, and more.

Viewing most recent comments 1 to 40 of 60 · Next page