Jump to content

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


nekosune

Recommended Posts

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?

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

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

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.