-
Notifications
You must be signed in to change notification settings - Fork 74
Open
Description
// Next drift heat up and diffuse it a little bit
for (int i = 0; i < Size; i++)
heat[i] = (heat[i] * BlendSelf +
heat[(i + 1) % Size] * BlendNeighbor1 +
heat[(i + 2) % Size] * BlendNeighbor2 +
heat[(i + 3) % Size] * BlendNeighbor3)
/ BlendTotal;
Say the Size is 10 and coming thru the loop we are at i=9
(i+1) % Size will evaluate to 0
(i+2) % Size will evaluate to 1
(i+3) % Size will evaluate to 2
So at pixel 9 you will be adding in the heat[0]*Blend+heat[1]*Blend+heat[2]*Blend when it should be the heat from heat[8]*Blend+heat[7]*Blend+heat[6]*Blend. I figure you need something so that you do not go outside the array.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels