Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Setting entity rendering brightness [1.16.3]


Turtledove
 Share

Recommended Posts

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.