Jump to content

Recommended Posts

Posted

For each blockstate entry you can have a model, and for each model you can have different textures, and for each texture you can have different transparency by simply having a translucent .png file. Just take the texture you want, and make several .pngs, each with the desired translucency, then hook them up to different models for your blockstate .json.

Fancy 3D Graphing Calculator mod, with many different coordinate systems.

Lightweight 3D/2D position/vector transformations library, also with support for different coordinate systems.

Posted (edited)
9 hours ago, SerpentDagger said:

For each blockstate entry you can have a model, and for each model you can have different textures, and for each texture you can have different transparency by simply having a translucent .png file. Just take the texture you want, and make several .pngs, each with the desired translucency, then hook them up to different models for your blockstate .json.

I already have an IModel with 18 different textures which are dynamically picked for each state depending on the blockstate, so I need dynamic transparency. 

Edited by Evi1Casul
Posted
7 hours ago, Evi1Casul said:

so I need dynamic transparency

21 hours ago, Evi1Casul said:

dynamically (depending on the blockstate)

7 hours ago, Evi1Casul said:

18 different textures which are dynamically picked for each state depending on the blockstate

Perhaps I'm misunderstanding your definition of dynamic? It seems to me that you want the block's transparency to vary with the blockstate, and with the textures in the model. This can be accomplished as I described.

Fancy 3D Graphing Calculator mod, with many different coordinate systems.

Lightweight 3D/2D position/vector transformations library, also with support for different coordinate systems.

Posted (edited)
45 minutes ago, SerpentDagger said:

Perhaps I'm misunderstanding your definition of dynamic? It seems to me that you want the block's transparency to vary with the blockstate, and with the textures in the model. This can be accomplished as I described.

First, that's sort of a workaround. I don't understand why there is no system with flexible rendering control for cases where JSON is helpess (yeah, IModel/TESR is also clumsy and unobvious). However, speaking of the method you described, it's still impossible. I have a custom model that randomly picks one of six textures for each block side (the block can be attached to adjacent blocks); more than that, it has 3 different subtypes, so JSON system will be generating 3 * 2^6 * 6^6 = ~9M variants. Considering model baking time (and just logic), that's going to be processed for a long time. Transcluent textures will make it even worse (btw, not to mention manual json and texture files editing). I need a solution via IModel or whatever.
P.S. I already implemented dynamic textures and models picking.

Edited by Evi1Casul
Posted
38 minutes ago, Evi1Casul said:

3 * 2^6 * 6^6

First off where did 2^6 come from?
 

40 minutes ago, Evi1Casul said:

I need a solution via IModel or whatever.

From what I can see here is you need to use the TextureStitchEvent(Not sure if it should be pre or post).Then you'll need to either load(if in the pre event) or get from the AtlasTexture(post event). Then you'll need to use reflection to access the NativeImage array stored in the TextureAtlasSprite via reflection and call setPixelRGBA for your pixels. Then you'll need to add this texture to the AtlasTexture(which is why I'm not sure which event you need I am leaning towards Pre).

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
34 minutes ago, Animefan8888 said:

First off where did 2^6 come from?

6 sides that may or may not be attached.

 

35 minutes ago, Animefan8888 said:

From what I can see here is you need to use the TextureStitchEvent(Not sure if it should be pre or post).Then you'll need to either load(if in the pre event) or get from the AtlasTexture(post event). Then you'll need to use reflection to access the NativeImage array stored in the TextureAtlasSprite via reflection and call setPixelRGBA for your pixels. Then you'll need to add this texture to the AtlasTexture(which is why I'm not sure which event you need I am leaning towards Pre).

I want to make smooth block fading. If 5% per frame is enough, I'll need to cache 18 * 20 = 360 textures. Is it okay in terms of performance?

Posted
1 hour ago, Evi1Casul said:

First, that's sort of a workaround.

It's just using the Json system for what it's meant to be used for.

1 hour ago, Evi1Casul said:

generating 3 * 2^6 * 6^6 = ~9M variants

Yeah, now that you've told me that it requires ~9M variants instead of ~5 like a normal model, I can see that Json is impractical for your situation. Maybe you should have put that in the topic somewhere? The quality of the help you receive is proportional to the quality of the information you give us (in this case, poor).

Fancy 3D Graphing Calculator mod, with many different coordinate systems.

Lightweight 3D/2D position/vector transformations library, also with support for different coordinate systems.

Posted
10 hours ago, Evi1Casul said:

Is it okay in terms of performance?

Just sounds like it'll eat up a lot more ram and have a little longer startup time. Though I dont know exactly you'll have to test it and find out. If you mean in terms of fps as long as ram is sufficient the user shouldn't experience any drops in fps from the way the textures work however they may experience a drop in fps if the blockstate changes really fast. Each time it happens the whole chunk mesh has to be regenerated.

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
1 hour ago, Animefan8888 said:

Each time it happens the whole chunk mesh has to be regenerated.

Sounds bad. Is there a way to change rendering instead of model or textures?

Posted
6 hours ago, Evi1Casul said:

Is there a way to change rendering instead of model or textures?

Basically when you are doing fancy render stuff like this you need to ask yourself a few basic questions.

  1. Are there going to be a large amount of these blocks in one area? If yes it is likely better to use the model system.
  2. Is your block animated? If yes then you will need to use a TESR preferably a FastTESR.
  3. Is your block is gonna update at a ridiculous rate IE every tick? Then you should probably not use the model system unless the update has a switch. If it has a switch you should use both model and TESR. Model for non updating mode and TESR for updating mode and basically all data for the update should be in the TE for the block. And the switch should be stored in the blockstate so it is capable of switching between not having a TE and having a TE.

Basically weigh these questions against your Block then make a judgement call. If it turns out to be terrible try another implementation. I recommend using the switch method of things.

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
On 10/26/2019 at 5:34 PM, Evi1Casul said:

I set the render type to INVISIBLE to use TESR, but the returned blockstate somehow misses its unlisted properties now...

Post your code. I mainly need the block class and subclasses if they are important(IE change behavior). If there are multiple a git repo would work great.

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.

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.