reduced quality to improve performance
This commit is contained in:
@@ -276,15 +276,17 @@ public class LodNodeBufferBuilder
|
||||
// add this LOD to the buffer
|
||||
int distance = (int) Math.sqrt(Math.pow((mc.player.getX() - lod.startBlockPos.getX()),2) + Math.pow((mc.player.getZ() - lod.startBlockPos.getZ()),2));
|
||||
LodDetail detail;
|
||||
if(distance < 200){
|
||||
/*
|
||||
if(distance < 100){
|
||||
detail = LodDetail.HALF;
|
||||
}else if(distance < 400){
|
||||
}else */if(distance < 200){
|
||||
detail = LodDetail.QUAD;
|
||||
}else if(distance < 600){
|
||||
}else if(distance < 400){
|
||||
detail = LodDetail.DOUBLE;
|
||||
}else{
|
||||
detail = LodDetail.SINGLE;
|
||||
}
|
||||
//detail = LodDetail.SINGLE;
|
||||
LodConfig.CLIENT.lodTemplate.get().
|
||||
template.addLodToBuffer(currentBuffer, lodDim, lod,
|
||||
xOffset , yOffset, zOffset, renderer.debugging, detail);
|
||||
|
||||
@@ -131,7 +131,7 @@ public class LodNodeBuilder {
|
||||
* @throws IllegalArgumentException thrown if either the chunk or world is null.
|
||||
*/
|
||||
public List<LodQuadTreeNode> generateLodNodeFromChunk(IChunk chunk, LodBuilderConfig config) throws IllegalArgumentException {
|
||||
LodDetail detail = LodDetail.HALF;
|
||||
LodDetail detail = LodDetail.QUAD;
|
||||
List<LodQuadTreeNode> lodNodeList = new ArrayList<>();
|
||||
if (chunk == null)
|
||||
throw new IllegalArgumentException("generateLodFromChunk given a null chunk");
|
||||
|
||||
@@ -313,9 +313,9 @@ public class LodQuadTreeNode
|
||||
{
|
||||
// TODO would it be better to use the average height/depth?
|
||||
// get the lowest height from the all the given LodQuadTreeNodes
|
||||
short height = (short) dataList.stream().mapToInt(x -> (int) x.getLodDataPoint().height).max().getAsInt();
|
||||
short height = (short) dataList.stream().mapToInt(x -> (int) x.getLodDataPoint().height).min().getAsInt();
|
||||
// get the highest depth
|
||||
short depth = (short) dataList.stream().mapToInt(x -> (int) x.getLodDataPoint().depth).min().getAsInt();
|
||||
short depth = (short) dataList.stream().mapToInt(x -> (int) x.getLodDataPoint().depth).max().getAsInt();
|
||||
|
||||
// get the average color
|
||||
int red = dataList.stream().mapToInt(x -> x.getLodDataPoint().color.getRed()).sum() / dataList.size();
|
||||
|
||||
Reference in New Issue
Block a user