Blurred Background

All Lua scripting topics related to Multi Theft Auto.

Moderators: Scripting Moderators, Moderators, MTA Team

Blurred Background

Postby Image on Sun Sep 16, 2012 11:50 am

Hey.
How can i make gaussian blur effect? (blurred background)
Like this http://i48.tinypic.com/2qapi0w.png
I don't have .fx file.
SeeMTA Head Developer

Image
Image
New User
 
Posts: 45
Joined: Sun Sep 16, 2012 11:31 am

Re: Blurred Background

Postby Anderl on Sun Sep 16, 2012 2:27 pm

Use Photoshop.
"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
Anderl
Veteran
 
Posts: 2413
Joined: Mon May 14, 2012 12:36 pm
Location: Leiria, Portugal

Re: Blurred Background

Postby Image on Mon Sep 17, 2012 9:48 am

Anderl wrote:Use Photoshop.

I want to make it in-game, not outside.
SeeMTA Head Developer

Image
Image
New User
 
Posts: 45
Joined: Sun Sep 16, 2012 11:31 am

Re: Blurred Background

Postby Socialz on Mon Sep 17, 2012 12:39 pm

Eh, he means you use Photoshop to blur a background image, and then add it in-game via DirectX functions.



If this is still not what you mean, you should check out the shader feature, which was added a while ago.

http://wiki.multitheftauto.com/wiki/Shader
Another Basic Roleplay Gamemode - Current status: Frozen (33%)

Homepage of my resources »
Homepage of Socialz's Gaming Community »
User avatar
Socialz
Veteran
 
Posts: 1181
Joined: Fri Jan 21, 2011 12:16 pm
Location: Turku, Finland
Gang: SGC, UG

Re: Blurred Background

Postby Image on Mon Sep 17, 2012 12:55 pm

Socialz wrote:Eh, he means you use Photoshop to blur a background image, and then add it in-game via DirectX functions.



If this is still not what you mean, you should check out the shader feature, which was added a while ago.

http://wiki.multitheftauto.com/wiki/Shader


I know the function but not the effect file, or the lua script I can not prepare

p.s.: sry for my bad english, i used google translator
SeeMTA Head Developer

Image
Image
New User
 
Posts: 45
Joined: Sun Sep 16, 2012 11:31 am

Re: Blurred Background

Postby Anderl on Mon Sep 17, 2012 12:59 pm

Image wrote:
Socialz wrote:Eh, he means you use Photoshop to blur a background image, and then add it in-game via DirectX functions.



If this is still not what you mean, you should check out the shader feature, which was added a while ago.

http://wiki.multitheftauto.com/wiki/Shader


I know the function but not the effect file, or the lua script I can not prepare

p.s.: sry for my bad english, i used google translator


If you can't make such easy thing like drawing an image in the screen, then you should start learning Lua -- drawing an image is a very basic thing.
"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
Anderl
Veteran
 
Posts: 2413
Joined: Mon May 14, 2012 12:36 pm
Location: Leiria, Portugal

Re: Blurred Background

Postby Image on Mon Sep 17, 2012 2:41 pm

I expressed myself badly :D
almost everything I can do whatever I want in lua, but I do not know the .fx file prepared
SeeMTA Head Developer

Image
Image
New User
 
Posts: 45
Joined: Sun Sep 16, 2012 11:31 am

Re: Blurred Background

Postby Anderl on Mon Sep 17, 2012 2:43 pm

Image wrote:I expressed myself badly :D
almost everything I can do whatever I want in lua, but I do not know the .fx file prepared


There's no need for use of shaders.
Photoshop is enough.
"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
Anderl
Veteran
 
Posts: 2413
Joined: Mon May 14, 2012 12:36 pm
Location: Leiria, Portugal

Re: Blurred Background

Postby Image on Mon Sep 17, 2012 2:49 pm

Can you show me how can I do it? There is a graphic of the team, but unfortunately he can not make that transparent to the blur. (I do not want to blur an image, but the player's camera. Such an HDR effect, but it is only 2D)
SeeMTA Head Developer

Image
Image
New User
 
Posts: 45
Joined: Sun Sep 16, 2012 11:31 am

Re: Blurred Background

Postby Ren_712 on Mon Sep 17, 2012 2:51 pm

I think you could use shader "motion blur" (by orange) from community. Just strip the lua out of 'motion stuff' and fix the blur values x and y. You may need to edit the fx file. I guess that's the easiest way.
Last edited by Ren_712 on Mon Sep 17, 2012 3:06 pm, edited 1 time in total.
User avatar
Ren_712
Regular
 
Posts: 112
Joined: Wed Apr 11, 2012 6:58 pm

Re: Blurred Background

Postby Image on Mon Sep 17, 2012 3:04 pm

The problem is that the effect is only one-way. The gaussian blur effect benefits both directions is required. A vertical and a horizontal accordingly.
SeeMTA Head Developer

Image
Image
New User
 
Posts: 45
Joined: Sun Sep 16, 2012 11:31 am

Re: Blurred Background

Postby Ren_712 on Mon Sep 17, 2012 3:13 pm

As far as i can say , that is not that tough to realise how this effect is drawn and modify it .. just play with the .x and .y stuff.

or ..
you might check this out:
http://www.geeks3d.com/20100909/shader- ... r-in-glsl/

this is what you have on mind ? - it's not HLSL, but it's not that hard to understand/convert it.


update:
How about looking at shader_bloom from examples...
Last edited by Ren_712 on Mon Sep 17, 2012 3:17 pm, edited 1 time in total.
User avatar
Ren_712
Regular
 
Posts: 112
Joined: Wed Apr 11, 2012 6:58 pm

Re: Blurred Background

Postby Image on Mon Sep 17, 2012 3:16 pm

Ren_712 wrote:or ..
you might check this out:
http://www.geeks3d.com/20100909/shader- ... r-in-glsl/

this is what you have on mind ? - it's not HLSL, but it's not that hard to understand/convert it.


yes, it is, i'll try it
SeeMTA Head Developer

Image
Image
New User
 
Posts: 45
Joined: Sun Sep 16, 2012 11:31 am

Re: Blurred Background

Postby Ren_712 on Mon Sep 17, 2012 3:27 pm

Another thought. blurH and V effect from shader_bloom.
If you want to use just one effect do that:

blurH: changes from line 95
  1.    for(int i = 0; i < 7; ++i)
  2.     {
  3.         coord.x = PS.TexCoord.x + Kernel[i]/sTex0Size.x;
  4.         coord.y = PS.TexCoord.y + Kernel[i]/sTex0Size.y;
  5.         Color += tex2D(Sampler0, coord.xy) * Weights[i] * sBloom;
  6.     }
User avatar
Ren_712
Regular
 
Posts: 112
Joined: Wed Apr 11, 2012 6:58 pm

Re: Blurred Background

Postby Image on Mon Sep 17, 2012 3:47 pm

i edited the c_bloom.lua and the blurh.fx files and it works
thank you very much
SeeMTA Head Developer

Image
Image
New User
 
Posts: 45
Joined: Sun Sep 16, 2012 11:31 am

Next

Return to Scripting

Who is online

Users browsing this forum: abxf and 11 guests