Jump to content

Recommended Posts

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

Posted

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

 

Posted

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

Posted

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

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