Coding Help For Rez File

Posts 1–8 of 8 · Page 1 of 1
Coding Help For Rez File
anyone know coding, i got this from a fx file. i opened the fx file with nvidea fx composer. i dont understand any of the coding there but maybe someone else does.

Code:
/*
	Copyright Doobic entertainment Corporation 2006
	
	Title : Blur
	Information : Gaussian focus blur
					Compile VS 2.0, PS 2.0
	
	Last Date : 2006 / 5 / 19
	Author : Jung Hwan Ji (Russiac)
*/

texture tTexture;
texture tBlurTexture;
texture tDotTexture;
float2 vViewportSize;

sampler2D g_Screen = sampler_state
{
	Texture = <tTexture>;
	
	MinFilter = Linear;
	MagFilter = Linear;
	
	AddressU = Clamp;
	AddressV = Clamp;
};

sampler2D g_BlurScreen = sampler_state
{
	Texture = <tBlurTexture>;
	
	MinFilter = Linear;
	MagFilter = Linear;
	
	AddressU = Clamp;
	AddressV = Clamp;
};

sampler2D g_DotTexture = sampler_state
{
	Texture = <tDotTexture>;
	
	MinFilter = Linear;
	MagFilter = Linear;
	
	AddressU = Clamp;
	AddressV = Clamp;
};

struct VS_OUTPUT {
	float4		Pos : POSITION0;
	float2		Tex : TEXCOORD0;
};

VS_OUTPUT CommonVS(float3 Pos : POSITION0)
{
	VS_OUTPUT output = (VS_OUTPUT)0;
	
	float4 outPos = float4(Pos, 1.0f);
	outPos.xy = sign(outPos.xy);
	output.Pos = float4(outPos.xy, 0.0f, 1.0f);
	
	output.Tex = 0.5f * outPos.xy + 0.5f;
	output.Tex.y = 1.0f - output.Tex.y;
	
	return output;
}

float4 DownSamplingPS(float2 Tex : TEXCOORD0) :COLOR0
{
	float2 texCoordSample = 0;
	float4 cOut;
	
	float2 pixelSize = 1.0f / float2(vViewportSize.x, vViewportSize.y);
	
		texCoordSample.x = Tex.x - pixelSize.x;
		texCoordSample.y = Tex.y + pixelSize.y;
		cOut = tex2D(g_Screen, texCoordSample);
		
		texCoordSample.x = Tex.x + pixelSize.x;
		texCoordSample.y = Tex.y + pixelSize.y;
		cOut += tex2D(g_Screen, texCoordSample);
		
		texCoordSample.x = Tex.x + pixelSize.x;
		texCoordSample.y = Tex.y - pixelSize.y;
		cOut += tex2D(g_Screen, texCoordSample);
		
		texCoordSample.x = Tex.x - pixelSize.x;
		texCoordSample.y = Tex.y - pixelSize.y;
		cOut += tex2D(g_Screen, texCoordSample);
	
	return cOut * 0.25f; 
}

float4 Gaussian1PS(float2 Tex : TEXCOORD0) :COLOR0
{
	float2 texCoordSample = 0;
	float4 cOut;
	
	float2 pixelSize = 8.0f / float2(vViewportSize.x, vViewportSize.y);
	
		cOut = 0.5f * tex2D(g_BlurScreen, Tex);
		texCoordSample.x = Tex.x;
		texCoordSample.y = Tex.y + pixelSize.y;
		cOut += 0.25f * tex2D(g_BlurScreen, texCoordSample);
		
		texCoordSample.y = Tex.y - pixelSize.y;
		cOut += 0.25f * tex2D(g_BlurScreen, texCoordSample);
	
	return cOut;
}

float4 Gaussian2PS(float2 Tex : TEXCOORD0) :COLOR0
{
	float2 texCoordSample = 0;
	float4 cOut;
	
	float2 pixelSize = 8.0f / float2(vViewportSize.x, vViewportSize.y);
	
		cOut = 0.5f * tex2D(g_Screen, Tex);
		texCoordSample.y = Tex.y;
		texCoordSample.x = Tex.x + pixelSize.x;
		cOut += 0.25f * tex2D(g_Screen, texCoordSample);
		
		texCoordSample.x = Tex.x - pixelSize.x;
		cOut += 0.25f * tex2D(g_Screen, texCoordSample);
	
	return cOut;
}

float4 MurgePS(float2 Tex : TEXCOORD0) :COLOR0
{
	float4 cOut;
	
	float4 DotColor = tex2D(g_DotTexture, Tex);
	float4 SrcColor = tex2D(g_Screen, Tex);
	float4 BlurColor = tex2D(g_BlurScreen, Tex);
	
	cOut = SrcColor * DotColor.a;
	cOut += BlurColor * (1.0f - DotColor.a);

	return cOut;
}

//-----------------------------------------------------------------------------------------
// Techniques
//-----------------------------------------------------------------------------------------
technique Blur
{
    pass P0
    {   
    		ZWriteEnable = false;
    		ZEnable = false;
    		Lighting = false;
        VertexShader = compile vs_2_0 CommonVS();
        PixelShader = compile ps_2_0 DownSamplingPS();
    }
    
    pass P1
    {   
    ZWriteEnable = false;
    		ZEnable = false;
    		Lighting = false;
        VertexShader = compile vs_2_0 CommonVS();
        PixelShader = compile ps_2_0 Gaussian1PS();
    }

	pass P2
    {   
    ZWriteEnable = false;
    		ZEnable = false;
    		Lighting = false;
        VertexShader = compile vs_2_0 CommonVS();
        PixelShader = compile ps_2_0 Gaussian2PS();
    }
  
    pass P3
    {
    		ZWriteEnable = false;
    		ZEnable = false;
    		Lighting = false;
    		VertexShader = compile vs_2_0 CommonVS();
       	PixelShader = compile ps_2_0 MurgePS();
    }
}
from what i can understand, this is the blur u get from scoping in.. i could be wrong.. but thats what it sounds like to me

i would go about changing this, not a wise idea, unles u fuly know what you are doing
yeh the file is called blur, wow maybe no fog hack here
Quote Originally Posted by FORCE6 View Post
yeh the file is called blur, wow maybe no fog hack here
hmm thats kind of what i was thinking
i have another 5 of these files, do u want me to post them

wow theres one called night vission.fx
Quote Originally Posted by FORCE6 View Post
i have another 5 of these files, do u want me to post them

wow theres one called night vission.fx
OMG! YES! NIGHT VISION!!! FUCK YES!!!!

nah dont post em.. what rez file are they in?
they are in shaders.rez
Quote Originally Posted by FORCE6 View Post
they are in shaders.rez
Can you rebuild it after you edited the code?

And yeah it´s something with the fog!

Have you tried remove the shader file and start ca and see whats the diffrent?
Posts 1–8 of 8 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?