Jump to content

Tinting an OBJ model?


desht

Recommended Posts

So, I saw this issue: https://github.com/MinecraftForge/MinecraftForge/issues/2851

 

...and I'm guessing there's no direct way to allow tinting (via IBlockColor) of an OBJ model (either the entire model or selected faces of the model) at this point.  That said, what would be the recommended way to achieve this indirectly?  The thoughts I had:

 

  1. Add a TESR to the block; it's a tile entity anyway
  2. Add one or more JSON submodels to the block to allow tinting of certain faces of the model
  3. Do something with the IBakedModel to replace the appropriate quads with the desired colour, based on some extended block property

 

Recommendations?  (1) would be simple enough but worst for performance, I assume.  (2) is also easy, but limited to horizontal/vertical faces of the model (or it'll look bad).  (3) if possible might be best, but can I intercept the baked model and modify certain quads?  That's something I've been having difficulty getting my head round...

Link to comment
Share on other sites

  • 4 weeks later...

Been doing some work on this: see https://github.com/MinecraftForge/MinecraftForge/issues/2851 for detailed description and link to sample implementation.

 

In short: I took option 3.  No need for extended properties, though; this just uses the normal IBlockColor tinting mechanism, allowing tinting to be controlled via the "custom" property in the blockstates file.

Edited by desht
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
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.



×
×
  • Create New...

Important Information

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