BuildCraft|Core

BuildCraft|Core

7M Downloads

facade support for multipass block rendering

lawremi opened this issue · 16 comments

commented

Pre 1.8, facades only render a single pass when drawing the block part. I think it would be easy to make this use two passes when the block requests it (via getRenderBlockPass). I can put together a PR if there are not any objections.

1.8 and above, I'm not sure how easy this would be to support, since multi-pass rendering has become implicit in the model.

commented

I'll look into the 1.7.10 side of things and assign @AlexIIL to look into the 1.8 side of things.

commented

1.8 does have the same methods so that you can ask the block which pass it would like to be rendered in- however currently only opaque blocks are used for facades so there is little point in adding it. The facade detection filter might be changed to allow coloured glass (for example) but I'll leave that up to @asiekierka if he wants that to be added.

commented

Coloured glass and similar things should also be allowed, but pre-1.8 it is impossible to accurately detect them. Since 1.8 has a separate isFullCube, non-opaque objects should be once again allowed (but they should not have the plug connector rendered).

commented

Just to be clear, the intention was to support opaque blocks, where typically the base (pass 0) texture is opaque and the overlay (pass 1) has transparency. In 1.8 and above, I think developers will implement that in the same way vanilla does grass (multiple elements in the model definition), so it will not be as straightforward as in 1.7.10 (just render, increment the render pass, and render again).

commented

It will. 1.8 simply has four render passes instead of two.

commented

I thought that the 4 passes were only for items. If what you say is true for blocks, that's good news.

commented

The 4 passes are for blocks! It's items which have a different system.

commented

This is for 1.8:

Currently the 3 non-translucent passes (SOLID, CUTOUT_MIPPED and CUTOUT) are all lumped into the CUTOUT pass (mipped cutout just adds mipmapping support which is a bad idea on non-full blocks) and solid is as well because I don't have any valid reasons to not add it in. I will note that CUTOUT can render transparent blocks (e.g. glass) so its good enough for most facades.

Translucency is just for partially transparent blocks- like stained glass. I haven't tried adding them in yet but they might look odd on pipes.

commented

Right, there are multiple passes in the 1.8 renderer, but a given block is drawn only in one of the passes, right? That would mean it's no longer a viable way to draw things like grass.

commented

Not necessarily, no.

2016-03-21 19:33 GMT+01:00 lawremi [email protected]:

Right, there are multiple passes in the 1.8 renderer, but a given block is
drawn only in one of the passes, right? That would mean it's no longer a
viable way to draw things like grass.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#3263 (comment)

commented

Each block has a method getBlockLayer which is called to determine which layer the model should be rendered in. Forge adds a method canRenderInLayer which ISmartBlockModel (a forge class) can use to render in multiple passes.

I think you are getting confused with grass, as it is rendered in the CUTOUT_MIPPED pass. Grass facades (with the correct colour for the biome) can be accomplished with a special-case colouring method.

commented

Awesome. Then there is a clear path forward. Thanks for your patient clarification, and your tireless efforts.

commented

Wasn't stained glass facades added in 7.2.6?

commented

Don't see it in the changelog, and that does not seem relevant anyway. Stained glass renders in the alpha pass, but it is single pass.

commented

Oh, its more that now it supports the alpha pass. The entire facade rendering system would need to be re-implemented to cut the relevent block model down to shape. At the moment all it does is take the particle texture and use that, which isn't ideal but it works.

commented

I'm dumb, thanks for correcting me :)