mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Forge pipeline will now take original model lightmap into account, if present.
This commit is contained in:
1 parent
7c4d643de2
commit
f0ae51bb34
3 files changed
+14
-2
No files matched your search
+7
-1
@@ -8,6 +8,7 @@ public abstract class QuadGatheringTransformer implements IVertexConsumer
|
||||
protected VertexFormat format;
|
||||
protected int vertices = 0;
|
||||
|
||||
protected byte[] dataLength = null;
|
||||
protected float[][][] quadData = null;
|
||||
|
||||
public void setParent(IVertexConsumer parent)
|
||||
@@ -18,6 +19,7 @@ public abstract class QuadGatheringTransformer implements IVertexConsumer
|
||||
public void setVertexFormat(VertexFormat format)
|
||||
{
|
||||
this.format = format;
|
||||
dataLength = new byte[format.getElementCount()];
|
||||
quadData = new float[format.getElementCount()][4][4];
|
||||
}
|
||||
|
||||
@@ -32,7 +34,11 @@ public abstract class QuadGatheringTransformer implements IVertexConsumer
|
||||
{
|
||||
System.arraycopy(data, 0, quadData[element][vertices], 0, data.length);
|
||||
if(element == getVertexFormat().getElementCount() - 1) vertices++;
|
||||
if(vertices == 4)
|
||||
if(vertices == 0)
|
||||
{
|
||||
dataLength[element] = (byte)data.length;
|
||||
}
|
||||
else if(vertices == 4)
|
||||
{
|
||||
vertices = 0;
|
||||
processQuad();
|
||||
|
||||
@@ -131,7 +131,13 @@ public class VertexLighterFlat extends QuadGatheringTransformer
|
||||
z += normal[v][2] * .5f;
|
||||
}
|
||||
|
||||
float blockLight = lightmap[v][0], skyLight = lightmap[v][1];
|
||||
updateLightmap(normal[v], lightmap[v], x, y, z);
|
||||
if(dataLength[lightmapIndex] > 1)
|
||||
{
|
||||
if(blockLight > lightmap[v][0]) lightmap[v][0] = blockLight;
|
||||
if(skyLight > lightmap[v][1]) lightmap[v][1] = skyLight;
|
||||
}
|
||||
updateColor(normal[v], color[v], x, y, z, tint, multiplier);
|
||||
if(EntityRenderer.anaglyphEnable)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user