-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Optimizing raycasting operations #6
Comments
Thank you for opening an issue! I didn't think much about performance when I implemented raycasting stuff to be honest, 3ms seemed "good enough" to me. If you want to contribute you can optimize the raycasting stuff yourself, just let me know :D (If you want to participate in Hacktoberfest you can also wait until October)
The ColorCache class is responsible for caching colors, I think that's what you're looking for. |
Given that 50mspt is your upper limit, anything above 1ms can cause tons of issues, specially with multiple players interacting at the same time. Possible issue with the color cache: Constant mapping if the the color is transparent (id 0 according to minecraft's color mappings) |
Good catch, that should be a simple fix. I'll open an issue for that. |
I just remembered that it's impossible to feed transparent colors to the |
This leads to another issue then - How are you gonna handle transparent images? |
When converting an image you simply have to check if the pixel you're converting has an alpha value of zero (or whatever threshold you'd like for transparency). maps doesn't have any built-in image converters iirc. Pseudo code, should be roughly the same for
|
Feature description
Hey,
I've been experimenting with making my own map rendering engine, and I'd like to leave some tips for just better overall performance:
There are 3 ways you can approach raycasting, it seems like you're doing method 1:
Method 1:
Method 2 (1+):
Method 3:
Further optimizations:
Relevant issues
No response
The text was updated successfully, but these errors were encountered: