Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[1.12] (Solved) Rendering block layer with full-bright (IBakedModel?)

Featured Replies

Posted

Hello, I wanted to create a block that has a bright texture layer over a normal texture (the overlay is decided by a blockstate, there are 16 different glyphs), but the current model system does not allow me to ignore lightning, only to turn off shadows, and a TESR seems like a bad idea since it might be used it in big quantities...

I was told an IBakedModel could allow me to turn off lightning for each side, but I do not know how to use it... are there any examples I could use? Or maybe modify the current baked model used to create that block?

 

This is what it looks like:

V9Xryi2.png

However, it does not "shine" when the lights are gone...

R41Nd6o.png

 

Do note that it is not a true overlay, just 2 block models...

{
	"parent": "block/block",
	"elements": [
		{
			"from": [ 0, 0, 0 ],
			"to": [ 16, 16, 16 ],
			"faces": {
				"down":  { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "cullface": "down" },
				"up":    { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "cullface": "up" },
				"north": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "cullface": "north" },
				"south": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "cullface": "south" },
				"west":  { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "cullface": "west" },
				"east":  { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "cullface": "east" }
			}
		},
		{
			"from": [ 0, 0, 0 ],
			"to": [ 16, 16, 16 ],
			"faces": {
				"down":  { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "cullface": "down" },
				"up":    { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "cullface": "up" },
				"north": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "cullface": "north" },
				"south": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "cullface": "south" },
				"west":  { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "cullface": "west" },
				"east":  { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "cullface": "east" }
			}
		}
	]
}

 

Thank you all :D

 

Edit:

Well, my main concern was being able to render a block with a shiny overlay, so the topic is solved :D

 

Edited by Arekkuusu

Aya Shamelessmaru at your service

  • Author
4 hours ago, larsgerrits said:

Try setting the "ambientocclusion" tag to false in your model file.

No, that doesnt work. :(

Spoiler

gtyufih.png

I used this for the model:

Spoiler

{
	"parent": "block/block",
	"elements": [
		{
			"from": [ 0, 0, 0 ],
			"to": [ 16, 16, 16 ],
			"faces": {
				"down":  { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "cullface": "down" },
				"up":    { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "cullface": "up" },
				"north": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "cullface": "north" },
				"south": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "cullface": "south" },
				"west":  { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "cullface": "west" },
				"east":  { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "cullface": "east" }
			}
		},
		{
			"from": [ 0, 0, 0 ],
			"to": [ 16, 16, 16 ],
			"ambientocclusion" : "false",
			"faces": {
				"down":  { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "cullface": "down" },
				"up":    { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "cullface": "up" },
				"north": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "cullface": "north" },
				"south": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "cullface": "south" },
				"west":  { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "cullface": "west" },
				"east":  { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "cullface": "east" }
			}
		}
	]
}

 

I actually did some research and found this:

Git repo

However the items are transparent/dont render (it can be fixed no big deal), the overlay shines wonderfully.

Spoiler

5Am1Kp3.png

LBMTxSY.png

Now I just have to figure out how to make each backed model for each state of my block, and make the items render... heh

 

 

Aya Shamelessmaru at your service

  • 2 years later...

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.