19 |
* backgrounds. |
* backgrounds. |
20 |
*/ |
*/ |
21 |
namespace Paper { |
namespace Paper { |
|
|
|
|
/** Toggles (after 0.8Alpha4) the use of vertex program extension. */ |
|
|
extern bool useVertexProgram; |
|
|
|
|
22 |
using namespace Vec23; |
using namespace Vec23; |
23 |
|
|
24 |
/** Specifies texture coordinate system and |
/** Specifies texture coordinate system and |
96 |
float tex_mat[16]; |
float tex_mat[16]; |
97 |
|
|
98 |
public: |
public: |
99 |
/** Pointer to current translation matrix used in vertex_explicit(). */ |
/** Pointer to current translation matrix used in texcoords_explicit(). */ |
100 |
const float *explicit_mat; |
const float *explicit_mat; |
101 |
|
|
102 |
/** Creates a new TexGen. |
/** Creates a new TexGen. |
126 |
protected: |
protected: |
127 |
/** Amount to shift the texture towards the light. */ |
/** Amount to shift the texture towards the light. */ |
128 |
float eps; |
float eps; |
129 |
/** When embossing (depends of LightParam), vertex_explicit() needs |
/** When embossing (depends of LightParam), texcoords_explicit() needs |
130 |
* a different matrix to transform paper position into texture coordinates. |
* a different matrix to transform paper position into embossed |
131 |
|
* texture coordinates. |
132 |
*/ |
*/ |
133 |
float explicit_tmp_mat[16]; |
float explicit_tmp_mat[16]; |
134 |
|
|
185 |
* |
* |
186 |
* 3) using explicit coordinates |
* 3) using explicit coordinates |
187 |
* - call setUp_explicit with LightParam to use |
* - call setUp_explicit with LightParam to use |
188 |
* - call vertex_explicit() with paper coordinates in |
* - call texcoords_explicit() with paper coordinates in |
189 |
* arrays of 4 floats and call glVertex*() directly |
* arrays of 4 floats and call glVertex*() directly |
190 |
* from the context. |
* from the context. |
191 |
* - call teardown_explicit() |
* - call teardown_explicit() |
241 |
* @param ppos position within paper (array of 4 floats) |
* @param ppos position within paper (array of 4 floats) |
242 |
*/ |
*/ |
243 |
void vertex_VP(float *pos, float *ppos) { |
void vertex_VP(float *pos, float *ppos) { |
244 |
vertex_VP(ppos); |
texcoords_VP(ppos); |
245 |
glVertex4fv(pos); |
glVertex4fv(pos); |
246 |
} |
} |
247 |
void vertex_VP(float *ppos) { |
void texcoords_VP(float *ppos) { |
248 |
glTexCoord4fv(ppos); |
glTexCoord4fv(ppos); |
249 |
} |
} |
250 |
|
|
259 |
*/ |
*/ |
260 |
void tearDown_explicit () { teardowncode(); } |
void tearDown_explicit () { teardowncode(); } |
261 |
|
|
262 |
/** Explicit version of the PaperPass vertex. |
/** Explicit version of the PaperPass texcoords. |
263 |
*/ |
*/ |
264 |
void vertex_explicit(float *ppos); |
void texcoords_explicit(float *ppos); |
265 |
|
|
266 |
protected: |
protected: |
267 |
/* Vertex program code. */ |
/* Vertex program code. */ |