Class IrisBufferHelper

java.lang.Object
com.hbm_m.client.render.shader.IrisBufferHelper

public final class IrisBufferHelper extends Object
Хелпер для совместимости BufferBuilder с Iris/Oculus.

Когда НЕ использовать: При level render (RenderLevelStageEvent, block entities) с включёнными шейдерами (ShaderCompatibilityDetector.isExternalShaderActive()). В этом случае вызывайте buffer.begin(mode, DefaultVertexFormat.BLOCK) напрямую - MixinBufferBuilder расширит формат до TERRAIN, и putBulkData будет дополняться extended data. IrisBufferHelper отключает расширение и приведёт к stride mismatch.

Когда использовать: GUI, overlay, не-level рендер - когда нужен именно BLOCK без расширения. Iris предоставляет iris$beginWithoutExtending() - отключает расширение формата. Вызываем через reflection, т.к. Oculus - опциональная зависимость.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    begin(com.mojang.blaze3d.vertex.BufferBuilder buffer, com.mojang.blaze3d.vertex.VertexFormat.Mode mode, com.mojang.blaze3d.vertex.VertexFormat format)
    Универсальный begin с отключением Iris-расширения при необходимости.
    static void
    beginBlockQuads(com.mojang.blaze3d.vertex.BufferBuilder buffer)
    Начинает BufferBuilder с DefaultVertexFormat.BLOCK без расширения Iris.
    static void
    beginWithoutExtending(com.mojang.blaze3d.vertex.BufferBuilder buffer, com.mojang.blaze3d.vertex.VertexFormat.Mode mode, com.mojang.blaze3d.vertex.VertexFormat format)
    begin без расширения Iris — для POSITION_TEX_COLOR и прочих immediate-draw путей.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • IrisBufferHelper

      public IrisBufferHelper()
  • Method Details

    • beginBlockQuads

      public static void beginBlockQuads(com.mojang.blaze3d.vertex.BufferBuilder buffer)
      Начинает BufferBuilder с DefaultVertexFormat.BLOCK без расширения Iris. При активном Iris/Oculus предотвращает переключение на IrisVertexFormats.TERRAIN.

      Не использовать для level render с шейдерами - там нужен расширенный TERRAIN формат.

    • beginWithoutExtending

      public static void beginWithoutExtending(com.mojang.blaze3d.vertex.BufferBuilder buffer, com.mojang.blaze3d.vertex.VertexFormat.Mode mode, com.mojang.blaze3d.vertex.VertexFormat format)
      begin без расширения Iris — для POSITION_TEX_COLOR и прочих immediate-draw путей.
    • begin

      public static void begin(com.mojang.blaze3d.vertex.BufferBuilder buffer, com.mojang.blaze3d.vertex.VertexFormat.Mode mode, com.mojang.blaze3d.vertex.VertexFormat format)
      Универсальный begin с отключением Iris-расширения при необходимости. Для BLOCK/NEW_ENTITY/POSITION_COLOR_TEX_LIGHTMAP вызывает iris$beginWithoutExtending.

      Не использовать при рендере block entities во время renderLevel с включёнными шейдерами.