PIXI.BLUR Pictures Layer ? (for space navigation)

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,439
First Language
French
Primarily Uses
RMMV
Hello, I' would like embellished my navigation space map of my project.
I want. to know if exist any plugin or CallScript technique to put a blur in image layer?
In my example, when choosing a planet, I would put a gradual blurring of the background planet.


Ideally I'd like to have some control on the blur to give a beautiful rendering.


Ex: blur all image befor picture id:70


Something like this


Without blur ..


1-blur.jpg


With a blur effect


blur-2.jpg


Here The planet navigator i have build to understand the blur, i have need.


Tanks you guys if some can help me :)
 
Last edited by a moderator:

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
The Blur looks awfull in my opinion.


It realy looks better without else my eyes hurt somehow when i see that blur.


Your Galaxy looks good, very interesting and nice fresh and inovative aproach for rpgmaker engine.
 
Last edited by a moderator:

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,439
First Language
French
Primarily Uses
RMMV
The Blur looks awfull in my opinion.


It realy looks better without else my eyes hurt somehow when i see that blur.


How did you got vector graphics with vector behavior zooming to work in MV ? Or is that pixel art like always in rpgmaker?
yes.. the blur of the image up, are ugly and i make it very fast.
It was only to show what I need.
The blur effect will be great once Dynamics with animations.


I'm not understand your 2nd issue ??
My game are not in pixel art, all are with Photoshop and AI. 


For zoom i use good picture based over my game resolution, and i use https://tinypng.com/ for optimal png compresion.
So 900 Ko picture passe to 200 Ko, this make me easy to use very higth resolution texture.


is that I have answered your issue ?
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
Here is some code I whipped up really quick :

Code:
var EXA_Game_Picture_initialize = Game_Picture.prototype.initialize;

Game_Picture.prototype.initialize = function() {

  EXA_Game_Picture_initialize.call(this);

  this.initBlur();

};

Game_Picture.prototype.initBlur = function() {

  this._blur = null;

};

Game_Picture.prototype.showBlur = function(strength, quality, padding) {

  this._blur = new Object();

  this._blur.enabled  = true;
  this._blur.strength = strength; // CPU Friendly Value : 1.5
  this._blur.quality  = quality;  // CPU Friendly Value : 1.5
  this._blur.padding  = padding;

};

Game_Picture.prototype.eraseBlur = function() {

  this._blur = new Object();

  this._blur.enabled = false;

};

var EXA_Sprite_Picture_updateOther = Sprite_Picture.prototype.updateOther;

Sprite_Picture.prototype.updateOther = function() {

  EXA_Sprite_Picture_updateOther.call(this);

  var picture = this.picture();

  if (picture._blur) {
    if (picture._blur.enabled) {
      var tmpBlur     = new PIXI.filters.BlurFilter();
      tmpBlur.blur    = picture._blur.strength;
      tmpBlur.quality = picture._blur.quality;
      tmpBlur.padding = picture._blur.padding;
      this.filters    = [tmpBlur];
    } else {
      this.filters    = [];
    }

    picture._blur = null;
  }

};


Code:
// Show Blur
// * pictureId    - ID of the Picture
// * blurStrength - Strength of Picture Blur
// * blurQuality  - Quality of Picture Blur
// * blurPadding  - Padding around the Blurred Picture
// 
// [WARNING] Higher values may degrade overall performance!
// [WARNING] Multiple blurred, moving objects on screen may degrade overall performance!
$gameScreen.picture(pictureId).showBlur(blurStrength, blurQuality, blurPadding);

// Erase Blur
$gameScreen.picture(pictureId).eraseBlur();

// Multiple Pictures
var id  = 1;
var end = 70;

for (id = 0; id < end; id++) {
  var tPicture = $gameScreen.picture(id);
  if (tPicture) {
    tPicture.showBlur(1.5, 1.5, 0);
  }
}
 
Last edited by a moderator:

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,439
First Language
French
Primarily Uses
RMMV
Here is some code I whipped up in about ten minutes :

var EXA_Game_Picture_initialize = Game_Picture.prototype.initialize;

Game_Picture.prototype.initialize = function() {

EXA_Game_Picture_initialize.call(this);

this.initBlur();

};

Game_Picture.prototype.initBlur = function() {

this._blur = null;

};

Game_Picture.prototype.showBlur = function(strength, quality) {

this._blur = new Object();

this._blur.enabled = true;
this._blur.strength = strength; // CPU Friendly Value : 1.5
this._blur.quality = quality; // CPU Friendly Value : 1.5

};

Game_Picture.prototype.eraseBlur = function() {

this._blur = new Object();

this._blur.enabled = false;

};

var EXA_Sprite_Picture_updateOther = Sprite_Picture.prototype.updateOther;

Sprite_Picture.prototype.updateOther = function() {

EXA_Sprite_Picture_updateOther.call(this);

var picture = this.picture();

if (picture._blur) {
if (picture._blur.enabled) {
var tmpBlur = new PIXI.filters.BlurFilter();
tmpBlur.blur = picture._blur.strength;
tmpBlur.quality = picture._blur.quality;
tmpBlur.padding = (5 / picture._blur.quality) * 5;
this.filters = [tmpBlur];
} else {
this.filters = [];
}

picture._blur = null;
}

};
OMG is Work realy good, !!!


I'll try a few tests and I come see you
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,439
First Language
French
Primarily Uses
RMMV
Here is some code I whipped up really quick :

var EXA_Game_Picture_initialize = Game_Picture.prototype.initialize;

Game_Picture.prototype.initialize = function() {

EXA_Game_Picture_initialize.call(this);

this.initBlur();

};

Game_Picture.prototype.initBlur = function() {

this._blur = null;

};

Game_Picture.prototype.showBlur = function(strength, quality) {

this._blur = new Object();

this._blur.enabled = true;
this._blur.strength = strength; // CPU Friendly Value : 1.5
this._blur.quality = quality; // CPU Friendly Value : 1.5

};

Game_Picture.prototype.eraseBlur = function() {

this._blur = new Object();

this._blur.enabled = false;

};

var EXA_Sprite_Picture_updateOther = Sprite_Picture.prototype.updateOther;

Sprite_Picture.prototype.updateOther = function() {

EXA_Sprite_Picture_updateOther.call(this);

var picture = this.picture();

if (picture._blur) {
if (picture._blur.enabled) {
var tmpBlur = new PIXI.filters.BlurFilter();
tmpBlur.blur = picture._blur.strength;
tmpBlur.quality = picture._blur.quality;
tmpBlur.padding = (5 / picture._blur.quality) * 5;
this.filters = [tmpBlur];
} else {
this.filters = [];
}

picture._blur = null;
}

};




Ok something wrong ??


i testing something, i try to remove the blur gradually for a nice effect


Ex: i declare my global var


BlurForce = 2;
BlurQual = 2;
BlurForce.toFixed(2);
BlurQual.toFixed(2);


After i blur what i need.


$gameScreen.picture(Planet5PID).showBlur(BlurForce, BlurQual);
$gameScreen.picture(Planet6PID).showBlur(BlurForce, BlurQual);
$gameScreen.picture(Planet7PID).showBlur(BlurForce, BlurQual);
$gameScreen.picture(Planet8PID).showBlur(BlurForce, BlurQual);




After i try in a other parallel process, i try remove the blur gradually to 0.0


BlurForce -= 0.1;
console.log('blur are at ' + BlurForce);
$gameScreen.picture(Planet5PID).showBlur(BlurForce, BlurQual);
$gameScreen.picture(Planet6PID).showBlur(BlurForce, BlurQual);
$gameScreen.picture(Planet7PID).showBlur(BlurForce, BlurQual);
$gameScreen.picture(Planet8PID).showBlur(BlurForce, BlurQual);


◆Wait:1 frame



But i have stange number or i do something wrong !


This give strange like thats ?


Console.LOG

Code:
blur are at 2.0
blur are at 1.9
undefined:2 blur are at 1.7999999999999998
undefined:2 blur are at 1.6999999999999997
undefined:2 blur are at 1.5999999999999996
undefined:2 blur are at 1.4999999999999996
undefined:2 blur are at 1.3999999999999995
undefined:2 blur are at 1.2999999999999994
undefined:2 blur are at 1.1999999999999993
undefined:2 blur are at 1.0999999999999992
undefined:2 blur are at 0.9999999999999992
undefined:2 blur are at 0.8999999999999992
undefined:2 blur are at 0.7999999999999993
undefined:2 blur are at 0.6999999999999993
undefined:2 blur are at 0.5999999999999993
undefined:2 blur are at 0.49999999999999933
undefined:2 blur are at 0.39999999999999936
undefined:2 blur are at 0.2999999999999994
undefined:2 blur are at 0.19999999999999937
undefined:2 blur are at 0.09999999999999937
undefined:2 blur are at -6.38378239159465e-16
undefined:2 blur are at -0.10000000000000064
undefined:2 blur are at -0.20000000000000065
undefined:2 blur are at -0.30000000000000066
undefined:2 blur are at -0.4000000000000007
undefined:2 blur are at -0.5000000000000007
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,439
First Language
French
Primarily Uses
RMMV
Here is some code I whipped up really quick :

var EXA_Game_Picture_initialize = Game_Picture.prototype.initialize;

Game_Picture.prototype.initialize = function() {

EXA_Game_Picture_initialize.call(this);

this.initBlur();

};

Game_Picture.prototype.initBlur = function() {

this._blur = null;

};

Game_Picture.prototype.showBlur = function(strength, quality, padding) {

this._blur = new Object();

this._blur.enabled = true;
this._blur.strength = strength; // CPU Friendly Value : 1.5
this._blur.quality = quality; // CPU Friendly Value : 1.5
this._blur.padding = padding;

};

Game_Picture.prototype.eraseBlur = function() {

this._blur = new Object();

this._blur.enabled = false;

};

var EXA_Sprite_Picture_updateOther = Sprite_Picture.prototype.updateOther;

Sprite_Picture.prototype.updateOther = function() {

EXA_Sprite_Picture_updateOther.call(this);

var picture = this.picture();

if (picture._blur) {
if (picture._blur.enabled) {
var tmpBlur = new PIXI.filters.BlurFilter();
tmpBlur.blur = picture._blur.strength;
tmpBlur.quality = picture._blur.quality;
tmpBlur.padding = picture._blur.padding;
this.filters = [tmpBlur];
} else {
this.filters = [];
}

picture._blur = null;
}

};


anyway, I'll let the gradual effect, I am rather very satisfied with the results.
A very big thank you to you. @Exhydra you are awesome guys. !
I noticed some strange little lines, if you know which they arise.
Here the final result, for i very big map, not very laggy, but i need to optimise this soon. but when all picture are in cache, all run fine.


Space navigation with EXA motion blur plugin
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
Yes you answered it, thanks.
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,439
First Language
French
Primarily Uses
RMMV
Yes you answered it, thanks.
To do similar, you need huge picture ex:


Your game are 1280x720p.


Planet are  = 700px700p


And they are show at 2% size.
And when focus om, they are at 100%.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,354
Reaction score
8,533
First Language
English
Primarily Uses
RMMV
@Jonforum, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


If you need to add something to your last post, just hit edit.


Has this request been solved then?
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,439
First Language
French
Primarily Uses
RMMV
@Jonforum, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


If you need to add something to your last post, just hit edit.


Has this request been solved then?
Yes i mark [solved] sorry, but don't lock tanks you
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
Waaaait ... working on a proper solution.


EDIT: Here is a proper-ish plugin for blurring pictures.


Exhydra Picture Control - Blur Filter

Code:
// Add Blur
// * pictureId      - ID of the Picture
// * blurStrength   - Initial Strength of Picture Blur
// * blurQuality    - Quality of Picture Blur
// * blurPadding    - Padding around the Blurred Picture
// 
// [WARNING] Higher values may degrade overall performance!
// [WARNING] Multiple blurred, moving objects on screen may degrade overall performance!
$gameScreen.picture(pictureId).addBlur(blurStrength, blurQuality, blurPadding);

// To Blur Strength
// * pictureId      - ID of the Picture
// * blurStrength   - Target Strength of Picture Blur
// * durationFrames - Duration of the Effect in Frames
$gameScreen.picture(pictureId).toBlur(blurStrength, durationFrames);

// Erase Blur
// * pictureId      - ID of the Picture
$gameScreen.picture(pictureId).eraseBlur();


// Add and Gradually Blur Picture
$gameScreen.picture(1).addBlur(0, 1.5, 0);
$gameScreen.picture(1).toBlur(10, 120);
 
Last edited by a moderator:

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,439
First Language
French
Primarily Uses
RMMV
Waaaait ... working on a proper solution.


EDIT: Here is a proper-ish plugin for blurring pictures.


Exhydra Picture Control - Blur Filter



// Add Blur
// * pictureId - ID of the Picture
// * blurStrength - Initial Strength of Picture Blur
// * blurQuality - Quality of Picture Blur
// * blurPadding - Padding around the Blurred Picture
//
// [WARNING] Higher values may degrade overall performance!
// [WARNING] Multiple blurred, moving objects on screen may degrade overall performance!
$gameScreen.picture(pictureId).addBlur(blurStrength, blurQuality, blurPadding);

// To Blur Strength
// * blurStrength - Target Strength of Picture Blur
// * durationFrames - Duration of the Effect in Frames
$gameScreen.picture(pictureId).toBlur(blurStrength, durationFrames);

// Erase Blur
// * pictureId - ID of the Picture
$gameScreen.picture(pictureId).eraseBlur();


// Add and Gradually Blur Picture
$gameScreen.picture(1).addBlur(0, 1.5, 0);
$gameScreen.picture(1).toBlur(10, 120);


You are a gods. @Exhydra
It is even better,!!! and works very great.



A small correction if other people need use.
You say


$gameScreen.picture(1).toBlur(10, 120);


But Not work, it return error, need 3 para
 


$gameScreen.picture(1).toBlur(10, 120, 0); // Streng, Time, ..padding :)




Thank you very much for your ingenuity


@+
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
@Jonforum I have updated the plugin with minor changes since the last post. You may want to re-download and re-add the plugin to your project. 'toBlur' should only have two arguments (strength, duration).
 
Last edited by a moderator:

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,439
First Language
French
Primarily Uses
RMMV
@Jonforum I have updated the plugin with minor changes since the last post. You may want to re-download and re-add the plugin to your project. 'toBlur' should only have two arguments (strength, duration).
Ok true,


Thank you very much, the plugin is 100% operational now.
I have some suggestion, but for me all is ok.


I like to know if the plugin could and can blur a paralax? (background)
Or on the characters heroes or event sprites ?
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
@Jonforum I'll work on adding a blur option for characters and parallax sometime here soon.
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,439
First Language
French
Primarily Uses
RMMV
@Jonforum I'll work on adding a blur option for.....
Hi @Exhydra


I have noted a small crash.


If you show picture like this (No file)


Capture.JPG


And after you transfer player to another map.


I have this message

TypeError: Cannot read property 'added' of undefined


a your line 


221:


if (this._blurFilter.added) {
this._blurFilter.added = false;

this.filters = null;
}




If you have an idea to prevent this problem?


I use blank file for the DTextPicture plugin from Triacontane.:)


Tanks you
 
Last edited by a moderator:

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,439
First Language
French
Primarily Uses
RMMV
@Jonforum Are you using version 1.05 (current version)? That may correct the error.


I confirm, not more error thank you.
I observed the changes.


It not is more useful to use


$gameScreen.picture(id).addBlur();
//and
$gameScreen.picture(id).toBlur();


but just


$gameScreen.blurPicture(id, strength, duration, quality, padding);




The plugin create and add alway the blur function on a new picture when picture are create ?


If i understand :)
 
Last edited by a moderator:

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
@Jonforum You can use the following, if you want.

Code:
$gameScreen.picture(id).setBlur(strength, quality, padding);
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,570
Latest member
fgfhdfg
Top