Project

General

Profile

Download (3.38 KB) Statistics
| Branch: | Revision:

library / src / main / java / org / distorted / library / effect / PostprocessEffectGlow.java @ aa2f0486

1 125cee3d Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2017 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Distorted.                                                               //
5
//                                                                                               //
6
// Distorted is free software: you can redistribute it and/or modify                             //
7
// it under the terms of the GNU General Public License as published by                          //
8
// the Free Software Foundation, either version 2 of the License, or                             //
9
// (at your option) any later version.                                                           //
10
//                                                                                               //
11
// Distorted is distributed in the hope that it will be useful,                                  //
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
14
// GNU General Public License for more details.                                                  //
15
//                                                                                               //
16
// You should have received a copy of the GNU General Public License                             //
17
// along with Distorted.  If not, see <http://www.gnu.org/licenses/>.                            //
18
///////////////////////////////////////////////////////////////////////////////////////////////////
19
20
package org.distorted.library.effect;
21
22 1dfc9074 leszek
import org.distorted.library.main.DistortedFramebuffer;
23 125cee3d Leszek Koltunski
import org.distorted.library.type.Data1D;
24
import org.distorted.library.type.Data4D;
25
26
///////////////////////////////////////////////////////////////////////////////////////////////////
27
28
public class PostprocessEffectGlow extends PostprocessEffect
29
  {
30 0dd98279 Leszek Koltunski
  private Data1D mGlowRadius;
31
  private Data4D mColor;
32
33 7cd24173 leszek
///////////////////////////////////////////////////////////////////////////////////////////////////
34
35
  public static void enable()
36
    {
37
38
    }
39
40 125cee3d Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
41 02a4ac20 Leszek Koltunski
/**
42
 * Make the object glow with a specific color and a halo of specific radius.
43
 *
44 0dd98279 Leszek Koltunski
 * @param glowRadius The 'strength' if the effect, in pixels. 0 = no halo, 10 = halo of roughly 10 pixels
45
 *                   around the whole object.
46
 * @param color      RGBA of the color with which to draw the glow.
47 02a4ac20 Leszek Koltunski
 */
48 0dd98279 Leszek Koltunski
  public PostprocessEffectGlow(Data1D glowRadius, Data4D color)
49 125cee3d Leszek Koltunski
    {
50 9d0d8530 leszek
    super(EffectName.GLOW);
51 0dd98279 Leszek Koltunski
    mGlowRadius = glowRadius;
52
    mColor      = color;
53 125cee3d Leszek Koltunski
    }
54 15aa7d94 Leszek Koltunski
55
///////////////////////////////////////////////////////////////////////////////////////////////////
56
57
  public boolean compute(float[] uniforms, int index, long currentDuration, long step )
58
    {
59 0dd98279 Leszek Koltunski
    mColor.get(uniforms,index+1,currentDuration,step);
60
    return mGlowRadius.get(uniforms,index,currentDuration,step);
61 15aa7d94 Leszek Koltunski
    }
62 1dfc9074 leszek
63
///////////////////////////////////////////////////////////////////////////////////////////////////
64
65
  public int apply(float[] uniforms, int index, float qualityScale, DistortedFramebuffer buffer)
66
    {
67
    return 0;
68
    }
69 125cee3d Leszek Koltunski
  }