Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by AndrewAMD. 12/05/23 10:56
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
6 registered members (3run, AndrewAMD, alibaba, fairtrader, ozgur, TipmyPip), 605 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
[req]burst speed shader #229628
09/29/08 07:29
09/29/08 07:29

M
mercuryus OP
Unregistered
mercuryus OP
Unregistered
M



Hi!

This weekend I played EXCITE TRUCK (Wii) with a friend.
(btw. a VERY good made fun racing game!)
There is a technique used to simulate a very fast speed of the trucks when the turbo is used:

The objects/terrain/sky on the screen borders look like streched.
Like a fisheye lense on the borders.

I think it's made with a shader.
Can someone help me with such a shader?
I could use it for a pod race game I'm working on.

Re: [req]burst speed shader [Re: ] #229633
09/29/08 07:58
09/29/08 07:58
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
this looks like a simple radial blur masked by a radial gradient.
http://www.earthcontrol.de/main.php?loc=...t&deep=ucfx

dunno if i ever updated it to a7

edit: yes i'll create a new version this week


www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
Re: [req]burst speed shader [Re: ello] #229651
09/29/08 10:43
09/29/08 10:43

M
mercuryus OP
Unregistered
mercuryus OP
Unregistered
M



Thats great!
Can you make it "adjustable" like:

- effecting start radius (lens bow), because the center of the view should be left "unshaded"
- blur depth (effect strength) (for dynamic effect fade-in/out)

Are panels effected by your shader also? frown (that would be a pity)

If I can use your shader with my project I'll send you a donation!


Re: [req]burst speed shader [Re: ] #229655
09/29/08 11:24
09/29/08 11:24
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Originally Posted By: mercuryus

Are panels effected by your shader also? frown (that would be a pity)

They aren´t if you don´t render them into camera.bmap.

You could also check out my shadercollection as I also included a radial blur shader: http://www.coniserver.net/ubb7/ubbthreads.php?ubb=showflat&Number=207861
But I guess as it is, it effects the center a little too much.
I could change that easily but I think I shouldn´t as ello already offered his help smile

Last edited by Slin; 09/29/08 11:27.
Re: [req]burst speed shader [Re: Slin] #229656
09/29/08 11:30
09/29/08 11:30
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
no problem, slin. isnt there the metapher "the early bird catches the worm" ?
it's been a while since i did 3dgs things so you may be faster, plus i dont have much spare time

Re: [req]burst speed shader [Re: ello] #229657
09/29/08 11:47
09/29/08 11:47
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Originally Posted By: ello

no problem, slin. isnt there the metapher "the early bird catches the worm" ?

And you have been the early bird wink

Anyways I just had to give it a try and this is my result:



Last edited by Slin; 09/29/08 11:47.
Re: [req]burst speed shader [Re: Slin] #229658
09/29/08 12:07
09/29/08 12:07
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
hey, than go on. i dont even started, since i am at work.. and it already looks like what mercuryus wants


www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
Re: [req]burst speed shader [Re: ello] #229661
09/29/08 13:11
09/29/08 13:11

M
mercuryus OP
Unregistered
mercuryus OP
Unregistered
M



hey! That's amazing! You're really fast man!
Is it adjustable?

Re: [req]burst speed shader [Re: ] #229662
09/29/08 13:20
09/29/08 13:20
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
If you really want it, here is the code:
Code:
//////////////////////////////////////////////////
////////////Postprocessing Radial Blur////////////
//////////////////////////////////////////////////
////29.09.2008////////////////by Nils Daumann/////
/////////////slindev.wordpress.com////////////////
//////////////////////////////////////////////////
#define PP_SoftRadialBlur


//a radial blur shader
MATERIAL* PP_SoftRadialBlur_mat =
{
	effect =
	"
		#define NUM_SAMPLES 20
		
		//Variables
		float4 vecViewPort;
		float4 vecSkill1;
		
		//Texture
		texture TargetMap;
		sampler2D ColorSampler = sampler_state { texture = <TargetMap>;};
		
		//Pixelshader
		float4 PS( float2 texCoord : TEXCOORD0 ) : COLOR0 
		{
			float4 unblurredColor = tex2D(ColorSampler,texCoord);
			float blendFactor = saturate(abs(texCoord - vecSkill1.xy)/vecSkill1.w);
			
			float2 deltaTexCoord = (texCoord - vecSkill1.xy);
			deltaTexCoord *= 1.0f / NUM_SAMPLES * vecSkill1.z;
			
			float4 Color = 0;
			
			for(int i = 0; i < NUM_SAMPLES; i++)
			{
				texCoord -= deltaTexCoord;
				Color += tex2D(ColorSampler, texCoord);
			}
			
			Color /= NUM_SAMPLES;
			
			Color = lerp(unblurredColor,Color,blendFactor);
			
			Color.a = 1.0;
			return Color;
		}
		
		technique Tech1
		{
			pass one
			{
				PixelShader = compile ps_2_0 PS();
			}
		}
	";
}

//change the values of the shader
void PP_SoftRadialBlur_SetValues(var xPosition, var yPosition, var Density, var blendRadius)
{
	PP_SoftRadialBlur_mat.skill1 = floatv(xPosition);	//between 0 and 1
	PP_SoftRadialBlur_mat.skill2 = floatv(yPosition);	//between 0 and 1
	PP_SoftRadialBlur_mat.skill3 = floatv(Density);		//small, around 0.25
	PP_SoftRadialBlur_mat.skill4 = floatv(blendRadius);//small, around 0.25
}

//starts the radial blur
void PP_SoftRadialBlur_init(VIEW* View, var xPosition, var yPosition, var Density, var blendRadius)
{
	if(d3d_shaderversion >= 2020)
	{
		PP_SoftRadialBlur_SetValues(xPosition,yPosition,Density,blendRadius);
		PP_Add(PP_SoftRadialBlur_mat,View,NULL);
	}
}

//removes the effect
void PP_SoftRadialBlur_remove(VIEW* View)
{
	//remove the stage
	PP_Remove(PP_SoftRadialBlur_mat,View,NULL);
}


To use it, you also need my postprocessing helper file, located on the wikis script page and within my shaderpack.

Re: [req]burst speed shader [Re: Slin] #229663
09/29/08 13:24
09/29/08 13:24

M
mercuryus OP
Unregistered
mercuryus OP
Unregistered
M



Thanx a lot!
Can't test it here (@work) but tonight I will.
I'll be back...

Page 1 of 2 1 2

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1