2D lighting and shadows for GameMaker 2022 LTS
-
Read the documentation
-
You may also like borup’s lighting engine, YoYoGames’ DIY explanation, and Aura 2
2D lighting and shadows for GameMaker 2022 LTS
Home Page: http://www.jujuadams.com/Bulb/
License: MIT License
2D lighting and shadows for GameMaker 2022 LTS
Hello, thanks for the wonderful lighting engine. I am having a slight issue.
There seems to be an issue rendering shadows that shows up on one computer but not another. One difference between the two that may affect this may be the difference in graphics cards, Vega 64 vs GTX1080, where the Vega 64 computer shows this issue and the GTX1080 computer does not. It also seems to favor glitchy rendering on the "left" side of the shadow.
Thanks again.
Use a tick method and weak references for this one.
Need to add a proper .Destroy()
method.
When using SOFT_ADD bulb mode, shadows flicker. This behavior happens on both export targets I tried (Windows and HTML5). Tested with the Bulb.yyp sample project downloaded from the Github page itself, and confirmed with my sample project. When switching to any other bulb modes, it works fine.
A (kinda low bit) GIF showing the behavior with SOFT_ADD and with the next mode (HARD_BM_ADD) can be viewed here: https://ibb.co/G2Q6pQh
Tested on an mobile Nvidia RTX 2080 Max-Q using Gamemaker Studio 2 IDE v2.3.2.560 and runtime 2.3.2.426.
Hello! Is it possible to draw an object in the middle of a darkened room that would not be darkened? It is necessary to show a hint object for the player, so that it is not affected by light and shadows.
In this topic I explained the essence of the problem.
https://forum.yoyogames.com/index.php?threads/how-to-make-depth-in-lighting-system.96579/#post-581799
Hello there Juju,
In the demo project, if I turn castShadows to False in Lights and iterate on lighting modes, Lights will continue to cast shadows except for Soft alpha Clip bm_add.
I downloaded the latest demo 20.5.0.
In oLightDiscooooI Object create event, I set light.castShadows = false;
I only keep one light instance and delete the step event to see what I'm doing
I run the demo and in the rmTest Room, I iterate over lighting modes using the [2] key
All modes (but Soft alpha Clip bm_add) continue to cast shadows
(In fact I was trying to reproduce in the Demo a bug I have in my project (where when I set castShadows to false, my light fully disappear) but got this result instead. I'll investigate further...
Sometimes it is helpful to be able to apply negative space to lighting e.g. for fog effects or to mask level boundaries. The proposed feature would allow for shadow sprites to be drawn directly to the lighting accumulation surface.
In the accumulateHardLights() method from BulbRenderer class, shouldn't line 588 be:
if (mode == BULB_MODE.HARD_BM_MAX or mode == BULB_MODE.HARD_BM_MAX_SELFLIGHTING)
Instead of:
if (mode == BULB_MODE.HARD_BM_MAX)
To use BM_MAX for both standard and selflighting ?
M
Requires triangulation algo
I got a problem that if I increase the room width to 8900, then strong lags begin, although the fps debug shows that everything is fine (2000+) If I set it to 1300x1300 I get such an error.
https://i.imgur.com/mQUeD6P.png
https://i.imgur.com/l7BLKnt.png
https://i.imgur.com/WRreJ13.png
https://i.imgur.com/RdRtlmn.png
I have not encountered this with other light systems. In what there can be a problem? Same limitation?
I asked you about it a while ago. So this is just in case you find a way for this feature...
Light/Shadow Masking : In 2d game with side view, it might be useful to have the lights/shadows displayed only on the assets that are imediately behind the light (close to it) and not displayed on those that are far away.
In this case shadows from the light orb cast on the yellow wall and not on the background blue sky.
As user, maybe we could use a .add_masking_layer() to add layers as masks and tell Bulb its elements should be used to build the masking surface....
Solution is to replace line 413 __BulbAddOcclusionSoft(_dynamicVBuffer);
with __BulbAddOcclusionHard(...)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.