-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weird snap shadow glitch #19
Comments
Mmm I'm not sure what it could be exactly, could you try compiling with the debug candle flag and see how the light behaves?
|
I created a new project with just SFML and candle with MSYS2-MinGW64 x64 on windows I compiled with this command :
I don't know how to precise a definition to cmake so I directly put it in the cmakefiles :
but when I add this flag, my window appear but the "isOpen()" function return false and the program just shut. That a really weird behaviour and I don't really know if I skip a step here ... Without the requested flag : |
|
I will try to reproduce the bug to find the error, when I have some time this week. I will keep you updated, thanks for reporting the issue. |
@all-contributors please add @JonathSpirit for bug report and testing. |
I've put up a pull request to add @JonathSpirit! 🎉 |
Another weird glitch : I print in the console every calculated minimum distance on every lines (4 lines). edit : (my mouse is not visible in this screenshot but it's on the isolated red circle) |
First of all, I'm glad you like the project and I'm so thankful that you are interested in it. I made the library literally out of a project for personal learning about raycasting (with a very basic knowledge on this kind of topics) that I originally didn't mean to share, but somehow scalated to this. So, I'm aware of that sort of problems in the code (I still cringe at some design decisions I didn't think through enogh). I would love to have more time to maintain and improve it, but that's just not possible right now. This kind of contributions are the only way for it to grow in this moment. Let's see. First of all, you suppose right. the RadialLight tries to filter out far away edges. The issue with the calculation of the nearest point is in fact something I mentioned in the contributing guidelines, so I'm happy to see that you realized quickly about it. In fact, your version of the distance calculation is what the code does in the commented part of the snippet you shared. // float d2 = sfu::magnitude(s.m_origin - castPoint);
// float d3 = sfu::magnitude(s.point(1.f) - castPoint);
// if(std::max(std::min(d2, d3), d1) <= m_range*std::sqrt(2)){ The problem with that approach are large edges, you can test it. They are ignored when the start and end points are not in range even though if the line itself is. Thanks again 😄 edit: make image smaller |
Also, one of the pending issues in Candle is the lack of documentation for developers. So there's something you find useful to know while modifying the code, feel free to write it down and I will include it when I get to do it. |
And thinking about the original issue
I've noticed that it happens when the ray is horizontal. I'm not sure that this has something to do, but the error might be related with the function About the problem with
Maybe you could try also adding the flag |
Of course, make the PR. |
@all-contributors please add @JonathSpirit for code and ideas |
I've put up a pull request to add @JonathSpirit! 🎉 |
I think I correctly fixed it, this is due to the calculation in the intersection function just waiting for #24 to be merged to be able to work on the dev branch |
(this fixed the weird white line glitch too) |
Of course, tomorrow I'll do the merge. Thanks a lot! |
Fixed in #25 |
When casting to a complex shape, weird shadow snap appear and make it uncomfortable to see.
I created lines between those points :
My code is from the example program, with the add of a lighting area :
I used the library imgui-sfml but this should not interfere with candle.
The text was updated successfully, but these errors were encountered: