#Overlay block texture

26 messages · Page 1 of 1 (latest)

tribal escarp
#

I'm not coding it, yet, just gathering info for the future

So, there is a mod called Supplementary, and there is a block called Timber Frame
This frame is the same size as regular block, and, you can place any solid block in it
The thing is - this frame and block in it render at the same time, and these don't z-fight

That's what I'd like to know, how is this block is the same size with other solid blocks, and when on the same place with them - doesn't do z-fighting

Also I looked at the code in the github, and, to be honest I didn't quite understand anything with render and other stuff, I have no idea how to work with quads so I'm wondering if there is a more simple way to do it.

Hope I described well what I meant, thanks in advance to anybody who can provide info on this ^-^
-# Timber frame looks something like that: https://cdn.discordapp.com/attachments/807617488313516032/1354762307837628456/image.png?ex=67e720f8&is=67e5cf78&hm=259a272a40be688b74e3b3d1f853893616e6ed40d5872f2f90af97da86f57d55&

final knot
#

I image it just replaces the block model though?

#

or it creates a new texture at runtime

#

im not sure what it looks like when there is a block in it

tribal escarp
# final knot I image it just replaces the block model though?

I'll try to explain it further:
So, this frame block has it's texture and model (wooden thing on image above) and it's empty inside, like a glass block (you can see the inside of it, the model)

Then, you can place any block INSIDE of this wooden frame (white thingey inside frame on image)

And the thing is that these blocks are the same size, same place, without offset, and don't z-fight

tribal escarp
final knot
#

ah right

#

yeah then its either caculating all possible textures when you start the mod, or its creating the texture when you place it in the frame

#

I dont think there is anything going on with the frame block itself

#

idk how accurate you can scale block models, but the usual way to counter z fighting for entities is to scale one or the other up or down by like 0.001% which is not noticable but does remove the z fighting

#

if thats possible with block models then it might be what they did

tribal escarp
# final knot if thats possible with block models then it might be what they did

Oooh, I can try that, but yeah, I'm also interested in how it can be done without scaling the model, also I found this piece of code in supplementary, but as I said - I do not have any experience with block renderers: https://github.com/MehVahdJukaar/Supplementaries/blob/master/common/src/main/java/net/mehvahdjukaar/supplementaries/client/block_models/FrameBlockBakedModel.java

GitHub

Contribute to MehVahdJukaar/Supplementaries development by creating an account on GitHub.

final knot
#

they have an underlying model which is either the mimic model (i.e. what you put in there, or the default model, and then there is an overlay blockmodel

#

if you can find out where that overlay model comes from you might be able to figure out how it works

#

but I think essentially my first guess is right in that they are slapping together the block model in realtime, so it must be the case that the overlay is somehow not exactly a block

#

atleast thats what it seems like

#

or they use a shader or something

#

there is probably a block model file in blockstates for MIMIC or frame block or something similar

final knot
#

hmm not sure then

#

id have to experiment with it

tribal escarp
#

So it would look ugly

final knot
#

maybe, but like I said, you wont notice it really

#

but I dont know if thats something you can even do

#

maybe the quads that supplementaties uses avoid the z fighting somehow