Advertisement

Lighting issue

Started by July 30, 2024 08:40 PM
3 comments, last by taby 4 months, 2 weeks ago

I am working on a lighting system for tile-based games. It's nothing too fancy. The code and input images are at https://github.com/sjhalayka/light_blocking_asymmetric

I am having an issue. Whenever the input images are asymmetric (e.g. width != height), the lighting goes haywire. Here are some images:

Symmetric input works great:

Asymmetric input is all messed up:

Any ideas on what bug I'm missing? I've checked the code multiple times, but to no avail. Thanks for your time!

Is it possible that my GPU doesn’t support rectangular textures?

Advertisement

Anything in the last decade does support irregular sizes, but yes, older cards required power of two sizes on each dimension, not necessarily square, but sizes like 128x512. You can check the list of supported features for whatever card you have.

I never did find a solution. So, I'm just increasing the texture size so that it's square. Once the compute is done, I crop back to rectangular from square. With OpenCV, it's easy.

This topic is closed to new replies.

Advertisement