Posted July 12, 201411 yr 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: (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? http://s13.postimg.org/z9mlly2av/siglogo.png[/img] My mods (Links coming soon) Cities | Roads | Remula | SilvaniaMod | MoreStats
July 12, 201411 yr 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
July 13, 201411 yr 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 http://s13.postimg.org/z9mlly2av/siglogo.png[/img] My mods (Links coming soon) Cities | Roads | Remula | SilvaniaMod | MoreStats
July 13, 201411 yr 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.