Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.7.2] Custom Render Block Lighting Issues?
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
Heltrato

[1.7.2] Custom Render Block Lighting Issues?

By Heltrato, June 8, 2014 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

Heltrato    1

Heltrato

Heltrato    1

  • Diamond Finder
  • Heltrato
  • Members
  • 1
  • 261 posts
Posted June 8, 2014

Hello Guys i found a glitchy thing over my custom render block .

 

in super flat the lighting is fine however when i got to the real overworld this strange thingy happens.

 

When i move on some sides the lightings gone like this.

 

 

8imMUcv.png

 

I followed the tutorial on how to rendering the model block but the lighting fix dint work

thou the getBlockBrightness was i think replaced i tried to change it into getMixedBrightness

 

anyways heres my render block code

package mhfc.net.client.render.block;

import org.lwjgl.opengl.GL11;

import mhfc.net.client.model.block.ModelArmorStandBase;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;

public class RenderArmorStandBase extends TileEntitySpecialRenderer {

private ModelArmorStandBase model;
private static final ResourceLocation texture = new ResourceLocation("mhfc:textures/tile/armorstandbase.png");

public RenderArmorStandBase() {
	model = new ModelArmorStandBase();
}

public void renderTileEntityAt(TileEntity tileentity, double x, double y,double z, float f) {
	GL11.glPushMatrix();
	GL11.glTranslatef((float)x + 0.5F, (float)y - -1.5F, (float)z + 0.5F);
	GL11.glRotatef(180F, 0F, 0F, 1F);
	bindTexture(texture);
	GL11.glPushMatrix();
	model.renderModel(0.0625F);
	GL11.glPopMatrix();
	GL11.glPopMatrix();
}

private void adjustLightFixture(World world, int i, int j, int k, Block block) {
        Tessellator tess = Tessellator.instance;
        float brightness = block.getMixedBrightnessForBlock(world, i, j, k);
        int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0);
        int modulousModifier = skyLight % 65536;
        int divModifier = skyLight / 65536;
        tess.setColorOpaque_F(brightness, brightness, brightness);
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit,  (float) modulousModifier,  divModifier);
        }

}

  • Quote

Share this post


Link to post
Share on other sites

fabricator77    0

fabricator77

fabricator77    0

  • Tree Puncher
  • fabricator77
  • Members
  • 0
  • 26 posts
Posted June 8, 2014

Try this, based upon differences between your code, and the renderer for Minecraft chests.

 

public void renderTileEntityAt(TileEntity tileentity, double x, double y,double z, float f) {
GL11.glPushMatrix();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glTranslatef((float)x + 0.5F, (float)y - -1.5F, (float)z + 0.5F);
GL11.glRotatef(180F, 0F, 0F, 1F);
bindTexture(texture);
GL11.glPushMatrix();
model.renderModel(0.0625F);
GL11.glPopMatrix();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glPopMatrix();
}

 

It's most likely the normal code that is your issue.

  • Quote

Share this post


Link to post
Share on other sites

Heltrato    1

Heltrato

Heltrato    1

  • Diamond Finder
  • Heltrato
  • Members
  • 1
  • 261 posts
Posted June 8, 2014

At some point it now works fine but still some when my steve goes in some short angles it does the dark lighting again :)

  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Rakaldo
      Forge not showing in the lanucher

      By Rakaldo · Posted 1 minute ago

      I have downloaded forge but it still wont show up in the launcher https://prnt.sc/10c4blb (btw its 1.16.4)
    • GhostGamesFSM
      1.16 Ore generation.

      By GhostGamesFSM · Posted 15 minutes ago

      sorry for the txt, but thanks for the comment. I don't have a BiomeLoadingEvent, but I just have to see how I do that. When I have that I send you a message if that works.
    • HOTSAUCEMAN
      help with loading my world

      By HOTSAUCEMAN · Posted 16 minutes ago

      just ran it again to get more updated logs  debug-1.log.gz
    • HOTSAUCEMAN
      help with loading my world

      By HOTSAUCEMAN · Posted 20 minutes ago

      when loading into my world it says its loading, and then changes to a dirt background with no text; i've looked at multiple threads, forums and videos but i can't find any issue similar to mine (at least on a similar version)  debug-1.log.gz
    • Beethoven92
      [1.16.5] Beacon Overwrite (Screen Error)

      By Beethoven92 · Posted 27 minutes ago

      I apologize...i misread the part where you say that your custom beacon inventory actually opens fine! Yeah, the proximity check is doing its job, the problem seems to be that when pressing the confirm button you are sending a vanilla CUpdateBeaconPacket, then handled by the server, which will check if your open container is a BeaconContainer. It would be helpful to see the complete code you have, please post a link to your repository
  • Topics

    • Rakaldo
      0
      Forge not showing in the lanucher

      By Rakaldo
      Started 1 minute ago

    • GhostGamesFSM
      2
      1.16 Ore generation.

      By GhostGamesFSM
      Started 17 hours ago

    • HOTSAUCEMAN
      1
      help with loading my world

      By HOTSAUCEMAN
      Started 20 minutes ago

    • Nyko
      3
      [1.16.5] Beacon Overwrite (Screen Error)

      By Nyko
      Started Yesterday at 07:22 AM

    • samjviana
      5
      [1.16.5] How to make EnchantedBook go to Custom ItemGroup

      By samjviana
      Started Sunday at 10:00 PM

  • Who's Online (See full list)

    • Rakaldo
    • EdekaKuchen
    • alexro871
    • GhostGamesFSM
    • Beethoven92
    • IntentScarab
    • CookieLukas
    • Tavi007
    • HOTSAUCEMAN
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.7.2] Custom Render Block Lighting Issues?
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community