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

[1.15.2] General Texture Atlases/Stitching Question


Ugdhar
 Share

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • This a problem with the Theabyss (The Abyss?) mod. Make sure you have the latest version then contact the author.
    • This is an issue with JEI make sure you have latest version for 1.16.5 then contact the author.
    • I checked my list of mod and immersive portal wasn't even installed.    
    • Look at your image. You are showing  /Applications/Minecraft/Contents/mods Your mods folder is Take a screenshot of the contents of second one. Although we can guess, you have been downloading your mods into the first folder when you should be putting them in the second one.  
    • I play the world yesterday and it was fine, upon loading it today it crashed ╥_╥. Pls help.  [main/ERROR]: Exception caught during firing event: null     Index: 6     Listeners:         0: HIGH         1: ASM: class me.shedaniel.architectury.event.forge.EventHandlerImplClient event(Lnet/minecraftforge/client/event/RecipesUpdatedEvent;)V         2: NORMAL         3: ASM: class owmii.lib.client.wiki.Wiki collect(Lnet/minecraftforge/client/event/RecipesUpdatedEvent;)V         4: ASM: class com.blamejared.crafttweaker.impl.events.CTStateEventHandler onRecipesUpdated(Lnet/minecraftforge/client/event/RecipesUpdatedEvent;)V         5: ASM: mekanism.client.ClientTickHandler@43d9842f recipesUpdated(Lnet/minecraftforge/client/event/RecipesUpdatedEvent;)V         6: net.minecraftforge.eventbus.EventBus$$Lambda$2959/736640638@6d07c39b java.util.ConcurrentModificationException     at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:901)     at java.util.ArrayList$Itr.next(ArrayList.java:851)     at mezz.jei.load.PluginCaller.callOnPlugins(PluginCaller.java:21)     at mezz.jei.load.PluginLoader.<init>(PluginLoader.java:109)     at mezz.jei.startup.JeiStarter.start(JeiStarter.java:69)     at mezz.jei.startup.ClientLifecycleHandler.startJEI(ClientLifecycleHandler.java:147)     at mezz.jei.startup.ClientLifecycleHandler.setupJEI(ClientLifecycleHandler.java:140)     at mezz.jei.startup.ClientLifecycleHandler.lambda$new$3(ClientLifecycleHandler.java:106)     at mezz.jei.startup.ClientLifecycleHandler$$Lambda$29176/1547335276.accept(Unknown Source)     at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:247)     at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:239)     at net.minecraftforge.eventbus.EventBus$$Lambda$2959/736640638.invoke(Unknown Source)     at net.minecraftforge.eventbus.EventBus$$Lambda$3273/1859299978.invoke(Unknown Source)     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302)     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283)     at net.minecraftforge.client.ForgeHooksClient.onRecipesUpdated(ForgeHooksClient.java:772)     at net.minecraft.client.network.play.ClientPlayNetHandler.func_199525_a(ClientPlayNetHandler.java:1314)     at net.minecraft.network.play.server.SUpdateRecipesPacket.func_148833_a(SourceFile:27)     at net.minecraft.network.play.server.SUpdateRecipesPacket.func_148833_a(SourceFile:15)     at net.minecraft.network.PacketThreadUtil.func_225383_a(SourceFile:21)     at net.minecraft.network.PacketThreadUtil$$Lambda$34638/1869809823.run(Unknown Source)     at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213166_h(SourceFile:144)     at net.minecraft.util.concurrent.RecursiveEventLoop.func_213166_h(SourceFile:23)     at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213168_p(SourceFile:118)     at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213160_bf(SourceFile:103)     at net.minecraft.client.Minecraft.func_195542_b(Minecraft.java:948)     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:607)     at net.minecraft.client.main.Main.main(Main.java:184)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497)     at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:37)     at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$502/1391735333.call(Unknown Source)     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37)     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54)     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72)     at cpw.mods.modlauncher.Launcher.run(Launcher.java:82)     at cpw.mods.modlauncher.Launcher.main(Launcher.java:66)  [main/FATAL]: Error executing task on Client java.util.ConcurrentModificationException: null     at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:901) ~[?:1.8.0_51]     at java.util.ArrayList$Itr.next(ArrayList.java:851) ~[?:1.8.0_51]     at mezz.jei.load.PluginCaller.callOnPlugins(PluginCaller.java:21) ~[?:7.7.1.152]     at mezz.jei.load.PluginLoader.<init>(PluginLoader.java:109) ~[?:7.7.1.152]     at mezz.jei.startup.JeiStarter.start(JeiStarter.java:69) ~[?:7.7.1.152]     at mezz.jei.startup.ClientLifecycleHandler.startJEI(ClientLifecycleHandler.java:147) ~[?:7.7.1.152]     at mezz.jei.startup.ClientLifecycleHandler.setupJEI(ClientLifecycleHandler.java:140) ~[?:7.7.1.152]     at mezz.jei.startup.ClientLifecycleHandler.lambda$new$3(ClientLifecycleHandler.java:106) ~[?:7.7.1.152]     at mezz.jei.startup.ClientLifecycleHandler$$Lambda$29176/1547335276.accept(Unknown Source) ~[?:?]     at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:247) ~[eventbus-4.0.0.jar:?]     at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:239) ~[eventbus-4.0.0.jar:?]     at net.minecraftforge.eventbus.EventBus$$Lambda$2959/736640638.invoke(Unknown Source) ~[?:?]     at net.minecraftforge.eventbus.EventBus$$Lambda$3273/1859299978.invoke(Unknown Source) ~[?:?]     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?]     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?]     at net.minecraftforge.client.ForgeHooksClient.onRecipesUpdated(ForgeHooksClient.java:772) ~[?:?]     at net.minecraft.client.network.play.ClientPlayNetHandler.func_199525_a(ClientPlayNetHandler.java:1314) ~[?:?]     at net.minecraft.network.play.server.SUpdateRecipesPacket.func_148833_a(SourceFile:27) ~[?:?]     at net.minecraft.network.play.server.SUpdateRecipesPacket.func_148833_a(SourceFile:15) ~[?:?]     at net.minecraft.network.PacketThreadUtil.func_225383_a(SourceFile:21) ~[?:?]     at net.minecraft.network.PacketThreadUtil$$Lambda$34638/1869809823.run(Unknown Source) ~[?:?]     at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213166_h(SourceFile:144) [?:?]     at net.minecraft.util.concurrent.RecursiveEventLoop.func_213166_h(SourceFile:23) [?:?]     at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213168_p(SourceFile:118) [?:?]     at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213160_bf(SourceFile:103) [?:?]     at net.minecraft.client.Minecraft.func_195542_b(Minecraft.java:948) [?:?]     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:607) [?:?]     at net.minecraft.client.main.Main.main(Main.java:184) [?:?]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]     at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]     at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:37) [forge-1.16.5-36.2.35.jar:36.2]     at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$502/1391735333.call(Unknown Source) [forge-1.16.5-36.2.35.jar:36.2]     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.1.3.jar:?]     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.1.3.jar:?]     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.1.3.jar:?]     at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.1.3.jar:?]     at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.1.3.jar:?]
  • Topics

×
×
  • Create New...

Important Information

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