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

I'm trying to make my entity's model be bright at a fixed light value. In 1.12.2 I was able to override getBrightnessForRender(), but this method is no longer there in 1.16.3. I've looked through the EntityRenderer class and couldn't find anything there either. Anyone know how I could achieve this? Btw getBrightness has nothing to do with how the entity is rendered, I checked.

Edited by Turtledove

Hi

Off the top of my head I don't recall, but you might get some way forward looking at this:

https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe81_entity_projectile/BoomerangRenderer.java

 

packedlightIn is probably the parameter of interest I think (i.e. in the render method)

 

packedLight is the skylight+blocklight value

https://greyminecraftcoder.blogspot.com/2020/04/lighting-1144.html  (used to be called "mixedBrightness")

 

-TGG

  • Author
13 hours ago, TheGreyGhost said:

Hi

Off the top of my head I don't recall, but you might get some way forward looking at this:

https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe81_entity_projectile/BoomerangRenderer.java

 

packedlightIn is probably the parameter of interest I think (i.e. in the render method)

 

packedLight is the skylight+blocklight value

https://greyminecraftcoder.blogspot.com/2020/04/lighting-1144.html  (used to be called "mixedBrightness")

 

-TGG

Yeah looks like that's about right. But now the problem is that I need every face of the entity's model to be lit up the same, but gl11 calls like GL11.glEnable(GL11.GL_MAX_LIGHTS) or even GL11.GLDisable(GL11.GL_LIGHTING) doesn't work.

Howdy

GL11.glEnable(GL11.GL_MAX_LIGHTS) and all those don't work any more, they're incorporated into your RenderTypeBuffer.  The reason is that the drawing is no longer done in-line, it is accumulated into the appropriate buffer (eg transparent blocks, entities, lines, etc) and each buffer is then drawn in one shot.

If you want to mess with the rendering settings, you need to choose a different RenderTypeBuffer or create your own custom.

 

Some more information here:

https://gist.github.com/williewillus/30d7e3f775fe93c503bddf054ef3f93e

 

If you need every face of the entity model to be lit up the same, you can modify your renderer to render all of the faces more brightly?  I'm not sure why that's a problem?

 

-TGG

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...

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.