You are browsing as a guest. Sign up (or log in) to start making projects!

Bad Apple!! but it runs on your screen

  • 5 Devlogs
  • 14 Total hours

Not only a new version of the Bad Apple videoclip but a complete real-time shader-powered postprocessing layer with builtin video decoding for Linux!

Ship #1 Pending review

I made a postprocessing layer that runs on top of your screen in real time. I've used it to create my own version of the Bad Apple videoclip, but this tool is a lot more powerful!! It gives you access to fast video decoding, a screen buffer and the huge potential of GLSL shaders to allow you to create any effect you want while still keeping the input layer active!
Built on pure C and its currently only available on Linux (only supports X11 backend as thats what is used to manually create the screen buffer, maybe ill add wayland in the future)
Hope you like it!!

  • 5 devlogs
  • 14h
Try project → See source code →
Open comments for this post

2h 7m 32s logged

BAD APPLE!! (NOW PUBLISHED)

the video is published on youtube!!!!!

Check it out: https://youtu.be/a1_1RXaRt74. Please go like it so it get viral!

What was done?

  • I’ve improved the performance by only collecting each window information’s only when they are marked as changed, this improved performance so much that i was able to run some games while using it

  • Added a simple command line argument parser for quick settings and path changes

  • Ive also added some cool C math optimizations like approximating a division by 255 with a cool bit shift trick! (i felt like a genius programmer)

What needs to be improved

  • There’s a couple things that still run in the CPU that could be pretty much moved to the GPU if they cause a bottle neck, maybe in the future??

  • Need to make sure that new/closed or resized windows are accounted and properly updated, this is the next step, ive tried already but this adds a lot of lag and i didnt like how it was looking, but maybe now ill try again!

PD: PLEASE :pls: :pls: go watch the final version: https://youtu.be/a1_1RXaRt74

Btw, im probably gonna be shipping shortly, maybe after next devlog?

0
0
8
Open comments for this post

3h 19m 35s logged

BAD APPLE!!

This is the first decent version! I still need to fix a couple things but finally using your computer with this on wont give you an epileptic attack. Note that what you see in the video is very simple, this program i made is a lot more powerful (this is not only for bad apple videos but a general postprocessing realtime layer on your screen!!)

New stuff! :yay:

  • Completely moved the project from GLFW to SDL3!

  • Fixed the feeding loop bug: refactored the capturer so instead of taking a screenshot every frame it now loops with X11’s backend through all the windows and reconstructs the screen buffer manually (this took a lot of docs reading time), the result is really good but has limitations that i will list below

  • Appart from the effect you see, ive also coded 2 other shaders that also use this video

  • Published the github repo and added both a license and a readme file

Current limitations

  • This only works on Linux with X11 backend, if you use wayland, windows or mac this should not work at all, adding support to new platforms would be interesting, but before i need to fix the next issue

  • The current system that reads all windows and stitches them together to form a screen buffer doesnt take into consideration new or closed windows and doesnt update their position or resizing… this will probably be the next thing to do but ill have to check how the performances doing.

Of course i will be making a video for youtube to showcase this, this was the main goal of the project either way lmao

0
0
26
Open comments for this post

3h 37m 3s logged

BAD APPLE!!

:siren1: the demo video contains flashing colors!! :siren1:

Huge progress!!!!! i made this work finally! well not quite yet but ive finally have something to show you :yay: Theres still some issues you can clearly see but i do know why this is happening

Why it currently looks broken?

In order to get the screen buffer i need to use X11 (currently, maybe ill port it to use other different APIs) which means that this is pretty much like taking a screenshot every frame but very fast because its the GPU. The problem is that we are re-feeding the previous output to the new one, so it breaks the original colors over time

What have i done

  • X11 based system to retrieve the screen’s image and pass it to the shader as another texture!

  • Performance was improved a bit although it generally doesnt really matter (maybe it will when using videos over 1080p, havent tried tho)

  • Fixed A SINGLE memory leak, woops

Next steps!

Port the project to SDL3, i always start my projects with GLFW and always forget how much i dislike GLFW, it has so many tools and features missing that SDL has, so ill probably port it to it, it shouldnt be very hard

7
0
363
Open comments for this post

2h 38m 12s logged

BAD APPLE!!

I’ve been adding the basic OpenGL implementations for a very simple texture and shader “classes” (theres no such thing as a class in C of course). This works kind of like a refresher course for me as I already though I was proficent enough with opengl, maybe once i ship this i might try to re do this but using vulkan :fear: instead.

What have i added?

  • The shader class, which reads the glsl source files (not pre-compiled) and compiles them in real time, not very fancy right now

  • A texture class that updates in real time to what frame was given by the video section, correctly set to linear color correction and uses rgb24

Now i will add a super simple quad implementation where the shader will render to, on top of the screen buffer

What i still need to figure out

I dont think that OpenGL can get the screen buffer with the pixel colors of whats behind the screen, even when the glfw window is entirely transparent, I’ll do some more research to see what to do


I’ve thought that this program might actually be a lot more useful that what im currently making it look. In the end you can quickly change the glsl shader to have completely different results and also upload any kind of video you want…

PD: the window you see in the video is green just so you can see it at all, but in the final version it will be completely transparent

0
0
22
Open comments for this post

2h 17m 20s logged

Bad Apple!!

Hey!!! :hello: I’m making this quick project that i though would be fun to try and have a bit of a rest from my main project, and i think it started nicely!

What is this project?

I’m making one of those fun version for the original Bad Apple! music videoclip that got viral long ago (original: https://www.youtube.com/watch?v=FtutLA63Cp8). I want it to be very original, at least I dont think it has been done already…


I cant really tell you what the video is about yet, but I can tell you that im building it with pure C and openGL…

What have i done so far?

  • Project setup: create a basic cmake project that uses glad and glfw to create a special window and render basic stuff on top of it

  • Added a video reader that gets each frame of the video at the correct time based on the time elapsed

I started this project making it run in CUDA, but I had a better idea. Then i decided to go with the graphics programming route: i thought about using vulkan but its way too hard to setup for such a small project, even worse considering im using C, not C++. I will have to learn vulkan at some point tho

note: the video is the base for the whole program

0
0
19

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…