Jump to content

[1.7.10][solved] Problem with lightning and TileEntitySpecialRenderer


Recommended Posts

Posted

Hi, I'm working on a (ComputerCraft controlled) hologram projector.

 

The hologram projector projects above it smaller versions of blocks which are set by a lua program, that runs on a computer.

The projector tile entity implements IWorldAccess, so before rendering the RenderBlocks BlockAccess will be swapped out with mine and then I render the block by using RenderStandardBlock.

 

My problem is that if the sky isn't occluded by other blocks, the model is displayed too dark, but the grass colors(and colors generally work). If the sky is rendered then the model renders with full brightness, but the colors aren't rendered.

 

I already tried to disable brightness with reflection and with a custom tessellator draw method, nothing of this worked.

 

Here is my rendering code:

TileEntity projector = tile.getWorldObj().getTileEntity(tile.xCoord, tile.yCoord - 1, tile.zCoord);
	if (projector instanceof TileHologramProjector) {
		Tessellator t = Tessellator.instance;

		t.startDrawingQuads();

		IBlockAccess backupAccess = RenderBlocks.getInstance().blockAccess;
		RenderBlocks.getInstance().blockAccess = (IBlockAccess) projector;

		try {
			int previousVertexCount = fVertexCount.getInt(t);

			for (int y1 = 0; y1 < TileHologramProjector.hologramHeight; y1++) {
				for (int z1 = 0; z1 < TileHologramProjector.hologramDepth; z1++) {
					for (int x1 = 0; x1 < TileHologramProjector.hologramWidth; x1++) {

						RenderBlocks.getInstance().renderBlockByRenderType(
								((TileHologramProjector) projector).getBlock(x1, y1, z1), x1, y1, z1);

						if (fVertexCount.getInt(t) == previousVertexCount
								&& !((TileHologramProjector) projector).isAirBlock(x1, y1, z1)) {
							RenderBlocks.getInstance().renderStandardBlock(
									((TileHologramProjector) projector).getBlock(x1, y1, z1), x1, y1, z1);
							// RandomPeripherals.logger.info("Fallback
							// renderer!");
						}
						previousVertexCount = fVertexCount.getInt(t);
					}
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}

		RenderBlocks.getInstance().blockAccess = backupAccess;

		GL11.glPushMatrix();

		GL11.glTranslated(x, y, z);
		GL11.glScalef(0.125f, 0.125f, 0.125f);

		bindTexture(RandomPeripherals.proxy.blockResLoc);

		t.draw();

		GL11.glPopMatrix();
	}

Posted

Ok, I solved the problem by adding a call of the function RenderHelper.disableStandardItemLighting after binding the texture.

 

I don't know why Minecraft keeps the fixed Render pipeline light enabled when rendering tile entities with special renderer, but this seems to work.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • UPDATE: this seems to be an Arch-specific issue. Switching to Ubuntu server fixed EVERYTHING.
    • Yes, Attapoll offers a $20 Sign-up bonus for new users using a code (AOVCQ). Enter the Attapoll Referral Code “AOVCQ” and submit. Yes, Attapoll offers $20 Referral Code {AOVCQ} For New Customers. If you are who wish to join Attapoll, then you should use this exclusive Attapoll referral code $20 Signup Bonus Use this Code (AOVCQ) and get $20 Welcome Bonus. You can get a $20 Signup bonus use this referral code {AOVCQ}. You can get a $20 Attpoll Referral Code {AOVCQ}. This Attapoll $20 Referral code is specifically for existing customers and can be redeemed to receive a $20. Enter $20 Attapoll Referral Code {AOVCQ} at checkout. Enjoy $20Welcome Bonus. Use the best Attapoll referral code $20 (AOVCQ) to get up to $20 first time survey as a new user. Complete the survey and get $20 credited on your Attapoll account. Plus, refer your friend to earn 10% commission on their earning If you're on the hunt for a little extra cash or some cool rewards without too much hassle, you've landed in the right place. Today, we're diving into the world of Attapoll referral codes, a nifty way to boost your earnings while taking surveys. Use this Attapoll Referral Link or code {{AOVCQ}} to get a $20 sign up bonus.
    • Yes, Attapoll offers a $20 Sign-up bonus for new users using a code (AOVCQ). Enter the Attapoll Referral Code “AOVCQ” and submit. Yes, Attapoll offers $20 Referral Code {AOVCQ} For New Customers. If you are who wish to join Attapoll, then you should use this exclusive Attapoll referral code $20 Signup Bonus Use this Code (AOVCQ) and get $20 Welcome Bonus. You can get a $20 Signup bonus use this referral code {AOVCQ}. You can get a $20 Attpoll Referral Code {AOVCQ}. This Attapoll $20 Referral code is specifically for existing customers and can be redeemed to receive a $20. Enter $20 Attapoll Referral Code {AOVCQ} at checkout. Enjoy $20Welcome Bonus. Use the best Attapoll referral code $20 (AOVCQ) to get up to $20 first time survey as a new user. Complete the survey and get $20 credited on your Attapoll account. Plus, refer your friend to earn 10% commission on their earning If you're on the hunt for a little extra cash or some cool rewards without too much hassle, you've landed in the right place. Today, we're diving into the world of Attapoll referral codes, a nifty way to boost your earnings while taking surveys. Use this Attapoll Referral Link or code {{AOVCQ}} to get a $20 sign up bonus.
    • Yes, Attapoll offers a $20 Sign-up bonus for new users using a code (AOVCQ). Enter the Attapoll Referral Code “AOVCQ” and submit. Yes, Attapoll offers $20 Referral Code {AOVCQ} For New Customers. If you are who wish to join Attapoll, then you should use this exclusive Attapoll referral code $20 Signup Bonus Use this Code (AOVCQ) and get $20 Welcome Bonus. You can get a $20 Signup bonus use this referral code {AOVCQ}. You can get a $20 Attpoll Referral Code {AOVCQ}. This Attapoll $20 Referral code is specifically for existing customers and can be redeemed to receive a $20. Enter $20 Attapoll Referral Code {AOVCQ} at checkout. Enjoy $20Welcome Bonus. Use the best Attapoll referral code $20 (AOVCQ) to get up to $20 first time survey as a new user. Complete the survey and get $20 credited on your Attapoll account. Plus, refer your friend to earn 10% commission on their earning If you're on the hunt for a little extra cash or some cool rewards without too much hassle, you've landed in the right place. Today, we're diving into the world of Attapoll referral codes, a nifty way to boost your earnings while taking surveys. Use this Attapoll Referral Link or code {{AOVCQ}} to get a $20 sign up bonus.
    • Yes, Attapoll offers a $20 Sign-up bonus for new users using a code (AOVCQ). Enter the Attapoll Referral Code “AOVCQ” and submit. Yes, Attapoll offers $20 Referral Code {AOVCQ} For New Customers. If you are who wish to join Attapoll, then you should use this exclusive Attapoll referral code $20 Signup Bonus Use this Code (AOVCQ) and get $20 Welcome Bonus. You can get a $20 Signup bonus use this referral code {AOVCQ}. You can get a $20 Attpoll Referral Code {AOVCQ}. This Attapoll $20 Referral code is specifically for existing customers and can be redeemed to receive a $20. Enter $20 Attapoll Referral Code {AOVCQ} at checkout. Enjoy $20Welcome Bonus. Use the best Attapoll referral code $20 (AOVCQ) to get up to $20 first time survey as a new user. Complete the survey and get $20 credited on your Attapoll account. Plus, refer your friend to earn 10% commission on their earning If you're on the hunt for a little extra cash or some cool rewards without too much hassle, you've landed in the right place. Today, we're diving into the world of Attapoll referral codes, a nifty way to boost your earnings while taking surveys. Use this Attapoll Referral Link or code {{AOVCQ}} to get a $20 sign up bonus.
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

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