エフェクト-ガウスフィルタ †ぼかす。 描画パス †ガウス分布の計算 ガウス分布の計算 †const int Dispersion = 5.0; // ガウス散乱率 const int Sampling = 8; // 後述のサンプリング数 const float dispersion = Dispersion * Dispersion; const int sample = Sampling / 2; assert((sample > 0) && (sample <= 8)); // 重さ結果格納 float weight_list[sample] = {0}; // 重み計算 float total = 0.0f; for (int i = 0 ; i < sample ; ++i) { float weight = expf(-0.5f * (i*i)/dispersion); total += 2.0f * weight; weight_list[i] = weight; } for (int i = 0 ; i < sample ; ++i) weight_list[i] /= total; ぼかしフィルタ †縦軸ぼかし:gauss-v.fx |