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    7696

diesieben07

diesieben07    7696

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7696
  • 56382 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

    • kiou.23
      Block Rotate

      By kiou.23 · Posted 3 minutes ago

      That's usually the case, always try to understand the code before copy and pasting, or else you'll get a lot of headaches later in the code's life
    • Varzac
      Forge jar file not opening

      By Varzac · Posted 29 minutes ago

      I ran Jarfix and then tried installing again with the same results. Nothing happening I even tried using winrar, but as you said nothing happened
    • BeardlessBrady
      [1.16.4] Null when OpenGUI

      By BeardlessBrady · Posted 34 minutes ago

      Ah.. Thats what I get for stopping half way through and not double checking, thanks!
    • poopoodice
      [1.16.4] Null when OpenGUI

      By poopoodice · Posted 49 minutes ago

      https://github.com/Beardlessbrady/Currency-Mod/blob/master-1.16/src/main/java/com/beardlessbrady/gocurrency/blocks/vending/VendingTile.java#L68 This should not be null.
    • -MCS_Gaming-
      Matchmaking System?

      By -MCS_Gaming- · Posted 51 minutes ago

      I'm making an fps style mod and want to implement a matchmaking system, but I have absolutely no idea where to begin. Would anyone be able to give me some pointers as to how I would go about doing this?
  • Topics

    • ehbean
      10
      Block Rotate

      By ehbean
      Started 6 hours ago

    • Varzac
      3
      Forge jar file not opening

      By Varzac
      Started 13 hours ago

    • BeardlessBrady
      2
      [1.16.4] Null when OpenGUI

      By BeardlessBrady
      Started 1 hour ago

    • -MCS_Gaming-
      0
      Matchmaking System?

      By -MCS_Gaming-
      Started 51 minutes ago

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

      By Nyko
      Started 15 hours ago

  • Who's Online (See full list)

    • Jeldrik
    • kiou.23
    • ehbean
    • -MCS_Gaming-
    • Top_DawgsPM
    • BeardlessBrady
    • Twu
    • knees
    • JackRaidenPH
  • 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