English Amiga Board


Go Back   English Amiga Board > Support > support.FS-UAE

 
 
Thread Tools
Old 10 July 2017, 22:45   #21
FrodeSolheim
FS-UAE Developer
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 40
Posts: 3,814
I didn't really plan to anytime soon, but it isn't out of the question to write new shader code support to support the new libretro shader specification...
FrodeSolheim is offline  
Old 08 December 2020, 11:01   #22
kokoko3k
Registered User

 
Join Date: Nov 2020
Location: italy
Posts: 14
Hi,
I'm a n00b in shader development, but i'm still trying hard to make one, so please, excuse my inexact terminology!

What puzzles me now, is that i need to make a multipass shader which should able to draw perfect pixels at fixed window coordinates.
Actually, i'm able to write a single pixel on my monitor using gl_FragColor only in the last pass.

In the following test example:
* the first pass does nothing
* the second pass draws 3 RGB vertical lines starting at row 100
* the third and last pass draws 3 white/black/white vertical lines starting at row 400

If you resize the FS-UAE window, you'll see that
1) the RGB vertical lines mantain a fixed position relative to the amiga screen and are scaled.
2) the white/black/white vertical lines mantain a fixed position relative to the FS-UAE window, and are not scaled, so pixel perfect.

I'd like to have the RGB lines rendered by the second pass to act like the ones rendered by the second one.

Is that possible?
I'm struggling with this problem and even got the xml v1.1 shader docs from the wayback machine, but i'm unable to go on and i'm starting to think that the spec and/or the implementation basically won't allow that.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<shader language="GLSL">

<fragment ><![CDATA[
	uniform sampler2D rubyTexture;
	void main(void) {
		vec3 pixel = texture2D(rubyTexture, gl_TexCoord[0].xy).rgb; 
		gl_FragColor = vec4(pixel,1.0);
	}
]]></fragment>
    

<fragment ><![CDATA[
	uniform sampler2D rubyTexture;
    void main(void) {
        vec3 pixel = texture2D(rubyTexture, gl_TexCoord[0].xy).rgb; 
		float start=100.0;
		float col = float(int(gl_FragCoord.x));
		if ( col  == (start+1.0) ) {
			pixel = vec3(1.0,0.0,0.0);
		}
		if ( col  == (start+2.0) ) {
			pixel = vec3(0.0,1.0,0.0);
		}
		if ( col  == (start+3.0) ) {
			pixel = vec3(0.0,0.0,1.0);
		}
			gl_FragColor = vec4(pixel,1.0);
    }
]]></fragment>


<fragment ><![CDATA[
	uniform sampler2D rubyTexture;
    void main(void) {
        vec3 pixel = texture2D(rubyTexture, gl_TexCoord[0].xy).rgb; 
		float start=400.0;
		float col = float(int(gl_FragCoord.x));
		if ( col  == (start+1.0) ) {
			pixel = vec3(1.0,1.0,1.0);
		}
		if ( col  == (start+2.0) ) {
			pixel = vec3(0.0,0.0,0.0);
		}
		if ( col  == (start+3.0) ) {
			pixel = vec3(1.0,1.0,1.0);
		}
			gl_FragColor = vec4(pixel,1.0);
    }
]]></fragment>
Any hint?


Thanks!


-EDIT-
...Took me a lot to get it; it was the outscale* shader parameter

Last edited by kokoko3k; 10 January 2021 at 09:52.
kokoko3k is offline  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Corrected shaders for WinUAE guest.r support.WinUAE 402 13 March 2021 16:08
HLSL/CG Shaders and xBR Enverex support.FS-UAE 11 19 July 2013 16:44
fx Shaders in WinUAE 2.6.0 crazy46guy support.WinUAE 8 16 June 2013 14:30
Sites with Intensity Masks Or Even Some Shaders... Leandro Jardim support.WinUAE 3 16 February 2013 05:38
Using shaders with FS-UAE on Ubuntu [Solved] DaveMB support.FS-UAE 2 14 October 2012 15:46

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 01:32.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.09320 seconds with 15 queries