mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-23 14:43:38 +00:00
new culler
This commit is contained in:
parent
abba4b57ce
commit
51ad1434db
|
|
@ -807,11 +807,6 @@ int compare(const void* a, const void* b) {
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
// 4jcraft: removed the vita & ps3 versions because they were SEVERELY annoying
|
||||
// me it looked so ugly, god.
|
||||
// if you ever hate me for it, deal with it, the source code is STILL visible if
|
||||
// you look at someone elses fork. like steamcmd
|
||||
int LevelRenderer::renderChunks(int from, int to, int layer, double alpha) {
|
||||
int playerIndex = mc->player->GetXboxPad();
|
||||
if (chunks[playerIndex].data == NULL) return 0;
|
||||
|
|
@ -824,17 +819,13 @@ int LevelRenderer::renderChunks(int from, int to, int layer, double alpha) {
|
|||
glPushMatrix();
|
||||
glTranslatef((float)-xOff, (float)-yOff, (float)-zOff);
|
||||
|
||||
ClipChunk* pClipChunk = chunks[playerIndex].data;
|
||||
unsigned char emptyFlag = LevelRenderer::CHUNK_FLAG_EMPTY0 << layer;
|
||||
bool first = true;
|
||||
int count = 0;
|
||||
#ifdef __PS3__
|
||||
waitForCull_SPU();
|
||||
if (layer == 0) {
|
||||
count = g_cullDataIn[playerIndex].numToRender_layer0;
|
||||
RenderManager.CBuffCallMultiple(
|
||||
g_cullDataIn[playerIndex].listArray_layer0, count);
|
||||
} else // layer == 1
|
||||
{
|
||||
} else { // layer == 1
|
||||
count = g_cullDataIn[playerIndex].numToRender_layer1;
|
||||
RenderManager.CBuffCallMultiple(
|
||||
g_cullDataIn[playerIndex].listArray_layer1, count);
|
||||
|
|
@ -891,19 +882,10 @@ int LevelRenderer::renderChunks(int from, int to, int layer, double alpha) {
|
|||
// first
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
FRAME_PROFILE_SCOPE(ChunkPlayback);
|
||||
for (ClipChunk* chunk : sortList) {
|
||||
// ugly occluder
|
||||
float dx = (chunk->chunk->x + 8.0f) - (float)xOff;
|
||||
float dy = (chunk->chunk->y + 8.0f) - (float)yOff;
|
||||
float dz = (chunk->chunk->z + 8.0f) - (float)zOff;
|
||||
bool isVeryNear = (dx * dx + dy * dy + dz * dz) < (16.0f * 16.0f);
|
||||
|
||||
if (!isVeryNear && layer == 0) {
|
||||
// todo: occlusion flag
|
||||
}
|
||||
|
||||
int list = chunk->globalIdx * 2 + layer;
|
||||
list += chunkLists;
|
||||
|
||||
|
|
|
|||
|
|
@ -27,17 +27,16 @@ option(
|
|||
)
|
||||
|
||||
option(
|
||||
<<<<<<< HEAD
|
||||
'enable_frame_profiler',
|
||||
type: 'boolean',
|
||||
value: false,
|
||||
description: 'Enable the in-engine frame profiler for render hotspot discovery.',
|
||||
)
|
||||
=======
|
||||
|
||||
option(
|
||||
'occlusion_culling',
|
||||
type: 'combo',
|
||||
choices: ['off', 'frustum', 'bfs', 'hardware'],
|
||||
value: 'frustum',
|
||||
description: 'Occlusion culling mode. Off disables ALL CULLING (debug only!), Frustum disables offscreen rendering (default), BFS is experimental connectivity culling, hardware uses GPU queries.',
|
||||
)
|
||||
>>>>>>> db062d4ba (new culler)
|
||||
|
|
|
|||
Loading…
Reference in a new issue