Previous Thread
Next Thread
Print Thread
Page 9 of 9 1 2 3 4 5 6 7 8 9
Joined: Sep 2011
Posts: 28
H
Member
Offline
Member
H
Joined: Sep 2011
Posts: 28
Thanks dude! I'll give that a shot smile

Joined: Sep 2011
Posts: 28
H
Member
Offline
Member
H
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

Joined: Mar 2001
Posts: 16,943
Likes: 69
R
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,943
Likes: 69
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.

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

Joined: Sep 2011
Posts: 28
H
Member
Offline
Member
H
Joined: Sep 2011
Posts: 28
Any new tweaks? laugh

Joined: Feb 2008
Posts: 42
G
Member
Offline
Member
G
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?

Joined: Mar 2001
Posts: 16,943
Likes: 69
R
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,943
Likes: 69
The shader semantics changed a *lot* in u4/u5/0.149 so that won't work anymore.

Joined: Feb 2008
Posts: 42
G
Member
Offline
Member
G
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?

Joined: May 2011
Posts: 10
M
Member
Offline
Member
M
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

Joined: Aug 2016
Posts: 1
S
Member
Offline
Member
S
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

Link Copied to Clipboard
Who's Online Now
2 members (Dorando, 1 invisible), 29 guests, and 2 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,132
Posts119,654
Members5,029
Most Online890
Jan 17th, 2020
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Forum hosted by www.retrogamesformac.com