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.

Featured Replies

Posted

Hey guys.

 

I'm giving ISBRH another try in my FlenixRoads rewrite. So far it's going pretty well, but I need to add ambient occlusion to my renders.

 

Can anyone guide me with it? My blocks are relatively simple six-sided shapes, just they change their heights (including non-square shapes) depending on their surroundings hence the need for ISBRH. Currently they seem to pass light through, which means they don't cast any form of shadow and it's hard to differentiate between the top and sides:

53c1b9a428d6a.jpg

(Stone is there for reference)

 

Ordinastie sent me this on IRC, but it looks to be extremely overcomplicated for what I'm trying to achieve. Can anyone push me in the right direction of doing this in a slightly simpler manor?

 

width=463 height=200

http://s13.postimg.org/z9mlly2av/siglogo.png[/img]

My mods (Links coming soon)

Cities | Roads | Remula | SilvaniaMod | MoreStats

Hi

 

This link might help

http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html

- see the Block Rendering sections, especially Lighting.

 

You don't actually need ambient occlusion, you just need to change the intensity of the different faces (see the lighting topic).

 

And actually, you probably don't need an IBSRH either.  Just change the y upper bound and let the vanilla renderer do the rest.  Look at BlockHalfSlab - in particular

.setBlockBoundsBasedOnState()

.setBlockBoundsForItemRender()

.isOpaqueCube()

 

-TGG

 

  • Author

Hi

 

This link might help

http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html

- see the Block Rendering sections, especially Lighting.

 

You don't actually need ambient occlusion, you just need to change the intensity of the different faces (see the lighting topic).

 

Thanks, I shall check it out.

EDIT: The page doesn't tell me how to use it, simply that it exists...

 

 

And actually, you probably don't need an IBSRH either.  Just change the y upper bound and let the vanilla renderer do the rest.  Look at BlockHalfSlab - in particular

.setBlockBoundsBasedOnState()

.setBlockBoundsForItemRender()

.isOpaqueCube()

 

-TGG

I do, because I'll be having non-flat slopes. I've just not touched that yet because it's so damn hard to see the variance with the lighting not working right :P

width=463 height=200

http://s13.postimg.org/z9mlly2av/siglogo.png[/img]

My mods (Links coming soon)

Cities | Roads | Remula | SilvaniaMod | MoreStats

Hi

 

Ambient occlusion means that the corners of the faces have different brightnesses, i.e. the brightness on a given face varies from one corner to the others depending on what other blocks are nearby.  That's not what you need.  You need the different faces to have slightly different brightness depending on which way they're facing.  Vanilla does this for east/west vs north/south vs up vs down, as described in that lighting link in my post.

 

Just to be explicit- before you render each face, use Tessellator.setColorOpaque() to change the brightness.  Choose a different brightness for each of the faces, probably best to try to align them with the vanilla 100% / 80% / 60%/ 40%, but it doesn't matter too much so long as they're different from each other.

 

-TGG

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.