mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-17 19:22:32 +00:00
apply setchuckoffset to direct shader matrix
This commit is contained in:
parent
35d92fe504
commit
dc8c0b04c0
|
|
@ -856,24 +856,22 @@ int LevelRenderer::renderChunks(int from, int to, int layer, double alpha) {
|
||||||
if ((globalChunkFlags[pClipChunk->globalIdx] & emptyFlag) == emptyFlag)
|
if ((globalChunkFlags[pClipChunk->globalIdx] & emptyFlag) == emptyFlag)
|
||||||
continue; // Check that this particular layer isn't empty
|
continue; // Check that this particular layer isn't empty
|
||||||
|
|
||||||
glPushMatrix();
|
|
||||||
|
|
||||||
// 4jcraft: added this. On OpenGL 2.1 this breaks, but the 3.3 renderer
|
|
||||||
// requires it.
|
|
||||||
// FIXME: find a way to get rid of this.
|
|
||||||
glTranslatef((float)pClipChunk->chunk->x, (float)pClipChunk->chunk->y,
|
|
||||||
(float)pClipChunk->chunk->z);
|
|
||||||
// List can be calculated directly from the chunk's global idex
|
// List can be calculated directly from the chunk's global idex
|
||||||
int list = pClipChunk->globalIdx * 2 + layer;
|
int list = pClipChunk->globalIdx * 2 + layer;
|
||||||
list += chunkLists;
|
list += chunkLists;
|
||||||
|
|
||||||
|
// 4jcraft: replaced glPushMatrix/glTranslatef/glPopMatrix per chunk
|
||||||
|
// no more full MVP upload per chunk, can also be bkwards compat
|
||||||
|
RenderManager.SetChunkOffset((float)pClipChunk->chunk->x,
|
||||||
|
(float)pClipChunk->chunk->y,
|
||||||
|
(float)pClipChunk->chunk->z);
|
||||||
|
|
||||||
if (RenderManager.CBuffCall(list, first)) {
|
if (RenderManager.CBuffCall(list, first)) {
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
glPopMatrix();
|
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
RenderManager.SetChunkOffset(0.f, 0.f, 0.f);
|
||||||
|
|
||||||
#ifdef __PSVITA__
|
#ifdef __PSVITA__
|
||||||
// AP - alpha cut out is expensive on vita. Now we render all the alpha cut
|
// AP - alpha cut out is expensive on vita. Now we render all the alpha cut
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue