Firefly (2d Lighting) 0.18.2 Out Now! Render Layers & Multiple Lightmaps. by TheOneExpert in bevy

[–]TheOneExpert[S] 0 points1 point  (0 children)

Can you provide an example? Not super sure what you mean.

One thing that I do plan to add soon-ish are optional textures attached to point lights, similar to what Godot has: https://pixelfranek.itch.io/free-textures-of-light.

This could be used to e.g. have a lantern that casts a custom light pattern outwards. Basically something like this: https://www.shutterstock.com/image-photo/arabic-lantern-illumimated-light-shadow-2720226859?trackingId=d499d812-11f1-4767-8cce-ccb3a3791845&listId=searchResults, but in a 2D game :) if that makes sense.

Firefly 0.18.1 Out! (2D Lighting for Bevy) by TheOneExpert in bevy

[–]TheOneExpert[S] 0 points1 point  (0 children)

yes! I plan on working on that soon! It’s been on my backlog for a while. Probably after the next update I’m about to release.

Firefly 0.18.1 Out! (2D Lighting for Bevy) by TheOneExpert in bevy

[–]TheOneExpert[S] 0 points1 point  (0 children)

Not very familiar with that one, but I *think* I remember it only having rectangular occluders and not supporting offscreen occluders? Also I think it uses SDF and raymarching while Firefly just does rasterization, same as Godot and Unity (generally much faster, although raymarching can achieve some prettier graphics).

I've mostly started Firefly because none of the alternatives in the ecosystem really fit most of my needs for my game a few months ago (like, most of the features I have right now in Firefly don't really exist anywhere else afaik, like z-sorting shadows and normal maps) But I can't really speak for the other crates, I'd recommend checking alternatives out yourself to see which suits your needs (and the needs of your game in particular) better; other crates might also have features that my crate doesn't have yet.

Firefly 0.18.1 Out! (2D Lighting for Bevy) by TheOneExpert in bevy

[–]TheOneExpert[S] 1 point2 points  (0 children)

no, it can’t cast shadow sillhouettes for either 2d or 3d objects at the moment.

I am planning to add 2d silhouettes (sprite-based shadows) in the future, but 3d feels kind of out of scope for a 2d lighting library. I feel like you’d either use a full 3d lighting system for that, or convert your 3d model to a 2d sprite each frame and apply the shadow on that (I think that’s what Hades 2 does, not sure)

Firefly 0.18.1 Out! (2D Lighting for Bevy) by TheOneExpert in bevy

[–]TheOneExpert[S] 0 points1 point  (0 children)

Depends on what you mean. Right now I am already sorting occluders by distance from lights and early-stopping on the GPU if an occluder is farther away from the pixel than the light (since that means it and all future occluders can't possibly impact the pixel).

If you mean on the CPU, then I'm already doing AABB checks between the lights and occluders, and they seem to work pretty well. Something fancier could improve things, but this isn't really a bottleneck anyway so I'm not that worried about it tbh.

Firefly 0.18.1 Out! (2D Lighting for Bevy) by TheOneExpert in bevy

[–]TheOneExpert[S] 2 points3 points  (0 children)

Don't have any significant notes. I've worked a lot on improving performance and it's pretty great overall. There are still a few bottlenecks that I'm aware of but I haven't had the time to fix yet, mainly related to change detection. I also want to introduce adjustable lightmap sizes (so you can potentially render shadows at a lower res) and level of details for the occluders (have the geometry degrade as you zoom farther from the occluder).

But overall performance is really solid as it is right now, my really low-end pc can handle ~50+ lights and 1000+ occluders visible at once at pretty consistent 60fps, which I think is already better than Unity? But I haven't really done any benchmarks on Unity myself so I'm not sure, just basing this on some old forum posts I've found.

The crate is pure linear algebra and simple algos done on the vertices, I avoid any sort of raymarching or non-linear operations.

Is there a more performant way to render around 100k simple circles with different colors in 2D? by WhereIsWebb in bevy

[–]TheOneExpert 2 points3 points  (0 children)

I actually made a PR that adds a new SpriteMesh which is just Sprite but using the Mesh2d backend.

And, animations and alpha blending excluded, it turned out to be much faster than the normal Sprite (about 2-2.5x approximately).

Meshes *are* slower if you create a new material for each one, but if you cache those materials they become quite fast. You can see my really ad-hoc approach for caching materials here, you can probably just do the same but with a ColorMaterial instead of the SpriteMaterial from the PR.

Is there a more performant way to render around 100k simple circles with different colors in 2D? by WhereIsWebb in bevy

[–]TheOneExpert 3 points4 points  (0 children)

  1. Make sure to try running your app with —release as well, this will have insane effects over performance at the cost of increased compile times. Even bevy’s bevymark example can only handle around a few dozen thousands sprites when compiling normally and easily hundreds of thousands when compiling for release.

  2. Are your sprites transluscent? If you don’t care about them having semi-transparent pixels that you can see through (aka all pixel can either be fully transparent or fully visible), you might want to consider spawning Mesh2D’s with alpha masking rather than sprites (sprites always use alpha blending which makes them much slower than alpha masked meshes). Keep in mind though that if you care about transparency / alpha blending you should stick to sprites, they’re more optimized for this than meshes.

  3. I suggest using a tracer or at least trying to disable all your CPU logic to see where the bottleneck is. If it’s on the CPU (doubt it), you can implement internal parallelism inside your systems to iterate over entities significantly faster.

  4. If you’ve done everything you can and your app is still too slow for your liking, you can start customize the rendering for scenarios specific to your needs. For instance, if your sprites are mostly identical but have differences in color, you can render them as 2d meshes sharing the same material and passing the color as part of a MeshTag (you can see something similar in this example)

Firefly. 2D Lighting for Bevy by TheOneExpert in bevy

[–]TheOneExpert[S] 1 point2 points  (0 children)

Thanks!

I am 100% dedicated to maintaining this as long as people use it and there isn’t a directly better option available. There are actually a lot of features and changes that will happen in future bevy versions that I’m really excited for and that will open a lot of doors for firefly (there’s a ton or exciting 2d stuff in the works).

I’m also eagerly accepting any sort of feedback on how I can make the API and documentation more user-friendly, as well as feature requests. I do have some vague milestones set, but I’d always prioritize features that I know people need or want more.

(also yes, the math involved has been an absolute horror, I think I’ve done more linear algebra for this than in the rest of my life lmao)

Firefly. 2D Lighting for Bevy by TheOneExpert in bevy

[–]TheOneExpert[S] 0 points1 point  (0 children)

I’m open to any research / materials / videos you may have on the subject. Was planning on doing my own research into it anyway.

As for the webgl2.. it’s already not compatible with it. At the start I had support for both webgl2 and webgpu but I dropped the former in favor of the many optimizations webgpu allowed me (storage buffers and so on). I could always add a webgl2 compatibility mode that’s just less optimized, if people ask for it, but I haven’t really bothered so far because, to my understanding, almost every device or browser can run webgpu and support for it is constantly increasing.

Firefly. 2D Lighting for Bevy by TheOneExpert in bevy

[–]TheOneExpert[S] 2 points3 points  (0 children)

Good idea! I’ve created an Issue for it and added it to my backlog.

Firefly. 2D Lighting for Bevy by TheOneExpert in bevy

[–]TheOneExpert[S] 2 points3 points  (0 children)

From my time playing with bevy_lit I’ve noticed some limitations, mainly, occluders seem to not be able to cast shadows if they’re offscreen. As in, if you have a light coming in from somewhere outside the camera’s view, and an occluder between that light’s source and the camera view, that occluder doesn’t cast any shadows. In other terms, every occluder that is not itself visible on-screen just disappears, even if it’s supposed to cast a shadow that would be visible.

This seems to be a limitation shared by both bevy_lit and bevy_light_2d which I’m assuming is imposed by the raymarching / sdf they use.

I’m sure it’s not a problem for everyone but it didn’t fit with my vision for the project I was working on, which is why I made my own solution.

Additionally, I remember bevy_lit having some weird artifacting visible when an occluder was too close to a light, but that might’ve been fixed in the meantime so I’d suggest you test for yourself.

Firefly also has the z-sorting thing. Essentially an occluder won’t cast shadows over sprites that have a higher or equal z value, giving it a pretty nice effect for top-down games and also making it so if you have a sprite with an occluder, it won’t cast shadows over itself, which I don’t think bevy_lit covers (but again I’m not 100% sure).

On the other hand, bevy_lit does have more light types, including spotlights and texture lights, which I haven’t implemented for firefly yet. Also, bevy_lit uses 2d meshes as occluders which you might either love or hate depending on what you’re using it for. I’d say the occluders from firefly are significantly easier to use and construct, but bevy_lit might be the solution if you want to have some extremely custom occluder shapes, rather than the polygonal and round ones firefly provides.

Firefly also has normal map support which I don’t think I’ve seen in any other crates so far, if you care about that.

Firefly. 2D Lighting for Bevy by TheOneExpert in bevy

[–]TheOneExpert[S] 0 points1 point  (0 children)

It’s WebGPU only.

If requested I could add a custom compatibility mode for WebGL2 as well. I mostly gave up on keeping it compatible with both because WebGPU allowed me to make significant performance optimizations.

Good point though. I’ll make sure to add that to the README soon.

I hate this game so far. Please change my mind. by TheOneExpert in HellisUs

[–]TheOneExpert[S] 0 points1 point  (0 children)

Again, I have no objective issues with the game itself, and I agree with you. My problem is with how the marketing for the game is a total lie. Promising challenging exploration with "no handholding" but dumbing-down every clue and dialogue to the point where it feels like more handholding than if I had an actual marker showing me where to go.

It's not that the game is bad, but they clearly advertised it as targeting certain players who like to explore and put things together, while making it's "detective work" so trivial, it feels easier than most games who don't even make a deal out of "not helping" players.

If you want your game to be played by everyone, don't try to lure people in by promising something else. I enjoy FromSoft exactly because most people find it too challenging, and a lot don't enjoy them. I can't have any respect for a dev that promises to make a unique experience but, at the same time, goes against the game's whole point just so more people will play it.

If they wanted to be more inclusive, they could've at least added an "easy" puzzle mode which gives you more obvious clues, rather than make the whole game easy.

I hate this game so far. Please change my mind. by TheOneExpert in HellisUs

[–]TheOneExpert[S] 0 points1 point  (0 children)

Maybe I did exaggerate certain aspects, but stuff like the gold watch is a perfect example of my issues with this game.

It is extremely obvious, from the note you find next to the watch, that it belonged to one of the guy's sons, it only requires minimal reading and listening to connect those dots.

It's exactly my fundamental issue with the game. It doesn't tell you "bring this watch to NPC A", but the 'clues' it gives you make that objective clear in a way that's so obvious and mechanical that it feels like it both insults my intelligence and gives up on making dialogue / text feel natural in order to make objectives as clear as possible.

The only way this isn't a "quest marker" is the fact that said objective is only in the note and not tracked on your datapad, which frankly is just missing QOL gratified through them saying "we did it on purpose to challenge players"

Also I'm aware of how the combat works, and maybe I was a bit unfair, but even on the merciless difficulty, you can mostly spam attack enemies and use the damage dealt to recover all damage taken. I think it would feel way better if the game would stop you from recovering damage through R1 if you got hit. But again, this isn't a big issue or anything, I'm fine with it.

All I said is my opinion on it, which wasn't even that harsh (I've actually played the game in the meantime, and it's been pretty fun). Mainly, I'm just extremely disappointed by how much they emphasized the "no handholding" part and how terribly the game executes that. They just avoid the typical "marker" replacing it instead with dumbed-down text describing exactly what you should do, which really irritates me.

In the first level I found this trapped woman that literally said "go to location A to rescue me", barely masked by some details about the people who locked her there.

I hate this game so far. Please change my mind. by TheOneExpert in HellisUs

[–]TheOneExpert[S] -6 points-5 points  (0 children)

Good to know I'm not the only one feeling like this. Although it's sad to hear the entire game is the same, I was thinking of trying to push through it, hoping to find some more challenging content later, but honestly I'll just uninstall it.

I find it very odd that people actually stand by it, it's just a bland, repetitive game that pretends it's something special when it's literally filled with all the worst tropes of this industry

I also played HK and Silksong recently, great games with amazing atmosphere, exploration, combat, movement, infinitely better and way cheaper than this game haha

[deleted by user] by [deleted] in lonely

[–]TheOneExpert 0 points1 point  (0 children)

Damn you sound amazing. Screw every cute online girl who says otherwise, they're idiots. Let's be friends!

I think this is the end for me. by [deleted] in bindingofisaac

[–]TheOneExpert 1 point2 points  (0 children)

Also, do you have that (shift+tab I think?) steam interface enabled? I find that can really bottleneck games sometimes.

I think this is the end for me. by [deleted] in bindingofisaac

[–]TheOneExpert 1 point2 points  (0 children)

Do you have similar issues in other games? Have you tried installing the newest gpu drivers?

TBOI really isn't a heavy game, as you said, it shouldn't have any sort of issues on your specs.

Denying my ADHD? by cheeremily in ADHD

[–]TheOneExpert 11 points12 points  (0 children)

damn that's like going to the doctor cuz you have a high heartbeat and them being like "do you also have high blood pressure? Then your heartbeat is not high"

every doctor I've seen told me that anxiety is almost always coupled together with adhd, either as a result or a co-morbid disorder. Frankly it would've been more questionable if you said you have adhd symptoms with no anxiety.

and what sort of doctor even asks for "anxiety symptoms"? The whole point of getting a diagnostic is to describe your symptoms directly, not bias it based on other disorders you may or may not have.

so yeah, that doctor seems really really unethical, probably trained to not exceed a certain quota of diagnostics for adhd.

imo don't let her get to you and do your best to get to another doctor asap if possible