Revision 8c57d77b
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/library/effectqueue/EffectQueuePostprocess.java | ||
---|---|---|
20 | 20 |
|
21 | 21 |
package org.distorted.library.effectqueue; |
22 | 22 |
|
23 |
import android.content.res.Resources; |
|
24 | 23 |
import android.opengl.GLES30; |
25 |
import android.util.Log; |
|
26 | 24 |
|
27 |
import org.distorted.library.R; |
|
28 | 25 |
import org.distorted.library.effect.EffectType; |
29 | 26 |
import org.distorted.library.effect.PostprocessEffect; |
30 | 27 |
import org.distorted.library.effect.VertexEffect; |
... | ... | |
74 | 71 |
EffectQueuePostprocess(EffectQueuePostprocess source) |
75 | 72 |
{ |
76 | 73 |
super(source); |
74 |
|
|
75 |
mHalo = source.mHalo; |
|
76 |
mUseHaloDepth = source.mUseHaloDepth; |
|
77 |
mR = source.mR; |
|
78 |
mG = source.mG; |
|
79 |
mB = source.mB; |
|
80 |
mA = source.mA; |
|
77 | 81 |
} |
78 | 82 |
|
79 | 83 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
118 | 122 |
|
119 | 123 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
120 | 124 |
|
121 |
public static void createPrograms(Resources resources, int GLSL)
|
|
125 |
public static void createPrograms(InputStream vert, InputStream frag, int GLSL)
|
|
122 | 126 |
{ |
123 |
final InputStream mainVertStream = resources.openRawResource(R.raw.main_vertex_shader); |
|
124 |
final InputStream mainFragStream = resources.openRawResource(R.raw.preprocess_fragment_shader); |
|
125 |
|
|
126 | 127 |
int numV = VertexEffect.getNumEnabled(); |
127 | 128 |
|
128 | 129 |
String version = "#version "+GLSL+" es\n"; |
... | ... | |
136 | 137 |
|
137 | 138 |
try |
138 | 139 |
{ |
139 |
mPreProgram = new DistortedProgram(mainVertStream, mainFragStream, mainVertHeader, mainFragHeader,
|
|
140 |
mPreProgram = new DistortedProgram(vert, frag, mainVertHeader, mainFragHeader,
|
|
140 | 141 |
enabledEffectV, null, GLSL, null); |
141 | 142 |
} |
142 | 143 |
catch(Exception e) |
143 | 144 |
{ |
144 |
Log.e("POSTPROCESS", e.getClass().getSimpleName()+" trying to compile PRE program: "+e.getMessage());
|
|
145 |
DistortedLibrary.logMessage("EffectQueuePostprocess "+ e.getClass().getSimpleName()+" trying to compile PRE program: "+e.getMessage());
|
|
145 | 146 |
throw new RuntimeException(e.getMessage()); |
146 | 147 |
} |
147 | 148 |
|
Also available in: Unified diff
Decouple (to a large degree) the OpenGL Library from Android.