improve visuals
This commit is contained in:
parent
b25dd6161a
commit
e3e5fbd7fd
15 changed files with 31 additions and 64 deletions
|
@ -3874,6 +3874,8 @@ public class Renderer {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
float f = 0.0F;
|
float f = 0.0F;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
|
int a = 0;
|
||||||
|
int s = 0;
|
||||||
|
|
||||||
for (int j = 0; j < 4; ++j)
|
for (int j = 0; j < 4; ++j)
|
||||||
{
|
{
|
||||||
|
@ -3893,14 +3895,16 @@ public class Renderer {
|
||||||
|
|
||||||
if (!material.isNonBlock()) // material != block
|
if (!material.isNonBlock()) // material != block
|
||||||
{
|
{
|
||||||
if (material == Blocks.air)
|
if (!material.canConnectNonBlock())
|
||||||
{
|
{
|
||||||
|
++a;
|
||||||
f += 4;
|
f += 4;
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
++s;
|
||||||
f += 1.0F / 9.0f;
|
f += 1.0F / 9.0f;
|
||||||
i += 10;
|
i += 10;
|
||||||
|
|
||||||
|
@ -3909,6 +3913,6 @@ public class Renderer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return n == 4 ? 1.0f : 1.0F - f / (float)i;
|
return n == 4 ? 1.0f : (s + a == 4 && a > 1 ? 0.0f : 1.0F - f / (float)i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ public enum Shader {
|
||||||
context.integer("n_lights", 0);
|
context.integer("n_lights", 0);
|
||||||
|
|
||||||
context.color3("specular", Client.CLIENT.specularColors && !Client.CLIENT.setGamma && !Client.CLIENT.xrayActive ? 0xffffff : 0x000000);
|
context.color3("specular", Client.CLIENT.specularColors && !Client.CLIENT.setGamma && !Client.CLIENT.xrayActive ? 0xffffff : 0x000000);
|
||||||
context.bool("shade", Client.CLIENT.flatShading);
|
context.bool("shade", Client.CLIENT.flatShading || Client.CLIENT.setGamma || Client.CLIENT.xrayActive);
|
||||||
|
|
||||||
GlState.setActiveTexture(GL46.GL_TEXTURE0);
|
GlState.setActiveTexture(GL46.GL_TEXTURE0);
|
||||||
// glBindBufferBase(GL_UNIFORM_BUFFER, 0, world->light_buf);
|
// glBindBufferBase(GL_UNIFORM_BUFFER, 0, world->light_buf);
|
||||||
|
|
|
@ -31,8 +31,6 @@ import common.util.Vec3i;
|
||||||
|
|
||||||
public class RenderItem
|
public class RenderItem
|
||||||
{
|
{
|
||||||
private static final String RES_ITEM_GLINT = "textures/glint.png";
|
|
||||||
|
|
||||||
private final ItemModelMesher mesher;
|
private final ItemModelMesher mesher;
|
||||||
private final TextureManager manager;
|
private final TextureManager manager;
|
||||||
private final LayerArmor armor = new LayerArmor(null, 12, 12) {
|
private final LayerArmor armor = new LayerArmor(null, 12, 12) {
|
||||||
|
@ -99,11 +97,6 @@ public class RenderItem
|
||||||
{
|
{
|
||||||
GL46.glTranslatef(-0.5F, -0.5F, -0.5F);
|
GL46.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||||
this.renderModel(model, stack);
|
this.renderModel(model, stack);
|
||||||
|
|
||||||
if (stack.getItem().isGleaming(stack))
|
|
||||||
{
|
|
||||||
this.renderEffect(model);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GL46.glPopMatrix();
|
GL46.glPopMatrix();
|
||||||
|
@ -171,36 +164,6 @@ public class RenderItem
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderEffect(IBakedModel model)
|
|
||||||
{
|
|
||||||
GlState.depthMask(false);
|
|
||||||
GlState.depthFunc(GL46.GL_EQUAL);
|
|
||||||
GlState.disableLighting();
|
|
||||||
GlState.blendFunc(GL46.GL_SRC_COLOR, GL46.GL_ONE);
|
|
||||||
this.manager.bindTexture(RES_ITEM_GLINT);
|
|
||||||
GL46.glMatrixMode(GL46.GL_TEXTURE);
|
|
||||||
GL46.glPushMatrix();
|
|
||||||
GL46.glScalef(8.0F, 8.0F, 8.0F);
|
|
||||||
float f = (float)(System.currentTimeMillis() % 3000L) / 3000.0F / 8.0F;
|
|
||||||
GL46.glTranslatef(f, 0.0F, 0.0F);
|
|
||||||
GL46.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
|
|
||||||
this.renderModel(model, -8372020);
|
|
||||||
GL46.glPopMatrix();
|
|
||||||
GL46.glPushMatrix();
|
|
||||||
GL46.glScalef(8.0F, 8.0F, 8.0F);
|
|
||||||
float f1 = (float)(System.currentTimeMillis() % 4873L) / 4873.0F / 8.0F;
|
|
||||||
GL46.glTranslatef(-f1, 0.0F, 0.0F);
|
|
||||||
GL46.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
|
|
||||||
this.renderModel(model, -8372020);
|
|
||||||
GL46.glPopMatrix();
|
|
||||||
GL46.glMatrixMode(GL46.GL_MODELVIEW);
|
|
||||||
GlState.blendFunc(GL46.GL_SRC_ALPHA, GL46.GL_ONE_MINUS_SRC_ALPHA);
|
|
||||||
GlState.enableLighting();
|
|
||||||
GlState.depthFunc(GL46.GL_LEQUAL);
|
|
||||||
GlState.depthMask(true);
|
|
||||||
this.manager.bindTexture(TextureMap.BLOCKS);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void putQuadNormal(RenderBuffer renderer, BakedQuad quad)
|
private void putQuadNormal(RenderBuffer renderer, BakedQuad quad)
|
||||||
{
|
{
|
||||||
Vec3i vec3i = quad.getFace().getDirectionVec();
|
Vec3i vec3i = quad.getFace().getDirectionVec();
|
||||||
|
|
|
@ -22,7 +22,7 @@ uniform bool shade;
|
||||||
void main() {
|
void main() {
|
||||||
vec3 nvertex = vec3(model * vec4(pos, 1.0));
|
vec3 nvertex = vec3(model * vec4(pos, 1.0));
|
||||||
vertex = vec3(float(chunk_x) + pos.x, float(chunk_y) + pos.y, float(chunk_z) + pos.z);
|
vertex = vec3(float(chunk_x) + pos.x, float(chunk_y) + pos.y, float(chunk_z) + pos.z);
|
||||||
shading = shade ? (norm.x != 0.0 ? 0.6 : (norm.z != 0.0 ? 0.8 : (norm.y < 0.0 ? 0.5 : 1.0))) : 1.0;
|
shading = shade ? (norm.x != 0.0 ? 0.6 : (norm.z != 0.0 ? 0.8 : (norm.y > 0.0 ? 0.5 : 1.0))) : 1.0;
|
||||||
normal = mat3(transpose(inverse(model))) * norm.xyz;
|
normal = mat3(transpose(inverse(model))) * norm.xyz;
|
||||||
shine = norm.a * 32.0;
|
shine = norm.a * 32.0;
|
||||||
tex_coord = coord;
|
tex_coord = coord;
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 992 B |
|
@ -648,10 +648,6 @@ public class Block {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNonBlock() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isPassable(IBlockAccess world, BlockPos pos) {
|
public boolean isPassable(IBlockAccess world, BlockPos pos) {
|
||||||
return !this.material.blocksMovement();
|
return !this.material.blocksMovement();
|
||||||
}
|
}
|
||||||
|
@ -1100,4 +1096,14 @@ public class Block {
|
||||||
public String getInfo(World world, BlockPos pos, State state, EntityNPC player) {
|
public String getInfo(World world, BlockPos pos, State state, EntityNPC player) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Clientside
|
||||||
|
public boolean isNonBlock() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Clientside
|
||||||
|
public boolean canConnectNonBlock() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package common.block;
|
||||||
|
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.util.BoundingBox;
|
import common.util.BoundingBox;
|
||||||
|
import common.util.Clientside;
|
||||||
import common.world.State;
|
import common.world.State;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
|
||||||
|
@ -36,4 +37,9 @@ public final class BlockAir extends Block {
|
||||||
protected boolean hasRegisteredItem() {
|
protected boolean hasRegisteredItem() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Clientside
|
||||||
|
public boolean canConnectNonBlock() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import common.model.Model;
|
||||||
import common.rng.Random;
|
import common.rng.Random;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.util.BoundingBox;
|
import common.util.BoundingBox;
|
||||||
|
import common.util.Clientside;
|
||||||
import common.util.Facing;
|
import common.util.Facing;
|
||||||
import common.world.State;
|
import common.world.State;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
@ -87,6 +88,11 @@ public class BlockBush extends Block
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Clientside
|
||||||
|
public boolean canConnectNonBlock() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public static Model makeCrossModel(Model model) {
|
public static Model makeCrossModel(Model model) {
|
||||||
return model
|
return model
|
||||||
|
|
|
@ -283,7 +283,7 @@ public abstract class ItemRegistry {
|
||||||
register("melon_seed", new ItemSeeds(Blocks.melon_stem, Blocks.farmland).setDisplay("Melonenkerne").setMaxAmount(StackSize.XL));
|
register("melon_seed", new ItemSeeds(Blocks.melon_stem, Blocks.farmland).setDisplay("Melonenkerne").setMaxAmount(StackSize.XL));
|
||||||
|
|
||||||
register("whip", (new ItemWhip()).setDisplay("Peitsche"));
|
register("whip", (new ItemWhip()).setDisplay("Peitsche"));
|
||||||
register("charge_crystal", (new Item()).setDisplay("Energiekristall").setTab(CheatTab.MATERIALS).setColor(Color.DARK_MAGENTA).setGleaming().setFuelAmount(120000));
|
register("charge_crystal", (new Item()).setDisplay("Energiekristall").setTab(CheatTab.MATERIALS).setColor(Color.DARK_MAGENTA).setFuelAmount(120000));
|
||||||
for(Enchantment ench : Enchantment.values()) {
|
for(Enchantment ench : Enchantment.values()) {
|
||||||
register("enchanted_book_" + ench.getName(), (new ItemEnchantedBook(ench, 1)).setUnstackable().setDisplay("Verzaubertes Buch mit " + ench.getFormattedName(1)).setTab(CheatTab.ENCHANTMENTS));
|
register("enchanted_book_" + ench.getName(), (new ItemEnchantedBook(ench, 1)).setUnstackable().setDisplay("Verzaubertes Buch mit " + ench.getFormattedName(1)).setTab(CheatTab.ENCHANTMENTS));
|
||||||
int max = ench.getMaxLevel();
|
int max = ench.getMaxLevel();
|
||||||
|
|
|
@ -36,7 +36,6 @@ public class Item {
|
||||||
private int fuelAmount = 0;
|
private int fuelAmount = 0;
|
||||||
private int explosive = 0;
|
private int explosive = 0;
|
||||||
private boolean magnetic = false;
|
private boolean magnetic = false;
|
||||||
private boolean gleaming = false;
|
|
||||||
private boolean fragile = false;
|
private boolean fragile = false;
|
||||||
|
|
||||||
public Item() {
|
public Item() {
|
||||||
|
@ -108,11 +107,6 @@ public class Item {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final Item setGleaming() {
|
|
||||||
this.gleaming = true;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final Item setFragile() {
|
public final Item setFragile() {
|
||||||
this.fragile = true;
|
this.fragile = true;
|
||||||
return this;
|
return this;
|
||||||
|
@ -181,11 +175,6 @@ public class Item {
|
||||||
return this.magnetic;
|
return this.magnetic;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Clientside
|
|
||||||
public final boolean isGleaming(ItemStack stack) {
|
|
||||||
return this.gleaming || stack.isItemEnchanted();
|
|
||||||
}
|
|
||||||
|
|
||||||
public final boolean isFragile() {
|
public final boolean isFragile() {
|
||||||
return this.fragile;
|
return this.fragile;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,8 +16,6 @@ public class ItemAppleGold extends ItemFood
|
||||||
super(amount, false);
|
super(amount, false);
|
||||||
this.powered = powered;
|
this.powered = powered;
|
||||||
this.setColor(powered ? Color.MAGENTA : Color.NEON);
|
this.setColor(powered ? Color.MAGENTA : Color.NEON);
|
||||||
if(this.powered)
|
|
||||||
this.setGleaming();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onFoodEaten(ItemStack stack, World worldIn, EntityNPC player)
|
protected void onFoodEaten(ItemStack stack, World worldIn, EntityNPC player)
|
||||||
|
|
|
@ -77,8 +77,6 @@ public class ItemPotion extends Item
|
||||||
this.setColor(Color.ORK);
|
this.setColor(Color.ORK);
|
||||||
this.setDisplay(getDisplay(this));
|
this.setDisplay(getDisplay(this));
|
||||||
this.setFragile();
|
this.setFragile();
|
||||||
if(this.effect != null)
|
|
||||||
this.setGleaming();
|
|
||||||
POTIONS.add(this);
|
POTIONS.add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,6 @@ public class ItemEnchantedBook extends Item
|
||||||
|
|
||||||
public ItemEnchantedBook(Enchantment enchantment, int level) {
|
public ItemEnchantedBook(Enchantment enchantment, int level) {
|
||||||
this.setColor(Color.YELLOW);
|
this.setColor(Color.YELLOW);
|
||||||
this.setGleaming();
|
|
||||||
this.setFuelAmount(80);
|
this.setFuelAmount(80);
|
||||||
this.enchantment = enchantment;
|
this.enchantment = enchantment;
|
||||||
this.level = level;
|
this.level = level;
|
||||||
|
|
|
@ -12,7 +12,6 @@ public class ItemEditor extends Item {
|
||||||
public ItemEditor() {
|
public ItemEditor() {
|
||||||
this.setUnstackable();
|
this.setUnstackable();
|
||||||
this.setTab(CheatTab.TOOLS);
|
this.setTab(CheatTab.TOOLS);
|
||||||
this.setGleaming();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean onAction(ItemStack stack, EntityNPC player, World world, ItemControl control, BlockPos block) {
|
public boolean onAction(ItemStack stack, EntityNPC player, World world, ItemControl control, BlockPos block) {
|
||||||
|
|
|
@ -21,7 +21,6 @@ public abstract class ItemWand extends Item {
|
||||||
public ItemWand() {
|
public ItemWand() {
|
||||||
this.setUnstackable();
|
this.setUnstackable();
|
||||||
this.setTab(CheatTab.TOOLS);
|
this.setTab(CheatTab.TOOLS);
|
||||||
this.setGleaming();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final boolean onAction(ItemStack stack, EntityNPC player, World world, ItemControl control, BlockPos block) {
|
public final boolean onAction(ItemStack stack, EntityNPC player, World world, ItemControl control, BlockPos block) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue