English Amiga Board Amiga Lore


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 23 January 2015, 15:49   #1
Leandro Jardim
Registered User
Leandro Jardim's Avatar
 
Join Date: Nov 2009
Location: Legoland
Age: 38
Posts: 1,146
Some shader variable that not resets between each WinUAE frame

There is some HLSL value that increases or change between each WinUAE frame, and that simply not resets to 0 or to another value at every frame? Thanks.

Last edited by Leandro Jardim; 23 January 2015 at 16:09.
Leandro Jardim is offline  
AdSense AdSense  
Old 23 January 2015, 20:20   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,518
What are you trying to do?

You can add your own variables to shader files if you want something that keeps its value between frames.

Or do you want some kind of frame counter variable that counts automatically?
Toni Wilen is online now  
Old 25 January 2015, 03:47   #3
Leandro Jardim
Registered User
Leandro Jardim's Avatar
 
Join Date: Nov 2009
Location: Legoland
Age: 38
Posts: 1,146
Quote:
Originally Posted by Toni Wilen View Post
What are you trying to do?

You can add your own variables to shader files if you want something that keeps its value between frames.

Or do you want some kind of frame counter variable that counts automatically?
Nothing dangerous, I think. It will be used only on my home with WinUAE.

I want to make a perlin noise effect for WinUAE, I found the algorithm in the web, but it needs a "time" value which I guess need to be replaced by some kind of frame number or some other random number.

My "problem" is that I dont know if is possible to get the current frame number of the WinUAE display, and when I try to use a random number generator in place, the seed variable is lost at every frame and resets to its default value, which then unfortunately I get an Amiga display with a static perlin noise picture on the screen.

Last edited by Leandro Jardim; 25 January 2015 at 04:31.
Leandro Jardim is offline  
Old 25 January 2015, 13:50   #4
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,518
Not sure if it helps but next beta will have "framecounter" shader float variable that increases by 1 each frame.
Toni Wilen is online now  
Old 26 January 2015, 09:20   #5
Leandro Jardim
Registered User
Leandro Jardim's Avatar
 
Join Date: Nov 2009
Location: Legoland
Age: 38
Posts: 1,146
Thanks Toni.

That will help to give some randomness in dynamic effects.
Leandro Jardim is offline  
Old 03 February 2015, 05:52   #6
Leandro Jardim
Registered User
Leandro Jardim's Avatar
 
Join Date: Nov 2009
Location: Legoland
Age: 38
Posts: 1,146
I downloaded Beta 7, what do I need to access the framecounter variable, if I need something to access it? Please. I am asking because in my tests it doesnt did any difference, I am guessing it is always zero and I am not using it right.

To use it I put at the top:

Code:
extern float framecounter;
I guess its wrong? It does need anything new in the _winuae.fx file?

I am playing with HLSL in WinUAE to give the illusion of more colors in my 16/64 colors "pixellated" Workbench. My plan is to create a simple CRT filter with snippets I found in the net, actually blurring, blooming, color correction, ghosting and static.

Last edited by Leandro Jardim; 03 February 2015 at 06:10.
Leandro Jardim is offline  
Old 03 February 2015, 07:11   #7
Vot
Registered User

 
Join Date: Aug 2012
Location: Australia
Posts: 646
Quote:
Originally Posted by Leandro Jardim View Post
I downloaded Beta 7, what do I need to access the framecounter variable, if I need something to access it? Please. I am asking because in my tests it doesnt did any difference, I am guessing it is always zero and I am not using it right.

To use it I put at the top:

Code:
extern float framecounter;
I guess its wrong? It does need anything new in the _winuae.fx file?

I am playing with HLSL in WinUAE to give the illusion of more colors in my 16/64 colors "pixellated" Workbench. My plan is to create a simple CRT filter with snippets I found in the net, actually blurring, blooming, color correction, ghosting and static.

Sounds interesting.. Post your shader source when you have completed it if you don't mind sharing...
Vot is offline  
Old 03 February 2015, 18:49   #8
Leandro Jardim
Registered User
Leandro Jardim's Avatar
 
Join Date: Nov 2009
Location: Legoland
Age: 38
Posts: 1,146
I think I cant post it here.

Its basically the same shader that EAB user "TysonJacobs" posted here at EAB, but with color correction controls (hue, saturation, brightness and contrast). For now it lacks TV static noise and ghosting. I ran into some "problems", because I tried to implement ghosting but it is occupying too much GPU time on my computer. I dunno why, I must made something wrong with it. So I think I cannot implement ghosting the way I did, or my GPU is too slow for the job, but I think that static noise is very possible.

Everything depends on if TysonJacobs lets me "borrow" his work, he looks to be a so much nice guy, and I dont want to run intro problems with him.

Also, the color correction controls are very imprecise, and sometimes you get very different results from a real CRT. I now understand why Toni blame the color correction algorithms in use today, and wants to wait until he finds a good algorithm for WinUAE.

So I think if I get authorization from "Tyson", I can publish his modified work.

Last edited by Leandro Jardim; 03 February 2015 at 19:01.
Leandro Jardim is offline  
Old 03 February 2015, 19:10   #9
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,518
framecounter only worked in _winuae.fx, not in any other shader files. Fixed in http://www.winuae.net/files/b/winuae.zip
Toni Wilen is online now  
Old 03 February 2015, 19:18   #10
Leandro Jardim
Registered User
Leandro Jardim's Avatar
 
Join Date: Nov 2009
Location: Legoland
Age: 38
Posts: 1,146
Thanks.
Leandro Jardim is offline  
Old 03 February 2015, 23:07   #11
Leandro Jardim
Registered User
Leandro Jardim's Avatar
 
Join Date: Nov 2009
Location: Legoland
Age: 38
Posts: 1,146
Quote:
Originally Posted by Toni Wilen View Post
framecounter only worked in _winuae.fx, not in any other shader files. Fixed in http://www.winuae.net/files/b/winuae.zip
Hmm. There are days that I think in hacking WinUAE source code and add the features that I want, specially things related to GUI and Filters. But I have my own projects that I never start and even some that I never finish.

The main cause is that every code that I compile on my computer is linked with a "spooky" gxx_personality symbol that I dont know from where it comes. No matter what compiler that I use, no matter what code that I compile, it has been like this, since the beginning.

That symbol and others that are linked by Windows or the compiler (?!) seems to be the cause of all the problems I have with Windows and my projects.
Leandro Jardim is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Black Frame insertion like WinUAE on real amiga ancalimon support.Apps 0 09 December 2014 12:42
Please help me with my shader! tjcbs support.WinUAE 3 02 February 2013 21:49
Join variable and string in scripts. olesio support.Apps 3 31 January 2013 11:44
NTSC variable-length scanlines TheDarkCoder Coders. Asm / Hardware 3 23 November 2011 15:51
Variable Master Clock wiltshireguyuk request.UAE Wishlist 0 13 December 2004 16:40

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 22:15.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.17957 seconds with 11 queries