Previous Thread
Next Thread
Print Thread
Page 9 of 9 1 2 3 4 5 6 7 8 9
#78724 - 04/27/12 04:00 AM Re: SHADER PRESET ONE-STOP SHOP [Re: Just Desserts]  
Joined: Sep 2011
Posts: 28
Hunk Offline
Member
Hunk  Offline
Member

Joined: Sep 2011
Posts: 28
Thanks dude! I'll give that a shot smile

#79550 - 05/25/12 09:16 PM Re: SHADER PRESET ONE-STOP SHOP [Re: Just Desserts]  
Joined: Sep 2011
Posts: 28
Hunk Offline
Member
Hunk  Offline
Member

Joined: Sep 2011
Posts: 28
I have another question. Is it possible to fill a little more of the screen when using hlsl? For example I'm using a widescreen LCD monitor and the image only fills the middle of the screen. Which isn't bad it looks great! Just wish it would fill the sides of the screen a little more frown

#79551 - 05/25/12 09:19 PM Re: SHADER PRESET ONE-STOP SHOP [Re: Just Desserts]  
Joined: Mar 2001
Posts: 15,710
R. Belmont Offline
R. Belmont  Offline

Very Senior Member

Joined: Mar 2001
Posts: 15,710
USA
The problem is that if it filled out the screen more you'd be distorting the original game and making everything in it wider. (I call this "fatty Chun-Li syndrome" ;-) If you really want to live in Obese World, turn off "keep aspect ratio" though.

#79552 - 05/25/12 10:29 PM Re: SHADER PRESET ONE-STOP SHOP [Re: Just Desserts]  
Joined: Sep 2011
Posts: 28
Hunk Offline
Member
Hunk  Offline
Member

Joined: Sep 2011
Posts: 28
Ah well I didn't really think about it. Thanks for the advice! smile

#81406 - 09/10/12 06:34 PM Re: SHADER PRESET ONE-STOP SHOP [Re: Just Desserts]  
Joined: Sep 2011
Posts: 28
Hunk Offline
Member
Hunk  Offline
Member

Joined: Sep 2011
Posts: 28
Any new tweaks? laugh

#88994 - 06/11/13 12:27 PM Re: SHADER PRESET ONE-STOP SHOP [Re: Just Desserts]  
Joined: Feb 2008
Posts: 42
gigadeath Offline
Member
gigadeath  Offline
Member

Joined: Feb 2008
Posts: 42
Originally Posted By Just Desserts
Scale2x, same dance, copy over top of deconverge.fx:

Code:
//-----------------------------------------------------------------------------
// Scale2x Effect
//-----------------------------------------------------------------------------

texture Diffuse;

sampler DiffuseSampler = sampler_state
{
	Texture   = <Diffuse>;
	MipFilter = POINT;
	MinFilter = POINT;
	MagFilter = POINT;
	AddressU = CLAMP;
	AddressV = CLAMP;
	AddressW = CLAMP;
};

//-----------------------------------------------------------------------------
// Vertex Definitions
//-----------------------------------------------------------------------------

struct VS_OUTPUT
{
	float4 Position : POSITION;
	float2 TexCoord : TEXCOORD0;
	float2 LeftCoord : TEXCOORD1;
	float2 RightCoord : TEXCOORD2;
	float2 TopCoord : TEXCOORD3;
	float2 BottomCoord : TEXCOORD4;
};

struct VS_INPUT
{
	float4 Position : POSITION;
	float4 Color : COLOR0;
	float2 TexCoord : TEXCOORD0;
};

struct PS_INPUT
{
	float2 TexCoord : TEXCOORD0;
	float2 LeftCoord : TEXCOORD1;
	float2 RightCoord : TEXCOORD2;
	float2 TopCoord : TEXCOORD3;
	float2 BottomCoord : TEXCOORD4;
};

//-----------------------------------------------------------------------------
// Scale2x Vertex Shader
//-----------------------------------------------------------------------------

float TargetWidth;
float TargetHeight;

float RawWidth;
float RawHeight;

VS_OUTPUT vs_main(VS_INPUT Input)
{
	VS_OUTPUT Output = (VS_OUTPUT)0;
	
	Output.Position = float4(Input.Position.xyz, 1.0f);
	Output.Position.x /= TargetWidth;
	Output.Position.y /= TargetHeight;
	Output.Position.y = 1.0f - Output.Position.y;
	Output.Position.x -= 0.5f;
	Output.Position.y -= 0.5f;
	Output.Position *= float4(2.0f, 2.0f, 1.0f, 1.0f);

	float2 PixWidth = float2(1.0f / RawWidth, 0.0f);
	float2 PixHeight = float2(0.0f, 1.0f / RawHeight);

	Output.TexCoord = Input.TexCoord;
	Output.LeftCoord = Input.TexCoord - PixWidth;
	Output.RightCoord = Input.TexCoord + PixWidth;
	Output.TopCoord = Input.TexCoord - PixHeight;
	Output.BottomCoord = Input.TexCoord + PixHeight;

	return Output;
}

//-----------------------------------------------------------------------------
// Scale2x Pixel Shader
//-----------------------------------------------------------------------------

float4 ps_main(PS_INPUT Input) : COLOR
{
	float4 Center = tex2D(DiffuseSampler, Input.TexCoord);
	float4 Left = tex2D(DiffuseSampler, Input.LeftCoord);
	float4 Right = tex2D(DiffuseSampler, Input.RightCoord);
	float4 Up = tex2D(DiffuseSampler, Input.TopCoord);
	float4 Bottom = tex2D(DiffuseSampler, Input.BottomCoord);

	float2 PixelSize = frac(Input.TexCoord * float2(RawWidth, RawHeight));
	
	// Split along the texel centerpoint
	if(PixelSize.y >= 0.5f)
	{
		float4 swap = Up;
		Up = Bottom;
		Bottom = swap;
	}
	
	if(PixelSize.x >= 0.5f)
	{
		float4 swap = Left;
		Left = Right;
		Right = swap;
	}
	
	float Match1 = Up == Left;
	float Match2 = Up != Right;
	float Match3 = Left != Bottom;
	
	if(Match1 && Match2 && Match3)
	{
		Center = Left;
	}

	return Center;
}

//-----------------------------------------------------------------------------
// Scale2x Effect
//-----------------------------------------------------------------------------

technique DeconvergeTechnique
{
	pass Pass0
	{
		Lighting = FALSE;

		VertexShader = compile vs_3_0 vs_main();
		PixelShader  = compile ps_3_0 ps_main();
	}
}



I know this is not officially supported, but I can't seem to get this Scale2x code to work in 0.149.

Before the code above worked flawlessly (at some point in time I had to copy it onto prescale.fx instead of deconverge.fx, but it worked nonetheless).

Any solution?

#88995 - 06/11/13 01:34 PM Re: SHADER PRESET ONE-STOP SHOP [Re: Just Desserts]  
Joined: Mar 2001
Posts: 15,710
R. Belmont Offline
R. Belmont  Offline

Very Senior Member

Joined: Mar 2001
Posts: 15,710
USA
The shader semantics changed a *lot* in u4/u5/0.149 so that won't work anymore.

#89054 - 06/14/13 09:39 AM Re: SHADER PRESET ONE-STOP SHOP [Re: R. Belmont]  
Joined: Feb 2008
Posts: 42
gigadeath Offline
Member
gigadeath  Offline
Member

Joined: Feb 2008
Posts: 42
Originally Posted By R. Belmont
The shader semantics changed a *lot* in u4/u5/0.149 so that won't work anymore.


I feared an answer like that frown

Any chance to make it work with current HLSL implementation?

#89316 - 06/28/13 12:17 AM Re: SHADER PRESET ONE-STOP SHOP [Re: Just Desserts]  
Joined: May 2011
Posts: 10
MilliGoodz Offline
Member
MilliGoodz  Offline
Member

Joined: May 2011
Posts: 10
Greetings! The GPL-derived scale2x shader-code that Just Desserts provided was indeed very useful in MESS for systems that were never meant to be played on a television or a monitor screen.

HLSL works great and is polished near perfection in v.0.149 but I really miss the ability to enable scale2x when needed.

Scale2x & EPX is the only algorithm in my opinion that doesnít destroy the beautiful pixel-art as much as most other algorithms, and combined with HLSL it did wonders on some systems in MESS.

Iím currently looking at the scale2x algorithm (http://scale2x.sourceforge.net/
) and the HLSL source in order to understand the changes. Iíll post the shader-code here if I get it to work in >v0.149. Chances are slim in my case since Iím only a old armature hobby programmer and not a Guru-Master like most active members here on bannister-boards. The HLSL code is way too advanced for me and it still amazes me as much as it did since the first release =)

I only wish that HLSL could read user-made ďcustom.fxĒ file for these kinds of modifications instead of replacing the available HLSL files like prescale.fx as in the past.

Any help from our MESS/MAME gurus regarding this issue would indeed be much appreciated. Best regards and thanks in advance. Cheers

#106875 - 08/14/16 06:22 AM Re: SHADER PRESET ONE-STOP SHOP [Re: Just Desserts]  
Joined: Aug 2016
Posts: 1
StyleMaster Offline
Member
StyleMaster  Offline
Member

Joined: Aug 2016
Posts: 1
Anyone that has an hlsl setting for psx for MESS?

Page 9 of 9 1 2 3 4 5 6 7 8 9

Who's Online Now
4 registered members (Kale, Duke, TeamE, 1 invisible), 17 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,412
Posts108,938
Members4,757
Most Online225
May 26th, 2014
Powered by UBB.threads™ PHP Forum Software 7.6.0
Page Time: 0.030s Queries: 15 (0.009s) Memory: 5.0265 MB (Peak: 5.2521 MB) Zlib enabled. Server Time: 2017-09-25 11:20:58 UTC