Jump to content

Introducing the new Kernel Based Blur


GameMonetize
 Share

Recommended Posts

Nice job, DK!

Things REALLY got "blurry" when I tried to understand the rastergrid site.  :D

hmm.  I wonder if a single mesh... could have varying blur.  If vert far from camera... more blur.  Near-to-cam verts, no blur.  hmm.

Different subject, though.  Party on!

Link to comment
Share on other sites

Thanks, I feel an additional parameter(s) in the generated initScene() similar to what is done for Mesh grand entrances coming on.  Maybe,  called entrance_effect? : string.  This effect would only be viable for the initial chunk of scene, or if all current chucks were being replaced by this one, so I did not want to commit to something like fade_in? : boolean

The only effect I have in mind right now is this one, "FADE_IN", but do not want to have to change to allow different ones.  Thinking out loud, sorry again, want as little in generated code as possible.  For this effect need to play with the amount of time and for the accompanying "music".

EDIT: Oh wait, I need to check the B&W post process, if there is a settable "degree" parameter, a fade to color too.

Edited by JCPalmer
Brain Fart
Link to comment
Share on other sites

Not sure if I should pollute this topic for my own purposes, but nah.  Never really stopped me before :P.  I could modify the B&W shader from:

varying vec2 vUV;
uniform sampler2D textureSampler;

void main(void) 
{
    
	float luminance = dot(texture2D(textureSampler, vUV).rgb, vec3(0.3, 0.59, 0.11));
	gl_FragColor = vec4(luminance, luminance, luminance, 1.0);
}

to:

varying vec2 vUV;
uniform sampler2D textureSampler;
uniform float degree;

void main(void) 
{
    
	float luminance = dot(texture2D(textureSampler, vUV).rgb, vec3(1.0, 1.0, 1.0) - (vec3(0.7, 0.41, 0.89) * degree));
	gl_FragColor = vec4(luminance, luminance, luminance, 1.0);
}

When degree is 1 then full B&W, when 0 full color.

The Typescript class would be:

module BABYLON {

    public degree = 1;
    
    export class BlackAndWhitePostProcess extends PostProcess {
        constructor(name: string, options: number | PostProcessOptions, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean) {
            super(name, "blackAndWhite", ["degree"], null, options, camera, samplingMode, engine, reusable);

            this.onApplyObservable.add((effect: Effect) => {
                effect.setFloat("degree", this.degree);
            });
        }
    }
} 

Is 3.0 still changeable for such a addition?

Link to comment
Share on other sites

Well, PR'ed the changeable B&W to Color change Late last week.  I also implemented QI with 3 scene transitions:

  • Into Focus using the Blur post process
  • To Color using the B&W post process
  • To visible using Mesh.visibilty property

This scene will randomly do one of the three. (refresh a couple of times to see them all)

Others things of note:

  • implemented privileged time for scene transitions, so everything can be frozen during transition.  All animation events were placed in the flying carpet's queue before it was even visible, but queue events do no not start processing till transition complete.
  • Only the visibility transition is viable for adding scene chunks after the first.  Will probably add another before QI 1.1 complete.

Default transition time is 5 seconds.  This allows a lot of time for read ahead to get more stuff.  Here is how I think it will all fit together:

  1. Statically link a custom built BJS profiled with only the stuff needed, QI runtime, & pep.
  2. Bring up an empty engine / scene, & immediately start read ahead for the initial scene chunk.
  3. Add a button, "Launch", ( more later )  to transition to the scene when ready.  Probably take user about 1 sec.  Also pays the iOS audio tax at the same time.
  4. During the scene transition get character(s). 
  5. During the characters grand entrance, up to 1.5 secs for Poof & teleport, keep on getting stuff like more characters & additional scene chunks.

Sound like cheating?  If you squeal, I'll deny it:ph34r:.

For the button, I did not want to use any of the GUI systems people have made, including my own.  In Babylon.GUI discussions,  I thought it was mentioned it was made because WebVR could not use dom buttons.  Putting aside how you click a screen when it is on your head, why cannot WebVR do this?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...