Fixed anaglyph transformation not being applied in the forge lighting fully.
This commit is contained in:
parent
cbe2766c0a
commit
b6664c76c5
1 changed files with 13 additions and 0 deletions
|
@ -5,6 +5,7 @@ import javax.vecmath.Vector3f;
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.renderer.EntityRenderer;
|
||||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||||
import net.minecraft.client.renderer.vertex.VertexFormatElement;
|
import net.minecraft.client.renderer.vertex.VertexFormatElement;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
|
@ -132,6 +133,10 @@ public class VertexLighterFlat extends QuadGatheringTransformer
|
||||||
|
|
||||||
updateLightmap(normal[v], lightmap[v], x, y, z);
|
updateLightmap(normal[v], lightmap[v], x, y, z);
|
||||||
updateColor(normal[v], color[v], x, y, z, tint, multiplier);
|
updateColor(normal[v], color[v], x, y, z, tint, multiplier);
|
||||||
|
if(EntityRenderer.anaglyphEnable)
|
||||||
|
{
|
||||||
|
applyAnaglyph(color[v]);
|
||||||
|
}
|
||||||
|
|
||||||
// no need for remapping cause all we could've done is add 1 element to the end
|
// no need for remapping cause all we could've done is add 1 element to the end
|
||||||
for(int e = 0; e < parent.getVertexFormat().getElementCount(); e++)
|
for(int e = 0; e < parent.getVertexFormat().getElementCount(); e++)
|
||||||
|
@ -167,6 +172,14 @@ public class VertexLighterFlat extends QuadGatheringTransformer
|
||||||
tint = -1;
|
tint = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void applyAnaglyph(float[] color)
|
||||||
|
{
|
||||||
|
float r = color[0];
|
||||||
|
color[0] = (r * 30 + color[1] * 59 + color[2] * 11) / 100;
|
||||||
|
color[1] = (r * 3 + color[1] * 7) / 10;
|
||||||
|
color[2] = (r * 3 + color[2] * 7) / 10;
|
||||||
|
}
|
||||||
|
|
||||||
protected void updateLightmap(float[] normal, float[] lightmap, float x, float y, float z)
|
protected void updateLightmap(float[] normal, float[] lightmap, float x, float y, float z)
|
||||||
{
|
{
|
||||||
float e1 = 1 - 1e-2f;
|
float e1 = 1 - 1e-2f;
|
||||||
|
|
Loading…
Reference in a new issue