Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - zpaolo11x

Pages: 1 ... 31 32 [33] 34 35 ... 41
Scripting / Re: looking for shaders help
« on: September 03, 2018, 08:42:30 AM »
You mean you want to apply an image (or a surface) with no color data on top of your layout and have the shader applied to whatever is "behind" that surface/image? That would be neat, wondering if using gl_Color to pick the texture color could do the trick, have to try that...

Scripting / Nested surfaces and speed of update
« on: September 03, 2018, 08:40:23 AM »
I built a simple layout with some examples of nested surfaces. If I run it on my PC I get 60 fps with case 1 (just a single surface), 30 fps with case 2 (two nested surfaces) and about 15 to 20 fps with case 3 (three nested surfaces). You can change the level of "nestyness" in the layout option, I'd like to know how it performs on other machines.

In the past I used some tricks to speed up scrolling in this situations (adding and updating a text item for example) but now I really want to know what is happening and how to speed things up.

Hope someone can help!

Scripting / GLSL shader: how to "downsample" an image?
« on: September 03, 2018, 12:31:46 AM »
Some filters (like blur filters ;) ) work best with a reduced texture size, for example a gaussian blur on a 128x128 pixel image can be smoother with few semples, while the same gaussian blur on a 512 x 512 pixel image requires a lot of samples. In AM I use this trick of adding the 512x512 image on a 128x128 surface, then apply the shader on the surface and rescale it to the desired size.

I'm quite sure that there's a way to write a GLSL shader (vertex?) that downsamples the image before rasterizing it, but I cant' find it, except the use of mipmaps that is so good but doesn't work on my mac :D

Any idea?

Themes / Re: Arcadeflow theme v 2.3 [Release] Updated 29 August 2018
« on: September 01, 2018, 01:06:50 AM »
also was wondering went through the opitions,  and did not see how to use the new pixel back ground?
maybe im blind to it.... 

The options is in the "BACKDROP" section: "Background snap" enables the pixelated snaps, "Animate background snaps" uses videos instead of static pictures. Let me know if it works

Themes / Re: Arcadeflow theme v 2.3 [Release] Updated 29 August 2018
« on: September 01, 2018, 12:57:57 AM »
ill explor to see how i can do it,  if you have any quick help on wear to go in the script
that would be cool... thanx...

I see, just find in the layout.nut this two lines:

Code: [Select]
local header_h = 200*scalerate
local footer_h = 100*scalerate

They define the height of the header and footer, then the size of the thumbs is calculated accordingly. Consider that internally the theme considers a vertical size of 1200, so 200 for the header, 900 for the thumbs, 100 for the footer. Everything is then scaled to your screen resolution. Play with those two numbers.

after thought...your pics loo more even..  i think i might be missing som of the info to display?

I think you are missing some information about the games: the title name for example looks like the rom name, while it should be longer (and broken into two lines, therefore more even). Also manufacturer and year data is missing, try rescan your library from attract mode menus...

Themes / Re: Arcadeflow theme v 2.3 [Release] Updated 29 August 2018
« on: August 31, 2018, 01:42:33 PM »
Whops there was a mistake in the latest archive, an old shader for the glow that didn't enable alpha channel. Corrected in the first post, now the archive is up to date.

Scripting / Shader for sharper pixel upscaler
« on: August 29, 2018, 11:59:46 PM »
I found this site with a neat GLSL fragment shader : it implements a way to enlarge a low resolution, high contrast image obtaining better pixels definition.

It's very clever: when a low resolution image is rendered you usually get linear interpolation between the color values, which looks pretty bad in high contrast pictures (star shaped artifacts). This filter alters the texture coordinate that you are sampling so to reduce and smooth the transition between the color samples. You can apply it to your image using the code below where "texture" is the image, and "resol" is a vector of the picture pixel size (width , height).

To give you an idea I attach a sample with bilinear filtered image on the left, shader filtered image in the middle and original high resolution image on the right (the effect is more visible on low res images so I downsampled the image before)

Code: [Select]
uniform sampler2D texture;
uniform vec2 resol;

void main()

    vec2 uv = gl_TexCoord[0].xy;

    uv = uv*resol + 0.5;

    vec2 i = floor(uv);
    vec2 f = uv - i;
    f = f*f*f*(f*(f*6.0-15.0)+10.0);
    uv = i + f;
    uv = (uv - 0.5)/resol;

    gl_FragColor = texture2D(texture, uv);


By editing the f = f*f*f*(f*(f*6.0-15.0)+10.0); part you can have a sharper effect or a different transition shape.

Themes / Re: Arcadeflow theme v 2.3 [Release] Updated 29 August 2018
« on: August 29, 2018, 07:48:40 AM »
Just released Arcadeflow 2.3 with a lot of cosmetic improvements, see in the attachment how you can add glow around the thumbs or pixellated background. And also redesigned the options menu for more clarity...

Themes / Re: Frostbite
« on: August 29, 2018, 12:06:44 AM »
A very simple and basic theme using zpaolo11x's scripts for background blur and soft drop shadows.  Thanks zpaolo11x.

You're welcome :) Very clean and very stylish theme, I like the way you used the shader to get drop shadows that follow the image aspect ratio.

Themes / Re: Arcadeflow theme v 2.2 [Release] Updated 23 August 2018
« on: August 27, 2018, 02:15:55 AM »
For the release of AF2.3 I have done a lot of tweaking of filters to improve performances. On my Mac the improvement is pretty good, on Windows I'm still trying to understand what sometimes slows down the system. Maybe GLSL shaders using OpenGL 1.2 are not suitable for recent cards?

Anyway I'm also playing with a new aesthetic, which will be optional of course, of adding a faded, pixellated game screen on the background. And it can be animated too. This is a bit outside the original spirit of this theme, but this screenshot looks so neat :D

Scripting / Re: Framerate counter
« on: August 26, 2018, 09:44:29 AM »
Perhaps we roll this into a plugin? Willing to add it to my debug plugin?

It's a nice idea but I don't know how to program plugins :( If it's not too difficult I can do it for sure

Scripting / Framerate counter
« on: August 25, 2018, 02:13:23 AM »
There's probably a better way to see if a theme is smooth or not, but this small code allowed me to track the performance of my theme while adding lots and lots of shaders...

Code: [Select]

local monitor = fe.add_text ("",0,0,fe.layout.width,100)
monitor.align = Align.Centre
monitor.set_bg_rgb (255,0,0)
monitor.charsize = 50

local monitor2 = fe.add_text ("",0,0,1,1)
local monitor_tick0 = 0
local monitor_x0 = 0


function monitortick(tick_time){
monitor2.x ++
if (monitor2.x - monitor_x0 == 10) {
monitor.msg = 10000/(tick_time - monitor_tick0)
monitor_tick0 = tick_time
monitor_x0 = monitor2.x

if (monitor2.x >= flw) {
monitor2.x = 0
monitor_x0 = 0

You can add it at the end of your layout, it will create a red banner on the top with a number reporting the current frame rate. It works like this: every tick_callback it moves a text object by one pixel, once the object has moved 10 pixels it calculates the time taken. Ideally if you are on a 60Hz screen you should get a pixel movement every 1/60 of a second and on this basis the framerate is calculated and displayed.

Scripting / Re: mipmap = 1 is a game changer!
« on: August 24, 2018, 09:11:59 AM »
Ok, on my Mac mimap works, but the GLSL shader I wrote that uses textureLod or texture with bias to sample the mipmap doesn't seem to work :( If I place #version 130 and up in the header it says version 130 is not supporte, only up to 120, but my macbook should support up to OpenGL 4.1 :/ I'm probably doing something wrong :(((

Scripting / Re: mipmap = 1 is a game changer!
« on: August 24, 2018, 03:18:16 AM »
Speaking of this, what is the fastest way to obtain an "average" color value for a texture? In my current GLSL fragment shader I sample 9 points of the texture image and get the average value, this is far from perfect since for every pixel of the image I have to sample 9 points, that are always in the same positions :D

So I thought I could sample just 1 point per pixel, but on a mipmap level that is high enough so that this single pixel is the average of the texture color. This means though that I need to go to a mipmap level of around 10 or 11 to be sure that even large images get averaged properly (a 1024x1024 texture with mipmap 10 is 1x1 pixel).

I'm sure that's a better way to do this, maybe with a vertex shader, but I'll do some tests to see which of those method is the fastest.

Scripting / mipmap = 1 is a game changer!
« on: August 24, 2018, 01:37:40 AM »
Not only mipmap = 1 improves dramatically the scaling of pictures, but when a GLSL fragment shader is applied to an image with mipmap enabled the fragment shader can sample the desired mipmap level! This is a godsend for smoothnig and blurring filters, and also for averaging and in all those cases where it's better to work with a lower resolution image that is then upscaled. Definitely very cool!

The only issue is what happens on AM 2.3? Is it time to ditch the old good guy and develop only for AM 2.4+? Also, there's probably a way to pass mipmaps to the fragment shader through a vertex shader, but I'm not good enough at GLSL ;D

Pages: 1 ... 31 32 [33] 34 35 ... 41