GameMonetize Posted June 1, 2017 Share Posted June 1, 2017 Hey team! I've just published the new BlurPostProcess which is far better now: https://www.babylonjs-playground.com/#FBH4J7%231 It uses a kernel size. Here is the source paper:http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/ 8Observer8, NasimiAsl, jerome and 5 others 8 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted June 6, 2017 Share Posted June 6, 2017 Nice job, DK! Things REALLY got "blurry" when I tried to understand the rastergrid site. 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! Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted June 6, 2017 Share Posted June 6, 2017 Thinking out loud, sorry, can any of those parameters be modified? Perhaps set across time to adjust amount of blur. My read ahead scenes can appear jarringly fast. A fade into focus could add nice polish. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 7, 2017 Share Posted June 7, 2017 This is perfect for an effect achieved under water Quote Link to comment Share on other sites More sharing options...
adam Posted June 7, 2017 Share Posted June 7, 2017 16 hours ago, JCPalmer said: Thinking out loud, sorry, can any of those parameters be modified? Perhaps set across time to adjust amount of blur. My read ahead scenes can appear jarringly fast. A fade into focus could add nice polish. https://www.babylonjs-playground.com/#FBH4J7#2 JCPalmer 1 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted June 7, 2017 Share Posted June 7, 2017 (edited) 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 June 7, 2017 by JCPalmer Brain Fart Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted June 7, 2017 Share Posted June 7, 2017 Not sure if I should pollute this topic for my own purposes, but nah. Never really stopped me before . 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? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 7, 2017 Author Share Posted June 7, 2017 definitely! please do! Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted June 12, 2017 Share Posted June 12, 2017 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: Statically link a custom built BJS profiled with only the stuff needed, QI runtime, & pep. Bring up an empty engine / scene, & immediately start read ahead for the initial scene chunk. 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. During the scene transition get character(s). 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. 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? GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 13, 2017 Author Share Posted June 13, 2017 Because WebVR takes only the canvas in account to do this. (And you can use controllers to click buttons) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.