Author Topic: Arcadeflow theme v 17.1 [Release] Updated 22 March 2024  (Read 548414 times)

PrettyPrincess

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
Re: Arcadeflow theme v 2.0 [Release] Updated 17 August 2018
« Reply #90 on: August 20, 2018, 09:29:31 PM »
My goodness. This theme is so beautiful. This deserves a Nobel Peace Prize for art.

In the future, do you plan to add sounds for video previews? Currently, my 480p mp4 files don't play any sound. Unless I have to use a certain type of video format or enable sound somewhere?

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1233
    • View Profile
    • My deviantart page
Re: Arcadeflow theme v 2.1 [Release] Updated 21 August 2018
« Reply #91 on: August 20, 2018, 11:37:26 PM »
Updated to v 2.1!

Fixed some bugs and added some workarounds, improved blur shaders (now with programmable sigma)

Enjoy!

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1233
    • View Profile
    • My deviantart page
Re: Arcadeflow theme v 2.1 [Release] Updated 21 August 2018
« Reply #92 on: August 22, 2018, 02:14:05 AM »
A small experiment I'm doing, to enhance readability for the titles in square tile mode, I tried adding a gradient of the average tile color. Seems to work quite nice.

It's a simple GLSL shader that samples the picture layer and adds an alpha gradient, it's fast but still operating on the full resolution snap is not ideal. There's probably a smarter way to do it (vertex shaders?) but let me know if you like the look...
« Last Edit: October 31, 2019, 03:35:22 AM by zpaolo11x »

calle81

  • Sr. Member
  • ****
  • Posts: 184
    • View Profile
Re: Arcadeflow theme v 2.1 [Release] Updated 21 August 2018
« Reply #93 on: August 22, 2018, 09:59:28 AM »
The context menu is genius. Any chance you could make it into a module so that it could be used easily with other themes? The search function is amazing....

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1233
    • View Profile
    • My deviantart page
Re: Arcadeflow theme v 2.1 [Release] Updated 21 August 2018
« Reply #94 on: August 22, 2018, 10:34:37 AM »
The context menu is genius. Any chance you could make it into a module so that it could be used easily with other themes? The search function is amazing....

Thank you! I got some feedback from a user who asked for more "joystick compliance", so I thought about the context menu :D Most of the cool features I added to the theme come from suggestions from the forum, which is great! And the search function, well that actually is the keyboard search module, but I had to bury it deep in the theme.

The context menu is pretty simple actually, just a picture that pops up and a custom routine in the on_signal function... I have no idea how to code modules, and most of all I fear it's too "intertwined" in the current layout :D (I'm a bad programmer, I know, my code is a mess)

calle81

  • Sr. Member
  • ****
  • Posts: 184
    • View Profile
Re: Arcadeflow theme v 2.1 [Release] Updated 21 August 2018
« Reply #95 on: August 22, 2018, 03:35:41 PM »
I "borrowed" your ambiance code for a new background option in the HyperPie 2 theme. Hope that is ok otherwise I'll remove it!

Anyway, do you know if it is possible to reduce the flickering when using video snaps?

https://www.youtube.com/watch?v=aeIaF-gl1jA&t=44s

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1233
    • View Profile
    • My deviantart page
Re: Arcadeflow theme v 2.1 [Release] Updated 21 August 2018
« Reply #96 on: August 22, 2018, 04:00:31 PM »
I "borrowed" your ambiance code for a new background option in the HyperPie 2 theme. Hope that is ok otherwise I'll remove it!

No problem at all :) Are you using the GLSL shader or the "multiple scaling" code? In AM2.4 if you enable mipmap the latter will look definitely better.

Quote
Anyway, do you know if it is possible to reduce the flickering when using video snaps?

I don't think so, the flickering happens due to the downsampling of the image to a lower resolution. It might be better if the downsampling was smoother (maybe again enabling mipmap?). If I knew GLSL enough to write a shader that first downsamples the image with bilinear filtering and then apply the smoothing it would be much better

calle81

  • Sr. Member
  • ****
  • Posts: 184
    • View Profile
Re: Arcadeflow theme v 2.1 [Release] Updated 21 August 2018
« Reply #97 on: August 23, 2018, 02:49:18 AM »
Is it possible to change how much it down samples? Would like to get the effect Oomek has here https://youtu.be/XGQiUk5uwGw

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1233
    • View Profile
    • My deviantart page
Re: Arcadeflow theme v 2.1 [Release] Updated 21 August 2018
« Reply #98 on: August 23, 2018, 03:33:09 AM »
Is it possible to change how much it down samples? Would like to get the effect Oomek has here https://youtu.be/XGQiUk5uwGw

Oomek shader is much better than mine, but if you paste the code you are using here I'll see what can be done. Essentially if you want a "less blurred" image you should change the size of the prescaled picture, and apply the same amount of blur...

calle81

  • Sr. Member
  • ****
  • Posts: 184
    • View Profile
Re: Arcadeflow theme v 2.1 [Release] Updated 21 August 2018
« Reply #99 on: August 23, 2018, 03:50:28 AM »
Thanks for taking the time to answer my questions. Really appreciate it :) I copy pasted the exact same values you have so it should be the same as in Arcade Flow:

I guess this is the size of the prescaled picture
local smallsize = 32
local blursize = 1/32.0

Is this where I set the amount of blur?

local shaderH1 = fe.add_shader( Shader.Fragment, "gauss_kernsigma.txt" )
shaderH1.set_texture_param( "source")
shaderH1.set_param("kernelZ", 11.0, 2.5)
shaderH1.set_param("offsetFactor", blursize, 0.0)
xsurf1.shader = shaderH1

local shaderV1 = fe.add_shader( Shader.Fragment, "gauss_kernsigma.txt" )
shaderV1.set_texture_param( "source")
shaderV1.set_param("kernelZ", 11.0, 2.5)
shaderV1.set_param("offsetFactor", 0.0, blursize)
xsurf2.shader = shaderV1

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1233
    • View Profile
    • My deviantart page
Re: Arcadeflow theme v 2.1 [Release] Updated 21 August 2018
« Reply #100 on: August 23, 2018, 05:01:00 AM »
Thanks for taking the time to answer my questions. Really appreciate it :) I copy pasted the exact same values you have so it should be the same as in Arcade Flow:

I guess this is the size of the prescaled picture
local smallsize = 32
local blursize = 1/32.0

Is this where I set the amount of blur?

local shaderH1 = fe.add_shader( Shader.Fragment, "gauss_kernsigma.txt" )
shaderH1.set_texture_param( "source")
shaderH1.set_param("kernelZ", 11.0, 2.5)
shaderH1.set_param("offsetFactor", blursize, 0.0)
xsurf1.shader = shaderH1

local shaderV1 = fe.add_shader( Shader.Fragment, "gauss_kernsigma.txt" )
shaderV1.set_texture_param( "source")
shaderV1.set_param("kernelZ", 11.0, 2.5)
shaderV1.set_param("offsetFactor", 0.0, blursize)
xsurf2.shader = shaderV1

Ok, so *smallsize* is the size of the prescaled surface (I guess I could use a vertex shader to do this, but I'm not sure :D ), this is important because it resamples the image and the resampling is a bit harsh, so if you want more detail in the blurred image you can start enlarging this. Also if you add some mipmap=1 parameters to the surface and artworks it should look better.

Then you can modify the parameters in "kernelZ": the first one is the number of samples (pixels) used for the blur, the second one is the sigma of the gaussian blur. Larger sigma means smoother blur because the average is done on more pixels, but to avoid clipping you should always keep the number of samples roughly 4x sigma (and an even number).


calle81

  • Sr. Member
  • ****
  • Posts: 184
    • View Profile
Re: Arcadeflow theme v 2.1 [Release] Updated 21 August 2018
« Reply #101 on: August 23, 2018, 05:41:33 AM »
Ok, awsome!

Got this using this code:

https://youtu.be/z2D9kZcrtWQ

if ( my_config["enable_bg"] == "Ambiance"){
// Picture background definition
local bgpic_x = 0
local bgpic_y = 0
local bgpic_w = flw
local bgpic_h = flh
local bgpic_ar = 1
// Apply color theme
local   themeoverlaycolor = 255
local   themeoverlayalpha = 100
local   themetextcolor = 255
local   themeshadow = 50
local shadeval = 255
local satinrate = 0.9
/// Display construction (BACKGROUND) 
local shadeval = 255
local   snapbg1 = null
local   snapbg2 = null
local xsurf1 = null
local xsurf2 = null
local bg_surface = null
local whitebg = null
local smallsize = 2048
local blursize = 1/256.0
local BGBLURRED = null
// Blurred backdrop definition
local bgx = 0
local bgy = (flh-flw)/2
local bgw = flw

xsurf1 = fe.add_surface(smallsize,smallsize)

snapbg1 = xsurf1.add_artwork ("snap",-smallsize*1/6.0,-smallsize*1/6.0,smallsize*4/3.0,smallsize*4/3.0)
snapbg1.set_rgb (shadeval,shadeval,shadeval)
snapbg1.alpha = 255
snapbg1.mipmap = 1
snapbg1.trigger = Transition.EndNavigation
//snapbg1.video_flags = Vid.ImagesOnly
snapbg1.smooth = true
snapbg1.preserve_aspect_ratio = true
::videoSound <- Vid.NoAudio;
snapbg1.video_flags = videoSound;

snapbg2 = xsurf1.add_artwork ("snap",-smallsize*1/6.0,-smallsize*1/6.0,smallsize*4/3.0,smallsize*4/3.0)
snapbg2.set_rgb (shadeval,shadeval,shadeval)
snapbg2.alpha = 255
snapbg2.mipmap = 1
snapbg2.trigger = Transition.EndNavigation
//snapbg2.video_flags = Vid.ImagesOnly
snapbg2.smooth = true
snapbg2.preserve_aspect_ratio = true
::videoSound <- Vid.NoAudio;
snapbg2.video_flags = videoSound;

xsurf2 = fe.add_surface(smallsize,smallsize)

bg_surface = fe.add_surface(flw,flh)



local shaderH1 = fe.add_shader( Shader.Fragment, "gauss_kernsigma.txt" )
shaderH1.set_texture_param( "source")
shaderH1.set_param("kernelZ", 11.0, 2.5)
shaderH1.set_param("offsetFactor", blursize, 0.0)
xsurf1.shader = shaderH1

local shaderV1 = fe.add_shader( Shader.Fragment, "gauss_kernsigma.txt" )
shaderV1.set_texture_param( "source")
shaderV1.set_param("kernelZ", 11.0, 2.5)
shaderV1.set_param("offsetFactor", 0.0, blursize)
xsurf2.shader = shaderV1

xsurf2.visible = false
xsurf2 = bg_surface.add_clone(xsurf2)
xsurf2.visible = true

xsurf1.visible = false
xsurf1 = xsurf2.add_clone(xsurf1)
xsurf1.visible = true

xsurf2.set_pos(bgx,bgy,bgw,bgw)

local bgpicture = null



   bgpicture = bg_surface.add_image(BGBLURRED,0,0,flw,flh)
   bgpicture.visible = false
   bgpic_ar = (bgpicture.texture_width*1.0) / bgpicture.texture_height

   if (bgpic_ar >= flw/(flh*1.0)){
      bgpic_h = flh
      bgpic_w = bgpic_h * bgpic_ar
      bgpic_y = 0
      bgpic_x = - (bgpic_w - flw)*0.5
   }
   else {
      bgpic_w = flw
      bgpic_h = bgpic_w / bgpic_ar*1.0
      bgpic_y = - (bgpic_h - flh)*0.5
      bgpic_x = 0
   }
   bgpicture=bg_surface.add_image (BGBLURRED,bgpic_x,bgpic_y,bgpic_w,bgpic_h)
   bgpicture.visible=true




   whitebg = bg_surface.add_text("",0,0,flw,flh)
   whitebg.set_bg_rgb(themeoverlaycolor,themeoverlaycolor,themeoverlaycolor)
   whitebg.bg_alpha = themeoverlayalpha
}

calle81

  • Sr. Member
  • ****
  • Posts: 184
    • View Profile
Re: Arcadeflow theme v 2.2 [Release] Updated 23 August 2018
« Reply #102 on: August 23, 2018, 05:44:21 AM »
I still only understand fragments of the code however. :P

Thanks for the help!

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1233
    • View Profile
    • My deviantart page
Re: Arcadeflow theme v 2.1 [Release] Updated 21 August 2018
« Reply #103 on: August 23, 2018, 05:58:16 AM »
Ok, awsome!

Got this using this code:

https://youtu.be/z2D9kZcrtWQ


Looks pretty cool, the only thing I notice is that you put

Code: [Select]
local smallsize = 2048
local blursize = 1/256.0

This means that your texture will be 2048 x 2048 elements, then for each of this pixels the shader will calculate the smoothed value based on pixels that are not adjacent, but about 7 pixels away. This is not an issue in itself, it can generate some artifacts but it's not your case. On the other hand you are calculating way more pixels then necessary and you should try smallsize = 256 which should provide similar results with a lighter calculation.

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1233
    • View Profile
    • My deviantart page
Re: Arcadeflow theme v 2.2 [Release] Updated 23 August 2018
« Reply #104 on: August 23, 2018, 05:59:02 AM »
I still only understand fragments of the code however. :P

I have problems in understanding my code myself LOL :D

Anyway, AF2.2 is out! I love GLSL shaders :D