Jump to content

Recommended Posts

Posted

So, after seeing someone on here asking about custom shields, I thought that would be fun to mess with.

So after looking at vanilla code, designed my shield after the vanilla style with a ISTER, got my shield to render, but it was all black/no texture. After some searching, I found a comment on here by TheGreyGhost (dude you rule) mentioning his MBE21.

Looking at that, he had (commented out, but it was what I needed) an event for TextureStitchEvent.Pre which added a texture to the AtlasTexture.LOCATION_BLOCKS_TEXTURE which would appear to be a dynamically built texture atlas for, well, mostly blocks I would guess by the name. So creating that event and stitching my new shield texture to that atlas made my shield have a skin in all its glory!

 

So now, my question, is it OK to just stitch textures onto that texture atlas, or should I (not sure how, but I'd figure it out I imagine) create my own? I'm not actually *MAKING* a mod or anything, just tinkering, figuring stuff out, but I wouldn't want to get in the habit of hijacking (or advising people to) vanilla texture atlases if I can fill them up or something like that.

 

Sorry for the long winded explanation. :)

Posted (edited)

One important purpose of having texture atlas is to avoid binding a different texture every time a different texture is rendered (binding texture is expensive on OpenGL’s rendering). Therefore, it is a good idea to stitch mod textures onto existing (vanilla) texture atlases, as you won’t need to rebind to your own texture atlas every time you want to render something.

 

In addition, modded block textures are by default stitched to the vanilla texture atlas IIRC, which wouldn’t been done if there is a â€œhijacking” issue of texture atlases (since texture atlas is only used in rendering, the addition of new textures to it wouldn’t cause any problem).

Edited by DavidM
  • Thanks 1

Some tips:

  Reveal hidden contents

 

Posted (edited)

Haven't tested whether non 2^n texture works in texture stitching, but as far as I know textures that are 2^n should both be easier to handle during mipmapping and look better after mipmapping (especially at high mipmap levels).

Edited by DavidM

Some tips:

  Reveal hidden contents

 

Posted

Non-power-of-2 textures don't work great in Minecraft.

See this thread:

 

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
  On 4/8/2020 at 2:05 PM, DavidM said:

I haven't tested whether non 2^n texture works in Forge, but as far as I know textures that are 2^n should both be easier to handle during mipmapping and look better after mipmapping (especially at high mipmap levels).

Expand  

 

  On 4/8/2020 at 2:09 PM, Draco18s said:

Non-power-of-2 textures don't work great in Minecraft.

Expand  

Cool, thanks for your input guys. Obviously I don't know a lot about graphics programming/rendering, while still not my main interest or focus, definitely useful to know at least a little for forge tinkering :)

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



×
×
  • Create New...

Important Information

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