c++ - Using Perlin noise to create lightning? -
Actually I have many questions related to the subject given in the topic title.
I am already using Perlin functions to make electricity in my application, but I am not completely happy about my implementation.
The following questions are based on initial and better Perlin noise implementation.
To make this problem easy, suppose I am making simple 2D power by modifying the height of the horizontal line by joining n nodes on these nodes using a 1D Perlin function. I understand, the two later values passed to the Perlin function should be different from at least one, or as a result the two values are the same. The reason for this is that, with simple Perlin implementation, the random function works with an int arguments, and better implementation values are mapped for [0..255] and these are considered as indexes. 255] Is it correct in a random distribution?
How do I find that the first and last offset value returned by the Perlin function (i.e. for nodes 0 and n -1) is always 0 (zero)? Right now I want to get a sign function (0 .. Pi) with my Perlin function, but in reality I do not want what I want. Just to set them is not what I want, because I want good power path w / o jaggies on my end.
I would love the Perlin function (I would get two different paths that I used to start animation and as an end frame for electricity)? I could definitely add a certain random offset for every node value per path calculation, or can use a different setup permutation table for Perlin noise, but what are the better options?
-
It depends on that How you apply it and sampling it using many octaides gives the integers a little bit of help.
Extra interpolation / sampling for octaviz and each provides greater noise in Perlin noise. In principle, you should not need to use different integer positions; You should be able to sample at any point and it will be similar to the surrounding values (but not always the same).
-
I would suggest using Perlin as a multiplier instead of a bus adder, and use a curve during power, for example, perilin [1, 1.5, 1.5] A normal curve in the range and on the power (0 on the other end, 1 in the center),
Lightning + (Perlin * curve) You have to keep the points you end your Perlin noise Depending on the implementation of the generator, you may need something:
lightning.x + = (( Erlin (electric., Oktewjh) * 2.0) - 0.5) * curve (lightning.y);
If
perlin returns [0,1] or
lightning.x + = (Perlin (lightning.y, octaves ) / 128.0) * curve (lightning.y);
If it gives [0, 255] assuming
lightning.x can start with a given value, maybe 0, to some degree Will give the denticle line which still matches the original start and end points.
- You add the amplitude of the noise to each dimension if you are modifying electricity in one dimension (horizontal toothed), then you need 1D Perlin noise. If you want to animate it, then you need 2D if you want to power the two axis and animated power, you will need 3D noise, and so on.
- You add the amplitude of the noise to each dimension if you are modifying electricity in one dimension (horizontal toothed), then you need 1D Perlin noise. If you want to animate it, then you need 2D if you want to power the two axis and animated power, you will need 3D noise, and so on.
Comments
Post a Comment