Skip to content
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

TV Simulator Effect #1548

Merged
merged 4 commits into from
Dec 22, 2020
Merged

TV Simulator Effect #1548

merged 4 commits into from
Dec 22, 2020

Conversation

Def3nder
Copy link
Contributor

@Def3nder Def3nder commented Dec 21, 2020

Hi @Aircoookie,

there had been wishes for an TV-effect for a long time and I looked at various solutions with NeoPixels ...
(e.g. #938 opened by fribse)

The most of them looked quite ugly ...
...but then I stumbled upon the version from Adafruit: https://learn.adafruit.com/fake-tv-light-for-engineers

This one was way better and I adapted it to work with WLED.

It's based on color-scans from real movies - thus it does look way more realistic :-)

...greetings from Berlin,
Ralf

...from my 1st attempt with "Phoney TV" - but this one did not look good.
@Def3nder Def3nder mentioned this pull request Dec 21, 2020
@Aircoookie
Copy link
Member

This effect looks quite realistic when viewing through a window or room door indeed :)
At some places it is too dark I believe - but movies are also dark and switching between solid and TV mode once put it at a different offset that was brighter.
I did add some defines because the mode uses about 18kB of flash, which is quite much but of course we have enough space to have it enabled by default :)

@Aircoookie Aircoookie linked an issue Dec 22, 2020 that may be closed by this pull request
@Aircoookie Aircoookie merged commit e16bab8 into wled:master Dec 22, 2020
@poblabs
Copy link

poblabs commented Dec 22, 2020

I think this is great! Thanks for this! One question - it only displays 1 color on the segment - where real tv (and the fake tv itself) is multiple colors. Does it make sense to have some more colors among the segment?

@Def3nder
Copy link
Contributor Author

Hi @Aircoookie ,
good idea (with the define) - I thought about a kind of algorithm that simlulates the color changes without the need of the "real color data" - maybe we can have two versions: one with the big data from tv_colors.h and another with "only" calcculated ones...

Hi @poblabs ,
yes this uses the whole stripe in one color - target is to simulate a room with a TV inside - so you must not see the TV / the LED-stripe directly - this could easily be seen as "fake TV" then.
...and: if you do not see the light-source directly, it does not matter whether you have one single color or a bunch of them - they will mix to the target color anyway.

As "color-source" I used the pictures from here: https://thecolorsofmotion.com/films
I choose 43 "interesting looking ones" from there and combinded them in one Photoshop picture (each movie one pixel-line) and then cropped a bitmap with 18 movies (500 pixel each) forr the tv_color data.

A python script does read the pixels and converts the 8-bit RGB color to a 2-byte value (5/6/5 bits for RGB).
The effect does convert the colors back and displays them with channging duration (0,25 to 2,5 sec) and with changinf fading (0 to total-duration) and inserts with an 1/3 chance a "direct cut" (no fading at all.

This is basically it. The brightness needs to be adjusted depending on how mach pixels the LED-strip has.
I've tested it with the 316-pixel strip of my son in his room and this was way too bright at 50% brightness.

@poblabs
Copy link

poblabs commented Dec 22, 2020

Thanks for the explanation! I actually own the proper fake tv device and can't wait to check this out - would much rather have the control WLED offers!

@Def3nder
Copy link
Contributor Author

Hi @Aircoookie ,

I looked at your define - this disables only the effect code, but does not prevent the tv_colors.h from being included.
I think we need another ifdef around the "include "tv_color.h" in the header of FX.cpp, don't we ?

@beltracri
Copy link

Hello everyone, I'm not skilled in programming/compiling, is there anyone that can help me to find a .bin file witch include the TV simulator effect?
This maybe a stupid request, I hope that someone can help me!

@Legsmaniac
Copy link

@beltracri The TV Sim Effect is now built in.

@beltracri
Copy link

@beltracri The TV Sim Effect is now built in.
Can't find it in pre compiled .bin release!

@Legsmaniac
Copy link

@beltracri I'm sure Aircookie posted a bin somewhere but then again, it depends what board you want it for.

@beltracri
Copy link

@beltracri I'm sure Aircookie posted a bin somewhere but then again, it depends what board you want it for.

D1 mini, ok, I'll try to search

@Legsmaniac
Copy link

@beltracri Just popped one onto WeTransfer for you - https://we.tl/t-81hBmKXj85

@beltracri
Copy link

@beltracri Just popped one onto WeTransfer for you - https://we.tl/t-81hBmKXj85

Really great!!! Many thanks!

@Legsmaniac
Copy link

@beltracri You're welcome.
Just realised that was the Dev version (alpha) I sent you. It shouldn't be a problem, it does work.
Just in case, I have uploaded the latest Master V12 Beta for you as well - https://we.tl/t-LfcSVgOY6h
Any problems, just holler.
Let us know how you get on.

@beltracri
Copy link

@beltracri You're welcome.
Just realised that was the Dev version (alpha) I sent you. It shouldn't be a problem, it does work.
Just in case, I have uploaded the latest Master V12 Beta for you as well - https://we.tl/t-LfcSVgOY6h
Any problems, just holler.
Let us know how you get on.

Many thanks...
I actually run 11.0, could I update via manual OTA without losing HA and preset settings?

@Legsmaniac
Copy link

You should be able to, yes.
I certainly did.

@beltracri
Copy link

You should be able to, yes.
I certainly did.

I did it... Works like a charm!!!

@Legsmaniac
Copy link

@beltracri Excellent! 😁 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Fake TV LED effect
5 participants