Skip to content

Gbuffers

Required stages: vertex (.vsh), fragment (.fsh)
Optional stages: geometry (.gsh), tessellation (.tcs, .tes)
Output Buffers: colortex, depthtex
Valid suffixes: N/A


Gbuffers programs are where all the world geometry is rendered, including terrain, entities, block entities, particles, and more.

There are many buffers programs where different types of geometry are rendered. There are also fallbacks, so if a specific gbuffers file is not present the geometry that would render in that programs falls back to another program in the shader. Here’s a table which shows each program, it’s fallback, and the geometry it’s responsible for (this list is not in order):

gbuffers programgeometryfallback program
gbuffers_basicleash, debug chunk border overlayN/A
gbuffers_lineblock outline, fishing linegbuffers_basic
gbuffers_texturedworld border, particles that don’t support lightinggbuffers_basic
gbuffers_textured_litparticles that support lighting (most particles)gbuffers_textured
gbuffers_skybasicsky color/horizon, stars, voidgbuffers_basic
gbuffers_skytexturedsun and moon texturesgbuffers_textured
gbuffers_cloudsvanilla cloudsgbuffers_textured
gbuffers_terrainstatic blocksgbuffers_textured_lit
gbuffers_damagedblockblock breaking texturegbuffers_terrain
gbuffers_blockblock entities, sign textgbuffers_terrain
gbuffers_beaconbeambeacon beamgbuffers_textured
gbuffers_entitiesentities, nametag textgbuffers_textured_lit
gbuffers_armor_glintenchantment effect on items/armorgbuffers_textured
gbuffers_spidereyesspider/enderman/dragon eyesgbuffers_textured
gbuffers_handplayer hand and handheld objectsgbuffers_textured_lit
gbuffers_weatherfalling rain/snow, doesn’t include particlesgbuffers_textured_lit
gbuffers_watertranslucent terrain (including water)gbuffers_terrain
gbuffers_hand_watertranslucent handheld objectsgbuffers_hand

Note: In Optifine gbuffers_entities_glowing renders entities that have the spectral effect (but does not impact the outline itself). This shader file is not recognized in Iris.

Iris Additional Programs

The following programs are added by Iris. These programs pull geometry from their fallback, and provide more specificity to the geometry rendered. They also serve to separate translucent geometry that would otherwise render in the same program as opaque geometry, which should be used with ENTITY_TRANSLUCENT.

gbuffers programgeometryfallback program
gbuffers_particlesparticlesgbuffers_textured_lit
gbuffers_particles_translucentparticles that support translucency (requires particles.ordering=mixed)gbuffers_particles
gbuffers_block_translucenttranslucent block entitiesgbuffers_block
gbuffers_entities_translucenttranslucent entitiesgbuffers_entities
gbuffers_terrain_solidsolid terrain (no cutout or translucency)gbuffers_terrain
gbuffers_terrain_cutoutcutout terrain (no solid or translucency)gbuffers_terrain
gbuffers_lightninglightning, ender dragon death beamsgbuffers_entities

Translucent Gbuffers and Deferred

The general concept behind the deferred pass is that opaque geometry is rendered before deferred and translucent geometry is rendered after deferred. The intent is that the deferred programs can handle deferred rendering for opaque geometry, and translucent geometry can either be forward rendered in gbuffers or deferred rendered separately from opaques in a composite program.

In practice, using the old Optifine programs this was not always the case though. By default,gbuffers_weather, gbuffers_water, and gbuffers_hand_water are the only programs that render after deferred, meaning that translucent entities, block entities, and particles were all rendered before deferred. This is why Iris adds gbuffers_particles_translucent, gbuffers_block_translucent, and gbuffers_entities_translucent, and uses particles.ordering to handle the order particles are rendered.

Notes on specific geometry

  • the ender dragon death beans write their color in gbuffers_lightning, however the depth is written in gbuffers_basic