-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
3D GEQ #143
3D GEQ #143
Conversation
Should it perhaps be GEQ 3D rather than 3D GEQ so it sits next to the other in the list? |
I was thinking the same thing. |
Bug fixes after lots of testing, better settings, etc. Big thanks to @netmindz for restructuring the code. Add rough distance stop to Segment::drawLine()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me!
I added a lot of rendering bugfixes to work with all the new various sliders so it always behaves as expected.
"Speed" is implemented with the fastest setting as 1 pixel shift per frame, and that goes down to 1 pixel shift every 10 frames at the lowest end of the slider.
Thanks to @netmindz for restructuring so it uses proper WLED functionality.
I've tested this down to 16x16 and you can get something that looks pretty good at that resolution if you adjust the sliders, reduce the bars, etc.
I'm not overly happy with the perspective when the horizon is moved and the distance is lowered - I feel like that needs some sort of "depth" change so it's not coming to a point when the projector point is right over the bar.
...but that's for a later fix. 😄
I'm in favour of more controls, however the dmx effect mode personality only supports the speed and intensity options, so are we happy we are mapping the two most useful controls to the right thing? Personally fade speed is the least useful to me, for it to look most like a laser and appear most responsive that is with zero fade. Whereas I'm highly likely to want to change the number of bands and would not be able to in Effect Mode. |
Why is dmx only supporting 2 controls? Dmx fixtures have often easily 10+ channels. Shouldn't WLED support that as well? |
I see a few minor optimizations for accuracy, but spotted nothing yet that could drastically improve speed. |
* adding a _fast_ variant of SetPixelColorXY, that does not perform any error checking. * drawLine uses the fast setPixelColor variant (bresenham algo only) * for TESTING: segment option "reverse" switches back to the "original slow" code. surely needs some more optimization and improvements. First test on GEQ 3D shows 10%-30% speedup
@netmindz @troyhacks I've pushed a first shot for faster DrawLine, using an optimized setPixelColorXY_fast that does not repeat error checking and cuts a few more corners. Can you check if this produces better framerates in your setups? I'd expect around 10%-30% speedup. Important: I've temporarily misused the "X reverse" checkbox, it turns off my optimization - for back-to-back comparing without recompile. |
This is good for 2-3 FPS faster at around 20 FPS before. |
* made setPixelColorXY_fast private * optimized Segment::fill() to use setPixelColorXY_fast * "bar" 1D expand optimization
Only draw what will be visible. This is a pretty solid speed increase when the adjacent bar is close in height, or if it's taller and would occlude it anyway, it'll be skipped.
Added optimized side-wall drawing that will only draw what will be visible, rather than the entire height. This is a pretty solid speed increase when the adjacent bar is close in height - or if it's taller and would be occluded anyway, it'll be skipped. |
What impact did this have on speed? |
+ don't use dynamic array for heights[] - dynamic arrays are using malloc() -> heap frag.
on my test setup: 20fps --> 30-35fps. |
* made cols/rows integer, to avoid that "cols-x" wraps around * pre-compute some expressions that don't depend on loop counters --> wins us 1-4 fps on my 72x72 test setup
Depends on the frame, but a big increase. Before it would have drawn a sidewall for every bar except the one under the projector, from the bottom to the height (like in the red circle) - and then relying on other painting over top to hide the the non-visible parts. ...but now it only draws the green areas because those sidewalls are actually visible. |
Netmindz likes the borders. Now a check-box to enable.
Added borders back as a checkbox for @netmindz 😊 |
@troyhacks on my setup (72pixels wide) the "borders" checkbox does not seems to make a difference |
@troyhacks my fault, its there. I just had to move the "front fill" slider to left side to see the boxes. |
fast sPC() in pinwheel mapping -> ~10% speedup
It should work for values below "full" down to black-out. Full front fill is the same color. I guess I could make them not draw when the front face fill is 100%, but that's only a very minor speedup and there's a checkbox for that. |
use drawLine() to draw a complete bar at once. Only possible if _not_ doing colored bars.
drawLine parameter "depth" shortens a line by a fraction - useful for VP perspective (vanishing point)
* bugfix for Borders (did not work with <16 bands) * new option for soft light: when checked, the left & right edges of top lights are drawn with anti-aliasing on. Costs us 1-2 fps, so I made it optional.
hmpf ... looks like somewhere deep in WLED, the FX name string gets limited to 127 chars....
PR to pull in @troyhacks new 3D GEQ effect