#1  
Old 19th July 2012, 03:07 PM
Loggo Loggo is offline
Junior Member
 
Join Date: Jul 2012
Posts: 1
Default epsxe shaders

Hi there guys.

I was playing around with ePSXe's custom shaders the other day (storybook shaders, cartoon shaders etc.) and I was really impressed by the results:







So, I was just wondering if a Project 64 port of these shaders would be possible.

I'd love to replay something like Ocarina of Time or Majora's Mask using epsxe's storybook shaders.
Reply With Quote
  #2  
Old 19th July 2012, 03:09 PM
squall_leonhart's Avatar
squall_leonhart squall_leonhart is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Mar 2007
Location: Sydney, Australia
Posts: 2,918
Default

no, because jabo's plugin uses d3d8.
__________________

CPU:Intel Xeon x5690 @ 4.2Ghz, Mainboard:Asus Rampage III Extreme, Memory:48GB Corsair Vengeance LP 1600
Video:EVGA Geforce GTX 1080 Founders Edition, NVidia Geforce GTX 1060 Founders Edition
Monitor:ROG PG279Q, BenQ BL2211, Sound:Creative XFI Titanium Fatal1ty Pro
SDD:Crucial MX300 275, Crucial MX300 525, Crucial MX300 1000
HDD:500GB Spinpoint F3, 1TB WD Black, 2TB WD Red, 1TB WD Black
Case:NZXT Phantom 820, PSU:Seasonic X-850, OS:Windows 7 SP1
Reply With Quote
  #3  
Old 24th July 2012, 01:07 AM
TheRealM TheRealM is offline
Project Supporter
Member
 
Join Date: Jan 2011
Posts: 80
Default

u will need someone to write a new plugin.
Reply With Quote
  #4  
Old 29th November 2012, 05:38 PM
chumbalumba chumbalumba is offline
Junior Member
 
Join Date: Jun 2012
Posts: 5
Wink

Sorry for my bad english.

How to Add shaders in N64 games:

See this video:

www(.)youtube.com/watch?v=sCu3VkYkFBk

www(.)41post.com/1063/retro-games/how-to-add-shaders-to-ocarina-of-time

It's my Ocarina of time (I customize "emboss" shader to make this "Relief" effect, the original shader is from "Mudlord's Code".):

Code:
//These variables will get set automatically
texture tex1;

float2 rcpres;

sampler s0 = sampler_state { texture = <tex1>; };



float4 NormalColourPass( in float2 Tex : TEXCOORD0 ) : COLOR0
{
	float4 color = tex2D( s0, Tex );
	color.a = 1;
	return color;
}

float4 EmbossPass( in float2 Tex : TEXCOORD0 ) : COLOR0
{
	float4 Color = tex2D( s0, Tex );
        Color.a = 0.3f;
        Color.rgb = 0.0f;
        Color -= tex2D( s0, Tex.xy-0.00001)*10.0f;
        Color += tex2D( s0, Tex.xy+0.00001)*10.0f;
        Color.rgb = (Color.r+Color.g+Color.b)/0.1f;
	return Color;
}




Technique T0
{

    pass p0 { PixelShader = compile ps_3_0 NormalColourPass(); }
    pass p1 { PixelShader = compile ps_3_0 EmbossPass(); }
}
Attached Images
File Type: jpg shader.jpg (18.5 KB, 1 views)

Last edited by chumbalumba; 29th November 2012 at 05:41 PM.
Reply With Quote
  #5  
Old 29th November 2012, 08:52 PM
HatCat's Avatar
HatCat HatCat is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Feb 2007
Location: In my hat.
Posts: 16,236
Default

LLE is better.

Quote:
Color.rgb = (Color.r+Color.g+Color.b)/0.1f;
lolwut, why would you want to divide by 0.1, when you just finished multiplying by 10 in the lines above that?

0.1 = (10 ^ -1) # not XOR, dammit! to the power of...
10 is the multiplicative inverse of 0.1.

So:
rgb == (r + g + b) / 0.1
0.1*(rgb) == r + g + b
10[0.1(rgb)] == 10(r + g + b)
rgb == 10(r + g + b)

More readable.
Reply With Quote
  #6  
Old 29th November 2012, 10:03 PM
Natch's Avatar
Natch Natch is offline
Project Supporter
Senior Member
 
Join Date: Jan 2011
Location: Nowhere near you.
Posts: 5,075
Default




haha
__________________
Reply With Quote
  #7  
Old 29th November 2012, 10:30 PM
HatCat's Avatar
HatCat HatCat is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Feb 2007
Location: In my hat.
Posts: 16,236
Default

Why is it only Spanish people, who keep obsessing over HLE graphics, hi-res texture packs and the 30-day free trial shareware edition of Project64 1.7.0.55?
Reply With Quote
  #8  
Old 1st December 2012, 03:13 PM
chumbalumba chumbalumba is offline
Junior Member
 
Join Date: Jun 2012
Posts: 5
Default

New shaders:
Code:
//These variables will get set automatically
texture tex1;

float2 rcpres;
float4 ToonConfig;
float threshold = 0.001;

sampler s0 = sampler_state { texture = <tex1>; };



float4 NormalColourPass( in float2 Tex : TEXCOORD0 ) : COLOR0
{
	float4 color = tex2D( s0, Tex );
	color.a = 1;
	return color;
}

float4 ToonPass( in float2 Tex : TEXCOORD0 ) : COLOR0
{ 
        ToonConfig.xyz = 4; //RGB colours

	float4 Color = tex2D( s0, Tex.xy );
	Color.r = round(Color.r*ToonConfig.r)/ToonConfig.r;
	Color.g = round(Color.g*ToonConfig.g)/ToonConfig.g;
	Color.b = round(Color.b*ToonConfig.b)/ToonConfig.b;
	const int NUM = 9;
	const float2 c[NUM] =
	{
		float2(-0.0078125, 0.0078125), 
		float2( 0.00 ,     0.0078125),
		float2( 0.0078125, 0.0078125),
		float2(-0.0078125, 0.00 ),
		float2( 0.0,       0.0),
		float2( 0.0078125, 0.007 ),
		float2(-0.0078125,-0.0078125),
		float2( 0.00 ,    -0.0078125),
		float2( 0.0078125,-0.0078125),
	};	

	int i;
	float3 col[NUM];
	for (i=0; i < NUM; i++)
	{
		col[i] = tex2D(s0, Tex.xy + 0.2*c[i]);
	}
	
	float3 rgb2lum = float3(0.01, 0.01, 0.01);
	float lum[NUM];
	for (i = 0; i < NUM; i++)
	{
		lum[i] = dot(col[i].xyz, rgb2lum);
	}
	float x = lum[2]+  lum[8]+2*lum[5]-lum[0]-2*lum[3]-lum[6];
	float y = lum[6]+2*lum[7]+  lum[8]-lum[0]-2*lum[1]-lum[2];
	float edge =(x*x + y*y < threshold)? 1.0:0.0;
	Color.rgb *= edge;
	return Color;
}




Technique T0
{

    pass p0 { PixelShader = compile ps_3_0 NormalColourPass(); }
    pass p1 { PixelShader = compile ps_3_0 ToonPass(); }
}



Bloom & HDR shader:
Code:
//These variables will get set automatically
texture tex1;
texture tex2;
float2 rcpres;
float CurrentEye;
float CurrentBrightness;

sampler s0 = sampler_state { texture = <tex1>; };
sampler s1 = sampler_state { texture = <tex2>; };
float ReactionSpeed=9.0;

//Use these to modify the behaviour of the shader
static const float BloomScale = 0.4;
static const float HDRScale = -0.3;
static const float HDRAdjust = -0.01;

//Uncomment these settings and comment out the ones above for super bright bloom
//static const float BloomScale = 0.1;
//static const float HDRScale = -0.6;
//static const float HDRAdjust = 0.04;

float2 PixelKernelH[13] =
{
    { -9, 9 },
    { -7.5, 7.5 },
    { -6, 6 },
    { -4.5, 4.5 },
    { -3, 3 },
    { -1.5, 1.5 },
    {  0, 0 },
    {  1.5, 1.5 },
    {  3, 3 },
    {  4.5, 4.5 },
    {  6, 6 },
    {  7.5, 7.5 },
    {  9, 9 },
};

float2 PixelKernelV[13] =
{
    { -9, -9 },
    { -7.5, -7.5 },
    { -6, -6 },
    { -4.5, -4.5 },
    { -3, -3 },
    { -1.5, -1.5 },
    {  0, 0 },
    {  1.5, -1.5 },
    {  3, -3 },
    {  4.5, -4.5 },
    {  6, -6 },
    {  7.5, -7.5 },
    {  9, -9 },
};

static const float BlurWeights[13] = 
{
    0.005000,
    0.010000,
    0.030000,
    0.060000,
    0.080000,
    0.090000,
    0.100000,
    0.090000,
    0.080000,
    0.060000,
    0.030000,
    0.010000,
    0.005000,
};

float4 Bloom( in float2 Tex : TEXCOORD0 ) : COLOR0
{
    float4 Color = tex2D( s0, Tex );
    Color *= 1+((CurrentEye - 0.5)*HDRScale);
    //Color *= 1+((CurrentBrightness - CurrentEye)*2);  //Uncomment this line for abrubt brightness changes

    float4 Color2=0;
    for (int i = 0; i < 13; i++)
    {    
        Color2 += tex2D( s1, Tex + (PixelKernelH[i]*rcpres) ) * BlurWeights[i];
        Color2 += tex2D( s1, Tex + (PixelKernelV[i]*rcpres) ) * BlurWeights[i];
    }
    Color2 *= BloomScale;

    return saturate((Color*0.6) + (Color2*1.8) - (Color*Color2));
}
float4 HDRBrightPass( in float2 Tex : TEXCOORD0 ) : COLOR0
{
	float4 color = tex2D( s0, Tex );
	//color += saturate(tex2D( s1, Tex ) - (CurrentEye + 0.1)); //Uncomment this line for retina burn
	float4 adjust = (color - CurrentEye*0.5) - HDRAdjust;
	color = saturate((adjust)*0.5 + (adjust*adjust)*1.5);
	color.a = 1;
	return color;
}

technique T0
{
    pass p0 { PixelShader = compile ps_3_0 HDRBrightPass(); }
    pass p1 { PixelShader = compile ps_3_0 Bloom();         }

}


Quote:
Why is it only Spanish people, who keep obsessing over HLE graphics, hi-res texture packs and the 30-day free trial shareware edition of Project64 1.7.0.55?
It's Project 64 1.7.0.50 and i'm not Spanish.

Last edited by chumbalumba; 1st December 2012 at 04:13 PM.
Reply With Quote
  #9  
Old 2nd December 2012, 07:58 PM
HatCat's Avatar
HatCat HatCat is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Feb 2007
Location: In my hat.
Posts: 16,236
Default

Yeah right woman. That's why there's Asian language all over the language text in those screenshots

And 1.7.0.55 doesn't even exist; I just made that up to denote cracked 1.7 30-day-free-trial shareware offer! Seeing as you didn't donate to receive a copy of 1.7 legitimately via that account.

and LOLWUT:

Code:
float4 ToonPass( in float2 Tex : TEXCOORD0 ) : COLOR0
{ 
        ToonConfig.xyz = 4; //RGB colours

	float4 Color = tex2D( s0, Tex.xy );
	Color.r = round(Color.r*ToonConfig.r)/ToonConfig.r;
	Color.g = round(Color.g*ToonConfig.g)/ToonConfig.g;
	Color.b = round(Color.b*ToonConfig.b)/ToonConfig.b;
	const int NUM = 9;
	const float2 c[NUM] =
	{
		float2(-0.0078125, 0.0078125), 
		float2( 0.00 ,     0.0078125),
		float2( 0.0078125, 0.0078125),
		float2(-0.0078125, 0.00 ),
		float2( 0.0,       0.0),
		float2( 0.0078125, 0.007 ),
		float2(-0.0078125,-0.0078125),
		float2( 0.00 ,    -0.0078125),
		float2( 0.0078125,-0.0078125),
	};	

	int i;
	float3 col[NUM];
	for (i=0; i < NUM; i++)
	{
		col[i] = tex2D(s0, Tex.xy + 0.2*c[i]);
	}
	
	float3 rgb2lum = float3(0.01, 0.01, 0.01);
	float lum[NUM];
	for (i = 0; i < NUM; i++)
	{
		lum[i] = dot(col[i].xyz, rgb2lum);
	}
	float x = lum[2]+  lum[8]+2*lum[5]-lum[0]-2*lum[3]-lum[6];
	float y = lum[6]+2*lum[7]+  lum[8]-lum[0]-2*lum[1]-lum[2];
	float edge =(x*x + y*y < threshold)? 1.0:0.0;
	Color.rgb *= edge;
	return Color;
Dat thar be some inefficient code

High-level emulation and C++ are very nice and all that, promotes various things with more direct results sometimes, but what good is any of that if they inspire inefficient coding

For example:
Code:
float edge =(x*x + y*y < threshold)? 1.0:0.0;
Color.rgb *= edge;
return Color;
Is a bloated, excessive way of saying in pure C:
Code:
x *= x;
y *= y;
if (x + y < threshold) return Color;
Color.rgb = 0; /* if edge == 0.0 then DUH, Color.rgb *= 0 zeroes it. */
return Color;

Last edited by HatCat; 2nd December 2012 at 08:00 PM.
Reply With Quote
  #10  
Old 3rd December 2012, 08:16 PM
ExtremeDude2's Avatar
ExtremeDude2 ExtremeDude2 is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Apr 2010
Location: USA
Posts: 3,109
Default

If anything that is french (I'm just guessing tho)
__________________
Quote:
Originally Posted by dsx! View Post
are you american or something
Reply With Quote
Reply

Thread Tools
Display Modes

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. The time now is 08:24 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.