javascript - How can I expand the radius of a light bloom? -


I am writing a software filter object and am trying to implement a light bloom effect. I am using a simple, two-pass compressed approach which works fine except that the effect radius is small and I can not control the radius. I played with the big box filter and adjusted the weight of various pixels. But none of them seems to have any effect. The effect seems to be the maximum size (which is not very large) and then all the changes in the parameter just serve to minimize it.

I want to be able to create a light bloom together Arbitrary radius After many experiments and online search, I wonder if it can not be done right now. I'm thinking about alternative methods - plasma, gradients, and various Beijing plans- but I want to hit this path for the first time on the ground. Does anyone know how to make an arbitrary shape light bloom (in software)?

The Javascript is as follows (it operates on an HTML5 canvas; I can add the code to the comment at the need):

  // This kernel works array This is called on .backbuffer.data via .map, a canvas surface color array. KernelFirstPass = function (val, index, array) {if (index> lt; pitch index and gsi = array length-pitch || index% pitch & lt; 4 || index% pitch & gt; pitch -5 || index% 4 == 3) returns; Var C = 1, L1 = 1, L2 = 1, L3 = 1, R1 = 1, R2 = 1, R3 = 1; Var avg = (c * this.frontBuffer.data [index] + l1 * this.frontBuffer.data [index-4] + l2 * this.frontBuffer.data [index-8] + l3 * this.frontBuffer.data [index -12] + l1 * this.frontBuffer.data [index + 4] + l2 * this.frontBuffer.data [index + 8] + l3 * this.frontBuffer.data [index +12]) / (C + L1 + L2 + L3 + L1 + l2 + L3); //this.frontBuffer.data[index] = average; Array [index] = average; } this. Kernel SecondPass = Function (Val, Index, Array) {If (Index> Lieutenant; Pitch; Index> = Array.Lambi-Pitch || Index% Pitch & lt; 4 || Index% Pitch & gt; = Pitch -4 || index% 4 == 3) return; Var C = 1, L1 = 1, L2 = 1, L3 = 1, R1 = 1, R2 = 1, R3 = 1; Var avg = (c * array [index] + l1 * array [index-pitch] + l2 * array [index-(pitch * 2)] + l3 * array [index-(pitch * 3)] + l1 * array [ Index + pitch] + L2 * array [index + (pitch * 2)] + L3 * array [index + (pitch * 3)]) / (C + L1 + L2 + L3 + L1 + L 2 + L3); Array [index] = average; }   

Perhaps in my important question, I had forgotten an important point that I am not trying to emulate any real or special event (and this might help Does not say that I call it a "light" bloom), to deal with the actual light incident, to create an inscription with arbitrary radius, you have a source with arbitrary radius (i.e. "completely Saturated Appropriate area ") is required. If this was actually the way to blossom the real light, then it seems like a proper approach to imitating the explanation of Jim and Tucuzzi, even if that is not what I am trying to achieve. I want to control the radius of the "shield" part of blooming independently from size / intensity / etc. I want to be able to set a single, white (maximal value) pixels in the center of the screen and as far as I want, it gives me an opportunity to move on the edges of the screen or beyond if I think.

To achieve the effect of a good effect, you should use. Otherwise, your blondes will not be bright enough.

The reason for this is that the pixel brightness is usually represented by the border [0,1], thus the maximum brightness is 1. However, in the real situation, not really max. And although in reality the bright light is seen as all "1", then visual side effects like bloom are not the same.

So what do you have to do, in fact, the bright areas over maximum brightness, at least for thrilling convolution, then when you do the rendering, then suppress prices as necessary.

Once you do this, you should be able to increase the size of the use in the modification by increasing the bloom radius.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -