AnimDesk - low-resource, 30-60FPS graphical animations

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
firace
Addict
Addict
Posts: 899
Joined: Wed Nov 09, 2011 8:58 am

AnimDesk - low-resource, 30-60FPS graphical animations

Post by firace »

A tiny demo of super-smooth graphical animation and video playback, right on the Windows desktop (wallpaper style).
Compiled using the new C backend for better performance! I'm especially Interested in getting feedback on graphical performance (is it smooooth?) and CPU usage.

OS: Windows 8 and higher

Screenshot:

Image

Download (55KB)

GFX credits: Roman De Giuli
Last edited by firace on Mon Jun 28, 2021 9:35 am, edited 3 times in total.
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1243
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Re: AnimDesk

Post by Paul »

Quite high CPU usage on a high end desktop and is not DPI aware so it only displays on a small portion of the desktop.
Also don't know how to stop it other than to kill process which then leaves the desktop in a bit of a mess (not restored back to original)

Is it just playing a video from YouTube?
Image Image
firace
Addict
Addict
Posts: 899
Joined: Wed Nov 09, 2011 8:58 am

Re: AnimDesk

Post by firace »

Paul wrote: Sat Jun 26, 2021 6:49 pm Quite high CPU usage on a high end desktop and is not DPI aware so it only displays on a small portion of the desktop.
Also don't know how to stop it other than to kill process which then leaves the desktop in a bit of a mess (not restored back to original)

Is it just playing a video from YouTube?
Thanks for testing it! I've just posted a new release, with a fix for high-DPI displays.
The animation should now cover the entire screen, run much smoother and with lower CPU (about 7-10% usage on my low-end system). You can close the program by right-clicking the tray icon then closing the Information window.

There are currently 2 animations, selected at random when the program starts. One is a 60FPS Youtube video and the other one is a WebGL 3D city flyover.

The program is just an experimental demo at this time - Not sure yet if I will further develop it.
User avatar
Mijikai
Addict
Addict
Posts: 1360
Joined: Sun Sep 11, 2016 2:17 pm

Re: AnimDesk

Post by Mijikai »

If the desktop is a mess upon exit you can try drawing on your own window (by making it a child window) which should solve the issue.
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1243
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Re: AnimDesk

Post by Paul »

Ok, didn't notice the tray icon since it shows as a small green checkmark on both Win10 and Win8.1
On Win7 it shows as a small folder with a green plus sign but nothing is ever displayed on the screen.

On both Win8 and Win10 the video is now displayed on the entire desktop. On a regular monitor the display looks pretty cool but on a 4K monitor with 150% DPI scaling it looks very blocky and pixelated. It looks like it's picking a low res video and just scaling it up instead of picking an HD or 4K video stream. CPU usage is anywhere between 15% and 30%

It would not display the WebGL 3D city flyover. It just sits there at "Initializing".

Just a small note... it should not allow me to start multiple copies of the app ;)



EDIT: just updated to latest version of Win10 and CPU is now between 10% - 13% on first run then going up to 18% - 20% when video finishes and restarts.
I'm also assuming the black bars on the top and bottom of video are due to aspect ratio of the video and your app only stretches the width (with height keeping proper ratio of video)
Image Image
Cyllceaux
Enthusiast
Enthusiast
Posts: 458
Joined: Mon Jun 23, 2014 1:18 pm
Contact:

Re: AnimDesk

Post by Cyllceaux »

I had to change the gl file, so it can run in the browser.
But it will not run on the background.


Code: Select all

<head>
  <meta charset="UTF-8">
  <style> 
  body{padding:0px; margin:0px; overflow:hidden;}
  </style>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/110/three.min.js">
  </script>
  <script src="https://code.jquery.com/jquery-3.5.0.js"></script>
</head>
<body>

<div id="WebGL-output"></div>
<!-- partial -->


<script>
$(function (){
  var scene = new THREE.Scene();
  var camera = new THREE.PerspectiveCamera(45, window.innerWidth /     window.innerHeight, 0.1, 1000);
  var renderer = new THREE.WebGLRenderer();
  renderer.setSize(window.innerWidth, window.innerHeight);
 
  renderer.setClearColor(new THREE.Color(0x2e7c95,1.0)); 
  scene.fog = new THREE.FogExp2( 0x3690ae, 0.0085 );
  
  var groundGeo = new THREE.PlaneGeometry(400,400,4,4);
  var groundMat = new THREE.MeshPhongMaterial({color:0x244876});
  groundMat.shininess = 100;
  var ground = new THREE.Mesh(groundGeo,groundMat);
  scene.add(ground);
  ground.position.x = 140; 
  ground.position.y = 0; 
  ground.position.z = -150; 
  ground.rotation.x = -1.55;
  
  camera.position.x = 0; 
  camera.position.y = 25; 
  camera.position.z = 0; 
  
  camera.rotation.y = -0.785398163;
  camera.rotation.z = -0.280;
  camera.rotation.x = -0.400;
  
  var directionalLight = new THREE.DirectionalLight( 0xffffff, 1 ); 
  directionalLight.position.set( -20, 10, 30 ); 
  scene.add( directionalLight );
  
  var pointLight = new THREE.PointLight( 0xff0000, 10, 100 );
  scene.add(pointLight);
  
  var monolith = [];
  var monolithGeo = new THREE.CubeGeometry( 4,4,4); 
  var monolithMat = new THREE.MeshPhongMaterial( {color: 0x244876}); 
  monolithMat.shininess = 100;
  var monolithRow = [];
  var rowZ = 0;
  
  for (r=0; r<35; r++){
    rowZ -= 10;
    
    for (i=0; i<35; i++){
      monolith[i] = new THREE.Mesh(monolithGeo, monolithMat); 
      monolith[i].position.x = i*10; 
      monolith[i].position.y = 0; 
      monolith[i].position.z = rowZ; 
    
      var rand = Math.ceil(Math.random()*10);
      monolith[i].scale.y = rand;
      scene.add(monolith[i]); 
    }
  }
  
  render();
  
  function render(){
    requestAnimationFrame(render);
    
    camera.position.z -= 0.1;
    camera.position.x += 0.1;
    pointLight.position.set(camera.position.x,camera.position.y,camera.position.z);
    
    renderer.render(scene, camera);
  };
  
  $("#WebGL-output").append(renderer.domElement);
 
  
});
</script>

</body>

firace
Addict
Addict
Posts: 899
Joined: Wed Nov 09, 2011 8:58 am

Re: AnimDesk

Post by firace »

Paul wrote: Sun Jun 27, 2021 2:34 pm Ok, didn't notice the tray icon since it shows as a small green checkmark on both Win10 and Win8.1
On Win7 it shows as a small folder with a green plus sign but nothing is ever displayed on the screen.

On both Win8 and Win10 the video is now displayed on the entire desktop. On a regular monitor the display looks pretty cool but on a 4K monitor with 150% DPI scaling it looks very blocky and pixelated. It looks like it's picking a low res video and just scaling it up instead of picking an HD or 4K video stream. CPU usage is anywhere between 15% and 30%

It would not display the WebGL 3D city flyover. It just sits there at "Initializing".

Just a small note... it should not allow me to start multiple copies of the app ;)



EDIT: just updated to latest version of Win10 and CPU is now between 10% - 13% on first run then going up to 18% - 20% when video finishes and restarts.
I'm also assuming the black bars on the top and bottom of video are due to aspect ratio of the video and your app only stretches the width (with height keeping proper ratio of video)
I just posted a new release with the following changes:

- Tray icon fixed
- Fixed the video quality issue on large displays (hopefully)
- For the city flyover effect, make sure the city.gl file is in the same folder as animdesk.exe
- A new animation has been added (colors in nature video)
- Now the program can also be terminated using this keyboard shortcut: Shift+Esc
- Note that windows 7 is not supported (I've just updated the first post with this information)
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1243
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Re: AnimDesk - low-resource, 30-60FPS graphical animations

Post by Paul »

I can see the city animation now, pretty cool !!

The videos are still not good quality on 4K monitor. Watching directly from YouTube they look great.
Image Image
firace
Addict
Addict
Posts: 899
Joined: Wed Nov 09, 2011 8:58 am

Re: AnimDesk - low-resource, 30-60FPS graphical animations

Post by firace »

Paul wrote: Mon Jun 28, 2021 2:34 pm I can see the city animation now, pretty cool !!

The videos are still not good quality on 4K monitor. Watching directly from YouTube they look great.
About video quality: I don't have a 4K monitor to reproduce the issue, but sometimes YouTube insists on playing low-res streams due to an invalid cookie. So It could help to clear the system webview cookies by running this PB one-liner:

Code: Select all

RunProgram("RunDll32", "InetCpl.cpl,ClearMyTracksByProcess 258", "") 
Might be worth a shot to see if it resolves the quality issue.
firace
Addict
Addict
Posts: 899
Joined: Wed Nov 09, 2011 8:58 am

Re: AnimDesk - low-resource, 30-60FPS graphical animations

Post by firace »

Added: a couple new backgrounds.

Image
Image
User avatar
tft
User
User
Posts: 84
Joined: Mon Dec 29, 2008 9:34 am

Re: AnimDesk - low-resource, 30-60FPS graphical animations

Post by tft »

Great tool. On my 7 year old i5 with 3 monitors and a GTX Titan also 7 years old. It works great. Only the selection of the monitor is not correct. The middle monitor is number 1. I would be very interested in this tool. I hope you make it a public tool.

TFT
TFT seid 1989
Aktuelles Projekte : Driving School Evergarden
YouTube : Pure Basic to go
FaceBook : Temuçin SourceMagic Games
DISCORD : SourceMagic
W10 , i9 9900K ,32 GB Ram , GTX Titan , 3 Monitore FHD
ARDUINO Freak :-)
firace
Addict
Addict
Posts: 899
Joined: Wed Nov 09, 2011 8:58 am

Re: AnimDesk - low-resource, 30-60FPS graphical animations

Post by firace »

tft wrote: Sun Jul 18, 2021 6:42 pm Great tool. On my 7 year old i5 with 3 monitors and a GTX Titan also 7 years old. It works great. Only the selection of the monitor is not correct. The middle monitor is number 1. I would be very interested in this tool. I hope you make it a public tool.

TFT
Thanks for the nice feedback TFT. I haven't yet decided what to do with this program, as I am busy with many other projects currently. Hopefully I will further develop it when I have more time - meanwhile I will try add a few more videos/webGL scenes from time to time.

Regarding multi-monitor support, I unfortunately can't test/fix this as I have only one monitor.
firace
Addict
Addict
Posts: 899
Joined: Wed Nov 09, 2011 8:58 am

Re: AnimDesk - low-resource, 30-60FPS graphical animations

Post by firace »

New version, with some new FX! All effects are located within the Effects folder.

Image

Example command:
animdesk.exe effects\hypnotic\main.fx

Notes:
- Effects cannot be loaded from the GUI for now.
- Some effects are more CPU intensive than others, but most should be running pretty smoothly, even on low-end systems
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: AnimDesk - low-resource, 30-60FPS graphical animations

Post by BarryG »

Sorry to report this, but "animdesk.exe" just shows a dark screen with "This video is unavailable" on it.
firace
Addict
Addict
Posts: 899
Joined: Wed Nov 09, 2011 8:58 am

Re: AnimDesk - low-resource, 30-60FPS graphical animations

Post by firace »

BarryG wrote: Sun Nov 26, 2023 3:03 am Sorry to report this, but "animdesk.exe" just shows a dark screen with "This video is unavailable" on it.
If you try again a few times (eg 4-5 times), it should eventually work. The application loads a random animation/video from a list at startup, but some of the animations no longer exist, which cause the "video unavailable" message. I will try to update the package soon.

Or you can just manually specify a local animation at the command line - for instance:

Code: Select all

path-to\animdesk.exe path-to\effects\ocean\demo\main.fx  
Obviously, "path-to" must be replaced by the actual path on your system

Note: no admin rights required
Post Reply