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

Accessing the Tint Index in getPackedLightmapCoords()


xalcon
 Share

Recommended Posts

Hello!

I'm trying to render multiple layers of a block with different brightness values to achieve a "glow in the dark" effect without actually emitting any light.

I was able to do this by returning a different lightmap coordinate depending on the tint index. While this works fine, it requires a fair amount of reflection, since i need to read the information from VertexLighterFlat#tint (ForgeBlockModelRenderer#lighterFlat)

 

My suggestion would be to somehow make the tint index information available to Block#getPackedLightmapCoords(). Currently, I can think of 3 ways to do this, but there are maybe a few more

  • pass the tint index to Block#getPackedLightmapCoords(). The information is available in VertexLighterFlat#updateLightmap so it can just be passed to IBlockState#getPackedLightmapCoords(). The issue here is, its not the only place where Block#getPackedLightmapCoords() (or IBlockState#getPackedLightmapCoords()) is called and not all of those spots have a tint index available. We could pass -1 in those cases tho.
  • Make the tint index available via a getter method. Either from ForgeBlockModelRenderer directly or from VertexLighterFlat (this one only has a setter method atm). If we go with the latter one, we also need a getter in ForgeBlockModelRenderer to get the VertexLighterFlat instance
  • Add new interface to get the brightness for a specific tint index, similar to IBlockColor

 

Like I said, i currently use reflection to get the tint index, so I know it works - atleast partially, who knows how this might break. If there is a different way to achieve what I'm doing atm, tell me D:

eiIOT9U.png

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.
Note: Your post will require moderator approval before it will be visible.

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.