Jump to content

[1.15.2] General Texture Atlases/Stitching Question


Ugdhar

Recommended Posts

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

Link to comment
Share on other sites

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:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Link to comment
Share on other sites

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:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

3 minutes ago, 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).

 

4 minutes ago, Draco18s said:

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

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 :)

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.

Announcements



×
×
  • Create New...

Important Information

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