Revision e71dd7fb
Added by Leszek Koltunski over 5 years ago
src/main/java/org/distorted/library/mesh/MeshFlat.java | ||
---|---|---|
31 | 31 |
private int mCols, mRows; |
32 | 32 |
private int remainingVert; |
33 | 33 |
private int numVertices; |
34 |
private float mInfCorr; |
|
35 | 34 |
|
36 | 35 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
37 | 36 |
// Create a flat, full grid. |
... | ... | |
41 | 40 |
mRows=rows; |
42 | 41 |
mCols=cols; |
43 | 42 |
|
44 |
mInfCorr = mRows>mCols ? mRows:mCols; |
|
45 |
|
|
46 | 43 |
if( cols==1 && rows==1 ) |
47 | 44 |
{ |
48 | 45 |
numVertices = 4; |
... | ... | |
72 | 69 |
attribs[VERT_ATTRIBS*vertex + NOR_ATTRIB+1] = 0.0f; |
73 | 70 |
attribs[VERT_ATTRIBS*vertex + NOR_ATTRIB+2] = 1.0f; |
74 | 71 |
|
75 |
attribs[VERT_ATTRIBS*vertex + INF_ATTRIB ] = (x-0.5f)*mInfCorr;
|
|
76 |
attribs[VERT_ATTRIBS*vertex + INF_ATTRIB+1] = (0.5f-y)*mInfCorr;
|
|
77 |
attribs[VERT_ATTRIBS*vertex + INF_ATTRIB+2] = 0.01f *mInfCorr; // Inflated surface needs to be slightly in front
|
|
72 |
attribs[VERT_ATTRIBS*vertex + INF_ATTRIB ] = (x-0.5f); |
|
73 |
attribs[VERT_ATTRIBS*vertex + INF_ATTRIB+1] = (0.5f-y); |
|
74 |
attribs[VERT_ATTRIBS*vertex + INF_ATTRIB+2] = 0.01f ; // Inflated surface needs to be slightly in front |
|
78 | 75 |
|
79 | 76 |
attribs[VERT_ATTRIBS*vertex + TEX_ATTRIB ] = x; |
80 | 77 |
attribs[VERT_ATTRIBS*vertex + TEX_ATTRIB+1] = 1.0f-y; |
Also available in: Unified diff
Improve computation of the thickness of the postprocessing halo - should be independent of the size of underlying object now.
Still it is not completely ok, it appears to depend on the ModelView matrix (use the Effects3D app to rotate the object around Z-axis to see this)