Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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 by CookieLukas

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.