- store the stencil caps in the reserved part of the main vertex buffer instead of constantly recreating them.
This commit is contained in:
parent
76d7b52fcd
commit
b83c2056a8
3 changed files with 24 additions and 24 deletions
|
|
@ -153,7 +153,7 @@ FFlatVertexBuffer::FFlatVertexBuffer(int width, int height)
|
|||
map = new FFlatVertex[BUFFER_SIZE];
|
||||
}
|
||||
mIndex = mCurIndex = 0;
|
||||
mNumReserved = 12;
|
||||
mNumReserved = NUM_RESERVED;
|
||||
vbo_shadowdata.Resize(mNumReserved);
|
||||
|
||||
// the first quad is reserved for handling coordinates through uniforms.
|
||||
|
|
@ -174,6 +174,17 @@ FFlatVertexBuffer::FFlatVertexBuffer(int width, int height)
|
|||
vbo_shadowdata[10].Set(1.0f, -1.0f, 0, 1.f, 0.0f);
|
||||
vbo_shadowdata[11].Set(1.0f, 1.0f, 0, 1.f, 1.f);
|
||||
|
||||
// The next two are the stencil caps.
|
||||
vbo_shadowdata[12].Set(-32767.0f, 32767.0f, -32767.0f, 0, 0);
|
||||
vbo_shadowdata[13].Set(-32767.0f, 32767.0f, 32767.0f, 0, 0);
|
||||
vbo_shadowdata[14].Set(32767.0f, 32767.0f, 32767.0f, 0, 0);
|
||||
vbo_shadowdata[15].Set(32767.0f, 32767.0f, -32767.0f, 0, 0);
|
||||
|
||||
vbo_shadowdata[16].Set(-32767.0f, -32767.0f, -32767.0f, 0, 0);
|
||||
vbo_shadowdata[17].Set(-32767.0f, -32767.0f, 32767.0f, 0, 0);
|
||||
vbo_shadowdata[18].Set(32767.0f, -32767.0f, 32767.0f, 0, 0);
|
||||
vbo_shadowdata[19].Set(32767.0f, -32767.0f, -32767.0f, 0, 0);
|
||||
|
||||
}
|
||||
|
||||
FFlatVertexBuffer::~FFlatVertexBuffer()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue