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
  • Tessellator ignores lighting?
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
CookieLukas

Tessellator ignores lighting?

By CookieLukas, January 18 in Modder Support

  • Start new topic

Recommended Posts

CookieLukas    0

CookieLukas

CookieLukas    0

  • Tree Puncher
  • CookieLukas
  • Members
  • 0
  • 5 posts
Posted January 18 (edited)

Im trying to render a simple plane with the following code:
 

Minecraft mc = Minecraft.getInstance();
	
	@SubscribeEvent
	public void renderWorldLastEvent(RenderWorldLastEvent evt){
		System.out.println("renderWorldLast");
		GL11.glPushMatrix();
		
		Vec3d projectedView = mc.gameRenderer.getActiveRenderInfo().getProjectedView();
		GL11.glTranslated(-projectedView.x, -projectedView.y, -projectedView.z);
		
		float x = 0;
		float y = 57;
		float z = 0;
		
		ResourceLocation texture = new ResourceLocation(ExampleMod.MODID, "debug.png");
		mc.textureManager.bindTexture(texture);
		Tessellator tessellator = Tessellator.getInstance();
		BufferBuilder bufferbuilder = tessellator.getBuffer();
	    
	    GL11.glEnable(GL11.GL_TEXTURE_2D);
	    
	    bufferbuilder.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); 
        bufferbuilder.pos(x, y + 1.1, z + 1.0D).tex(0, 1).endVertex();
        bufferbuilder.pos(x + 1.0D, y + 1.1, z + 1.0D).tex(1, 1).endVertex();
        bufferbuilder.pos(x + 1.0D, y + 1.1, z).tex(1, 0).endVertex();
        bufferbuilder.pos(x, y + 1.1, z).tex(0, 0).endVertex();

	  	GL11.glEnd();
        tessellator.draw();
        GlStateManager.popMatrix();
        
	    
	}

It renders the plane perfectly, but it just completly ignores lighting.
I tried stuff like

GlStateManager.enableLighting();

but I cant get it work.
Also, some textures like staind glass or water wont render in from of it.
How can I fix those issues?

Thanks in advance

-Lukas
 

Edited January 18 by CookieLukas

Share this post


Link to post
Share on other sites

ChampionAsh5357    165

ChampionAsh5357

ChampionAsh5357    165

  • World Shaper
  • ChampionAsh5357
  • Members
  • 165
  • 1038 posts
Posted January 18

What version is this?

Share this post


Link to post
Share on other sites

CookieLukas    0

CookieLukas

CookieLukas    0

  • Tree Puncher
  • CookieLukas
  • Members
  • 0
  • 5 posts
Posted January 18

Oh,  sorry, the code was 1.10.2, but as its not allowed here, I updated it to 1.14.4.

Share this post


Link to post
Share on other sites

diesieben07    7690

diesieben07

diesieben07    7690

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7690
  • 56283 posts
Posted January 18

Neither 1.10 now 1.14 are supported here.

Please refer to the supported versions page:

https://forums.minecraftforge.net/topic/91712-supported-version-directory/

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • JayNeedsHelp
      How can I fix this encoding issue?

      By JayNeedsHelp · Posted 1 hour ago

      Hey so I'm creating a forge mod and I'm trying to use the "§" character but I'm getting an illegal character error in the compiler. I've tried using the -encoding option in the compiler, I've also tried converting the file to UTF-8 without BOM, but it wasn't UTF-8 BOM in the first place. I was making a jar mod with mcp in eclipse and everything was working just fine with these characters, which I'm now moving to a forge mod. I'm using IntelliJ Community IDEA currently.   Here's a link to part of the error list: https://jay-hosts-a.dark-web.store/6AXsbJqG. Obviously the other errors were due to the illegal character error but I thought I might as well show it. I'm making a forge mod for 1.12.2, forgegradle is version 2.3-SNAPSHOT and I'm using mixingradle-0.6-SNAPSHOT.   I'm not sure how to fix this and any help would be greatly appreciated.
    • mchase
      Forge crashing

      By mchase · Posted 1 hour ago

      I downloaded and installed forge for 1.16.4 and it shows up in my installations and will start to open but then crashes and gives me "exit code 255". I am on MacOS if that makes a difference. it says The game crashed whilst initializing game Error: java.lang.IllegalStateException: GLFW error before init: [0x10008]Cocoa: Failed to find service port for display Exit Code: 255 does forge just not work on Mac? am I missing something? please help
    • MiToKonndria
      cant download pixelmon

      By MiToKonndria · Posted 2 hours ago

      when i click install on the Pixelmon modpack it gets to 42% and mod 3 out of 7 and then gives me the error message: Timeout attempting to download: "https://edge.forgecdn.net/files/3072/298/pixelmon-1.12.2-8.1.2-universal.jar"
    • lupicus
      can someone help with server crashing

      By lupicus · Posted 2 hours ago

      Looks like Wonderful Enchantments has problems, try and remove it.
    • Draco18s
      can someone help with server crashing

      By Draco18s · Posted 2 hours ago

      Surprise, accessing the client thread from the server thread isn't possible. Bitch at the author of wonderfulenchantments.
  • Topics

    • JayNeedsHelp
      0
      How can I fix this encoding issue?

      By JayNeedsHelp
      Started 1 hour ago

    • mchase
      0
      Forge crashing

      By mchase
      Started 1 hour ago

    • MiToKonndria
      0
      cant download pixelmon

      By MiToKonndria
      Started 2 hours ago

    • IRONDALEK
      3
      can someone help with server crashing

      By IRONDALEK
      Started 6 hours ago

    • Twu
      0
      Need help with Potion Brewing recipes

      By Twu
      Started 2 hours ago

  • Who's Online (See full list)

    • mcnuggies
    • LK1905
    • Choonster
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Tessellator ignores lighting?
  • Theme

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