Jump to content

[1.12.2] Trying to render a texture as an overlay to a block in world fails


Recommended Posts

Posted

I am trying to render a transparent texture over specific in world blocks whenever an item is held. Due to previous work, i can put a box of lines around it, but as soon as I start with textures, and the needed changes, it fails

 

https://github.com/Thaumic-Tinkerer/ThaumicTinkerer/blob/1.12/src/main/java/com/nekokittygames/thaumictinkerer/client/rendering/special/TransvectorRendering.java is the code in question.

I have only started with the first face, to make debugging easier currently.

This is the result I get always:

unknown.png

A plain white square over the face where I should get this texture:

mark.png

overlayed on the block underneath.

Is there anything obvious I am missing here?

Posted

Not sure if this is the cause, but you enabled texture 2D, then immediately disabled it here.

  • Like 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.

 

 

Posted
10 minutes ago, DavidM said:

Not sure if this is the cause, but you enabled texture 2D, then immediately disabled it here.

Honestly that's leftover code from where I sourced the original line drawing varient, drawOutlineTextured acts the same if I enableTexture2D inside or not

Posted (edited)

Have you bind your texture? I am dumb.

Edited by DavidM
  • Like 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.

 

 

Posted
5 hours ago, DavidM said:

I am dumb.

I don't think so. I also don't see the texture being bound. @nekosune Passes a TextureAtlasSprite(RenderEvents.MARK_SPRITE) to his drawTexturedOutline, but never binds that texture.

  • Like 1

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
2 hours ago, Animefan8888 said:

I don't think so. I also don't see the texture being bound. @nekosune Passes a TextureAtlasSprite(RenderEvents.MARK_SPRITE) to his drawTexturedOutline, but never binds that texture.

Even with trying to bind any texture , rather then just using the atlas,  like here: https://github.com/Thaumic-Tinkerer/ThaumicTinkerer/blob/e740e94ca431a1dc6d2c04a004e570b1505cceb4/src/main/java/com/nekokittygames/thaumictinkerer/client/rendering/special/TransvectorRendering.java#L77

I still get the exact same error...

Posted
9 hours ago, Animefan8888 said:

I don't think so. I also don't see the texture being bound. @nekosune Passes a TextureAtlasSprite(RenderEvents.MARK_SPRITE) to his drawTexturedOutline, but never binds that texture.

I think that OP stitched the texture during TextureStitchEvent, and then use TextureAtlasSprite#getInterpolatedU and V to obtain the UV of the stitched sprite to be used in the buffer builder.

The texture binded is still the original texture map, but it contains the stitched texture.

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.

 

 

Posted
50 minutes ago, DavidM said:

I think that OP stitched the texture during TextureStitchEvent, and then use TextureAtlasSprite#getInterpolatedU and V to obtain the UV of the stitched sprite to be used in the buffer builder.

The texture binded is still the original texture map, but it contains the stitched texture.

That's exactly what I was doing, it turns out disabling and renabling texture 2D was confusing things, removing that helped fix things

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Forge is probably the most feature loaded mod loader currently. You can change just about anything with the game mechanics by using mixins. You can also add more items and feature than what the docs show you. It is good to start with a Modding tutorial series like this one by Kaupenjoe.  Some good examples of what is possible with forge is clockwork, dynamic trees, and I guess create but its on fabric too.
    • I'm new to modding and trying to make a mod in 1.20.1. My mod currently just has a custom bow, but when I use my bow, it does not play the animation. I have the jsons and pngs in the right spots and I've compared my jsons with that of existing mods, everything seems to line up just fine. Anyone know what might be causing this? I've changed the item between a basic BowItem and a custom class extending from BowItem, even overriding the animation code, no dice. odysseus_bow.json: { "parent": "item/generated", "textures": { "layer0": "odyssey:item/odysseus_bow" }, "overrides": [ { "predicate": { "pulling": 1 }, "model": "odyssey:item/odysseus_bow_pulling_0" }, { "predicate": { "pulling": 1, "pull": 0.65 }, "model": "odyssey:item/odysseus_bow_pulling_1" }, { "predicate": { "pulling": 1, "pull": 0.9 }, "model": "odyssey:item/odysseus_bow_pulling_2" } ] } odysseus_bow_pulling_0.json: { "parent": "item/generated", "textures": { "layer0": "odyssey:item/odysseus_bow_pulling_0" }, "display": { "thirdperson_righthand": { "rotation": [ -80, 260, -40 ], "translation": [ -1, -2, 2.5 ], "scale": [ 1.2, 0.9, 1.2 ] }, "firstperson_righthand": { "rotation": [ 0, -90, 25 ], "translation": [ 1.13, 3.2, 1.13 ], "scale": [ 0.88, 0.68, 0.88 ] } } } (_1 and _2 are the same with the respective layer0)
    • Hello I've been having some issues with Multipart entities and that it is constantly taking damage. The video below shows the issues. Also the hit boxes that are moving constantly seem to be still, because you can still be seated on the hit box where it is suppose to be.  Here is some modified code taken from EnderDragonPart. public class TheHeartPart extends PartEntity<TheHeart> { public final TheHeart parentMob; public final String name; private final EntityDimensions size; public TheHeartPart(TheHeart pParentMob, String pName, float pWidth, float pHeight) { super(pParentMob); this.size = EntityDimensions.scalable(pWidth, pHeight); this.refreshDimensions(); this.parentMob = pParentMob; this.name = pName; } @Override protected void defineSynchedData() { } @Override protected void readAdditionalSaveData(CompoundTag pCompound) { } @Override protected void addAdditionalSaveData(CompoundTag pCompound) { } @Override public boolean isPickable() { return true; } @Nullable public ItemStack getPickResult() { return this.parentMob.getPickResult(); } @Override public boolean hurt(DamageSource pSource, float pAmount) { return false; //return this.isInvulnerableTo(pSource) ? false : this.parentMob.hurt(pSource, pAmount); } @Override public boolean is(Entity pEntity) { return this == pEntity || this.parentMob == pEntity; } @Override public Packet<ClientGamePacketListener> getAddEntityPacket() { throw new UnsupportedOperationException(); } @Override public EntityDimensions getDimensions(Pose pPose) { return this.size; } @Override public boolean shouldBeSaved() {return false;} } Any help is greatly appreciated!
    • I've been trying to run some modpacks through Prism launcher which haven't been working and I narrowed it down due to some forge issues. The issues only happen with modpacks using forge 1.20.1 so I tried to reinstall 1.20.1, but I keep getting this error log:https://pastebin.com/4w9pGURJ 
    • I split your reply to an unrelated topic into a separate request for help.   Please read the FAQ for how to properly request help and post logs.
  • Topics

×
×
  • Create New...

Important Information

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