Revision cbcf2374
Added by Leszek Koltunski 10 months ago
src/main/java/org/distorted/library/effect/FragmentEffect.java | ||
---|---|---|
38 | 38 |
*/ |
39 | 39 |
public static final int NUM_INT_UNIFORMS = 4; |
40 | 40 |
|
41 |
static final int VALUES_OFFSET = 0; |
|
42 | 41 |
static final int CENTER_OFFSET = 5; |
43 | 42 |
static final int REGION_OFFSET = 8; |
44 | 43 |
private static String mGLSL = ""; |
src/main/java/org/distorted/library/effect/MatrixEffectRotate.java | ||
---|---|---|
32 | 32 |
{ |
33 | 33 |
private final Data1D mAngle; |
34 | 34 |
private final Data3D mAxis, mCenter; |
35 |
private float[] mTmp1 = new float[16]; |
|
36 |
private float[] mTmp2 = new float[16]; |
|
35 |
private final float[] mTmp1 = new float[16];
|
|
36 |
private final float[] mTmp2 = new float[16];
|
|
37 | 37 |
|
38 | 38 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
39 | 39 |
/** |
src/main/java/org/distorted/library/effect/MatrixEffectScale.java | ||
---|---|---|
49 | 49 |
* <p> |
50 | 50 |
* Here and in Shear we have the whole reason why there are two separate 'P' and 'V' (Point and |
51 | 51 |
* Vector) matrices - Scale and Shear have to manipulate Points and Normal Vectors differently. |
52 |
* |
|
52 |
* <p>
|
|
53 | 53 |
* Points get multiplied by (sx,sy,sz) - and vectors by (1/sx,1/sy,1/sz) (think about it!) - or |
54 | 54 |
* better by sx*sy*sz*(1/sx,1/sy,1/sz) to avoid dividing my zero (vectors are normalized after) |
55 | 55 |
* |
src/main/java/org/distorted/library/effect/PostprocessEffect.java | ||
---|---|---|
147 | 147 |
* At this moment the 'buffer' contains a) preprocessed object b) real object rendered 'on top' of |
148 | 148 |
* the preprocessed one. |
149 | 149 |
* Postprocess buffer. What this means exactly depends on the effect - |
150 |
* |
|
150 |
* <p>
|
|
151 | 151 |
* Only for use by the library itself. |
152 | 152 |
* |
153 | 153 |
* @y.exclude |
... | ... | |
159 | 159 |
* Do we render the object directly to the final surface, and only postprocess and then blit its |
160 | 160 |
* 'halo', or do we render the object along with its halo to the intermediate framebuffer and |
161 | 161 |
* postprocess it as well? |
162 |
* |
|
162 |
* <p>
|
|
163 | 163 |
* Only for use by the library itself. |
164 | 164 |
* |
165 | 165 |
* @y.exclude |
src/main/java/org/distorted/library/effect/PostprocessEffectBlurred.java | ||
---|---|---|
84 | 84 |
|
85 | 85 |
if( weightsCache[offset]==0.0f ) |
86 | 86 |
{ |
87 |
float z, x= 0.0f, P= (float)NUM_GAUSSIAN / (radius>3 ? radius:3);
|
|
87 |
float z, x= 0.0f, P= (float)NUM_GAUSSIAN / Math.max(radius,3);
|
|
88 | 88 |
mWeights[0] = GAUSSIAN[0]; |
89 | 89 |
float sum = GAUSSIAN[0]; |
90 | 90 |
int j; |
src/main/java/org/distorted/library/effect/VertexEffect.java | ||
---|---|---|
231 | 231 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
232 | 232 |
/** |
233 | 233 |
* Set Mesh association. |
234 |
* |
|
234 |
* <p>
|
|
235 | 235 |
* This creates an association between a Component of a Mesh and this Vertex Effect. |
236 | 236 |
* One can set two types of associations - an 'logical and' and a 'equal' associations and the Effect |
237 | 237 |
* will only be active on vertices of Components such that |
238 |
* |
|
238 |
* <p>
|
|
239 | 239 |
* (effect andAssoc) & (component andAssoc) != 0 || (effect equAssoc) == (mesh equAssoc) |
240 |
* |
|
240 |
* <p>
|
|
241 | 241 |
* (see main_vertex_shader) |
242 |
* |
|
242 |
* <p>
|
|
243 | 243 |
* The point: this way we can configure the system so that each Vertex Effect acts only on a certain |
244 | 244 |
* subset of a Mesh, thus potentially significantly reducing the number of render calls. |
245 | 245 |
*/ |
src/main/java/org/distorted/library/effect/VertexEffectPinch.java | ||
---|---|---|
27 | 27 |
/** |
28 | 28 |
* Pull all points around the center of the Effect towards a line passing through the center |
29 | 29 |
* (that's if degree>=1) or push them away from the line (degree<=1). |
30 |
* |
|
30 |
* <p>
|
|
31 | 31 |
* Note: this is not a fully 3D effect - the pinching is always within the XY plane; z coordinates |
32 | 32 |
* of all vertices remain unaffected. If someone wants a fully 3D Pinch effect, we'd probably need |
33 | 33 |
* to write another VertexEffectPinch3D with 2 more arguments (latitude and longitude angles defining |
src/main/java/org/distorted/library/effect/VertexEffectPipe.java | ||
---|---|---|
26 | 26 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
27 | 27 |
|
28 | 28 |
/** |
29 |
* Pull all points around the center of the Effect towards the center point (if degree>=1) or push them |
|
30 |
* away from it (degree<=1). |
|
29 |
* Pull (degree>1) or push away from (degree<1) all points of an infinite 'pipe' shaped region. |
|
31 | 30 |
*/ |
32 | 31 |
public class VertexEffectPipe extends VertexEffect |
33 | 32 |
{ |
src/main/java/org/distorted/library/effect/VertexEffectSwirl.java | ||
---|---|---|
27 | 27 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
28 | 28 |
/** |
29 | 29 |
* 'Swirl' part of the Mesh, i.e rotate part of it around a point. |
30 |
* |
|
30 |
* <p>
|
|
31 | 31 |
* Note: this is not a fully 3D effect as the swirling happens entirely within the XY plane - z |
32 | 32 |
* coordinates of all vertices remain unaffected. If someone wants a fully 3D swirling, we'd |
33 | 33 |
* probably need to write another VertixEffectSwirl3D with two additional parameters: latitude and |
src/main/java/org/distorted/library/effect/VertexEffectWave.java | ||
---|---|---|
27 | 27 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
28 | 28 |
/** |
29 | 29 |
* Directional, sinusoidal wave effect. |
30 |
* |
|
30 |
* <p>
|
|
31 | 31 |
* Not a fully 3D effect. To achieve a fully 3D one we'd need another parameter making the whole thing |
32 | 32 |
* a 6D effect but there's no room in the Vertex Uniforms which assign only 5 floats for interpolated |
33 | 33 |
* effect values. Rethink this. ATM fully enough for 2.5D meshes like the MeshCubes. |
Also available in: Unified diff
minor