- Only instance items if their *base* baked model has no overrides
- ItemRenderer#getModel applies overrides internally, so we have to go
directly to the ItemModelShaper
- Don't filter the results of ClientLevel#entitiesForRendering, instead
do an early exit in LevelRenderer#renderEntity
- Avoids allocating a potentially massive list
- Only need to loop over the entity list once
- Visible entity counter is fixed
- Would be nice to continue out of an iteration to avoid other
unnecessary checks in the render loop, but I don't think there's a
way to do that with mixin
- Use a persistent rotation quat in InstanceTree to avoid allocations
- Only call setChanged when updating instances in CowVisual, saves a ton
of atomic overhead
- Move lib mixins to impl
- Add InternalFlywheelApi entries for the model part accessors
- Implement putBulkData for VertexMultiConsumer.Multiple for the sake of
completion
- Fix race condition causing instancers to never be initialized
- Fix frame uniforms being 8 bytes too small
- Don't have any bias in BakedModelBufferer#bufferItem, instead sort
meshes with glint transparency to be rendered last
- Only visualized item entities if their items are supported
- Key item models directly on the BakedModel + if the stack has foil
- Implement cow and item visuals (very buggy!)
- Mostly copy vanilla's LivingEntityRenderer and ItemRenderer to
implement the #beginFrame for CowVisual and ItemVisual
- Cache translations of vanilla LayerDefinition into flywheel MeshTrees
- Create models for individual parts in a second layer of cache
- Add so many accessors to get into LayerDefinition and friends
- Add glint material and material shader
- Add flw_systemSeconds and flw_systemMillis uniforms
- Create models from items via ItemModelBuilder
- Shove MeshEmitter into vanilla's item renderer via a hacky
implementation of MultiBufferSource
- Fix options uniforms getting zeroed on a renderer reload
- Move Visual*Contexts inside their respective *Visual interfaces
- Acknowledge that TickableVisual.Context has no methods
- api_impl.vert: no need to try to pack in/out variables
- Go through some TODOs
- Simplify FlatLit interface and directly store packed light
- Rename getters in Events
- Document Effects
- LitVisualStorage: atomics are slow
- BakedModelBufferer: vanilla leaks too, they'll be freed when the game
exits
- Allow the user to configure the number of worker threads
- Allow the user to disable parallelism entirely without a jvm flag
- Move thread count logic into FlwTaskExecutor and make
ParallelTaskExecutor simply take a thread count as a parameter
- Always compile with highest supported GLSL version
- Allow indirect shaders to compile with as low as GLSL 420
- Fix GL extension checks for indirect
- Explicitly initialize GlCompat as early as possible to avoid invalid
initialization off render thread
- Fix exception thrown uploading indirect instances when an instance was
added in the same frame that the tail instance was deleted. We'd leave
behind some set changed bits out of bounds of the instance list, and
try to access those indices later
- Add out of bounds guards within forEachSetSpan, though I don't think
they're actually necessary
- Add AtomicBitset#set and #clear range methods
- Update all changed bits at once when deleting instances rather than
doing it in the loop
- Start iterating from the first set bit rather than 0 to save
potentially thousands of iterations
- Smarter model index uploading
- Draw! meshes in contractual order on instancing engine
- Rename DrawSet -> InstancedRenderStage and consolidate associated code
inside the class
- Re-use GroupKey between engines
- Sort instanced draws based on material and mesh index in model
- Make doCrumblingSort abstract on the instancer class and re-use it
between engines
- Cannibalize shade separated vertex consumer to function as the mesh
emitter for baked model buffering
- Create one MeshEmitter per chunk RenderType to allow more coherency
during multi block buffering
- MeshEmitters own BufferBuilders, and the buffering functions call
#begin on the mesh emitters directly
- Each time the emitter sees a quad with a different shade flag than the
previous run of quads, it emits a mesh and begins again
- Finally, the buffering functions call #end on the mesh emitters to
emit trailing meshes and clear transient state
- Add diffuse debug mode
- Order indirect draws by mesh index first
- Remove non-shade separated option from buffering utilities because it
allows you to opt in to incorrect behaviour
- Remove TessellatedModel
- Document mesh ordering contract in Model
- Remove Visual#shouldReset and associated logic
- Instead, delete and add visuals when the level renderer is notified
of a block state change (that has a block entity)
- This does remove some control from BEVs, but it greatly simplifies the
API and API contract
- Hook into ClientChunkCache#onLightUpdate for light updates to be
compatible with both vanilla and starlight at once
- Bump embeddium/occulus versions
- Move embedding uniform names to static finals and fix culling program
complaining about missing uniform names
- Light minecart visuals on init
- Upload instancers and model indices in separate loops in an
IndirectCullingGroup
- Reset changed bitset and update last* in separate method
- Don't need to upload instances anymore if the model index changes
- Compose transformations of embeddings
- Make EmbeddedEnvironment abstract and move light stuffs into
TopLevelEmbeddedEnvironment
- Add NestedEmbeddedEnvironment that only handles matrices, and tracks
a parent EmbeddedEnvironment
- AbstractEmbeddedEnvironment handles most of the deletion/update logic,
and also creates further NestedEmbeddedEnvironments
- EnvironmentStorage now only tracks environments and does not creat
them.
- Store packed instances in a uint[] in indirect
- Split the object buffer into an instance buffer and a model index
buffer
- Rename StructInstanceComponent to SsboInstanceComponent
- Expand abstraction in InstanceAssemblerComponent to allow both types
of instance assemblers to reuse per-element unpacking generation
- Separate FlwInstance struct generation into separate component,
InstanceStructComponent
- Also inline LayoutInterpreter into this class
- Move necessary internal definitions for components from api_impl to
common components_header shaders
- Use the same api_impl shader between pipelines
- Do not delete light volume memory when invalidated. Keep the block
around, and then use it again later when we collect more light
- Do not allocate fresh memory blocks when growing a light volume. Turns
out self-blitting is perfectly fine since we always start from the
volume's origin
- Inline BoxSet back into light volume. The precise tracking it did is
no longer relevant now that the embedding api has been simplified
- Light volumes now directly
- Simplify light invalidation api/impl
- There are 2 use cases for invalidating collected light:
- The embedding visual receives a light update
- The embedding visual moves
- In either case, it's in the visual's best interest to re-collect any
light it might need, rather than relying on the impl to copy
potentially outdated light.
- Do not sample the light volume if no light is collected
- Improve debug modes
- Calculate colors in the fragment shader to reflect any per-fragment
material/embedding alterations to the vertex output
- Fix light volume debug mode spewing rainbow seizure garbage
- Add light color debug mode
- Fix frame uniforms reserving too much space
- Fix level uniforms reserving too little space
- Actually move flw_constantAmbientLight to level uniforms
Squashed commit history:
* Add basic view.h matrices
* Add last values
* Add clean matrices
* Finish adding most view.h things to frame.glsl
* Document cameraIn- uniforms
* Add options uniform
* Begin on player uniforms
* Add more player uniforms
* Add level uniforms
* Fix uniform bindings
* Update options
* Fix offset alignments
* Add new uniforms to cull shader
* Fix simple things
* Make alpha 1 if team exists but does not have a color
* Fix mixin method names
* Provide all uniforms to cull shaders
* Move constant ambient light uniform to level group
* Level uniforms gets context from context
* Remove `clean` matrices for now
- Track exactly what blocks are contained in a light volume via BoxSet
- Fix segfault when a volume is expanded
- Shrink the volume when enough data is discarded
- I think the texture management is broken for this case
- Environment/Embedding ownership is complicated, reference counting to
the rescue!
- VisualEmbeddings are acquired on construction and deleted manually
- Instancers acquire/delete their environments
- EmbeddedEnvironment now has three (3) delete methods
- Add EnvironmentStorage to create, track, update, and delete
environments
- Remove InstancingEngine/IndirectEngine and move shared logic to
EngineImpl
- There's probably more that can be done to make DrawManager cleaner
now
- Consolidate context shaders into the common shaders, guarded by ifdefs
- Make ContextShaders into an enum
- Cache shaders by name instead of SourceComponents so the defines for
contexts actually get compiled
- Move all embedding stuff into backend.embed
- Cannibalize GPULightVolume into an api better suited for environments
- Separate light storage from 3d texture management
- Add #delete to Environment
- Add light volume debug mode
- Fix unpacking of some layout elements (only for instancing)
- All byte backed and short backed elements (incorrect assumption that
system is little endian)
- All signed byte and signed short elements (missing sign extension)
- Matrices with byte backed and short backed reprs in some cases
(incorrect assumption that matrix rows are 4 byte aligned)
- IntegerRepr.INT scalar (invalid implicit cast)
- FloatRepr.NORMALIZED_INT scalar (missing cast to signed int)
- IntegerRepr.INT vector (invalid implicit cast)
- FloatRepr.NORMALIZED_INT vector (missing cast to signed int)
- FloatRepr.NORMALIZED_SHORT vector (incorrect divisor)
- Add explicit casts from uint to float since some drivers have a bug
where uint over float division is invalid
- Lower GLSL requirement of instancing from 420 to 330
- Fix lib instance writers assuming little endian when writing overlay
and light
- Move overlay clamping to vertex input shader and clamp to 15 instead
of 10
- Create abstract InstanceAssemblerComponent class
- Change return type of SourceComponent.name() to String and improve
implementations
- Make lib instance shaders multiply color value instead of overriding
it
- Improve MultiBlockModelBuilder
- Accept an Iterable<BlockPos> instead of a
Collection<StructureBlockInfo> and assume all block state data is
already contained within the render world
- Accept a Function instead of a Map as the model data lookup
- Allow enabling fluid rendering (all rendered fluids are currently
unshaded)
- Refactor VirtualEmptyBlockGetter
- Move elementary implementations into abstract VirtualBlockGetter
class
- Extract virtual LevelLightEngine into separate VirtualLightEngine
class with ability to lookup light values per pos
- Turn VirtualEmptyBlockGetter into a class and make all methods final
to ensure instances of this class are actually empty even if subclassed
- Make BakedModelBufferer class package private
- Remove unused VertexTransformations class
- Remove Experimental annotation from
VisualizationContext.createEmbedding
- Display actual backend instead of preferred backend when checking
backend
- Remove engine message and use standard messages that display backend
ID
- Simplify command code
- Replace all literal components with translatable components
- Pass 1 instead of 0 for partialTick on tick
- Extract base AtomicReferenceCounted and ReferenceCounted abstract
classes
- Double buffer capacity instead of adding constant on resize in
VertexWriter
- Move Samplers class from backend.engine to backend
- Make VisualizationContext, InstancerProvider, VisualEmbedding all
BackendImplemented
- Add Engine#createVisualizationContext
- Remove Engine#instancer and variants
- VisualEmbeddings are created by backends, and data will be pushed into
them by visuals.
- VisualEmbedding extends VisualizationContext
- The implementation of VisualEmbedding also implements Environment
- Environment is an internal replacement for Context
- Instancers are keyed by Environments
- Default environment is a noop essentially
- Clean up texture binder stuff that's no longer needed
- Move all sampler binding to program link time
- Centralize sampler bindings/names to Samplers
- Move diffuse, light, and overlay textures into the api
- Add builder for context shader
- Fix generated_indirect -> generated_instancing
- Inline all unnecessary context stuff
- Move ContextShaders into backend.compile
- Instancers are parameterized by a nullable VisualEmbedding
- I don't like this, but the code currently compiles, so I want a
checkpoint before I try my next idea
- Add EmbeddedLevel to api
- Move all context api/lib stuffs into backend
- Move context shaders into internal
- Inline Shader and TextureSource interfaces
- Move matrix bounding sphere transform into util
- Add uniforms to cull shader to allow it to work with embedded levels
- Engine has 2 instancer methods, one that accepts an EmbeddedLevel and
one without the parameter
- Change VisualizationContext#withContext to #embed
- Remove crumbling stuff from Contexts
- Fix garbage indices on instancing engine
- glDrawElements* wants indices as a byte offset, we were giving it
a word offset
- Rename BufferedMesh -> PooledMesh
- PooledMesh no longer stores things it can fetch from the inner mesh
- Use one vao for all drawcalls in instancing engine
- PooledMesh issues *BaseVertex calls
- Move crumbling logic into InstancedDrawManager
- Move programs acquisition into InstancedDrawManager
- Move owned gl objects into InstancedDrawManager
- Models now return a list of ConfiguredMeshes, i.e. mesh-material pairs
- BufferedMeshes now poll the index pool as needed
- Inline BufferedMesh#write
- Expand packed overlay_light attribute into components
- Make light a short backed vec2
- Divide light input by 256 directly instead of discarding lower bits
- Remove debug overlay enum, instead only use OVERRIDE
- Add overlay debug mode
- Use texture buffers instead of instanced arrays
- Fixes issues with instance layouts using int elements
- Fixes attribute binding hardware limitations
- Create one texture for the entire instancing engine and bind each
instancer's vbo when it's time to draw
- Generate glsl to fetch FlwInstances from a usamplerBuffer according to
the instance layout
- Use RGBA32UI to get the most data from each texel fetch
- Align instance stride to 16 to avoid complexity in unpacking
- Clamp overlay from 0 to 10 rather than 3 to 10 to fix everything
appearing washed out
- Fix normalized short backed float vectors being unpacked incorrectly
- Set overlay in shadow instance component to fix shadows appearing red
- Indicative of the ivec issue being present for divisor 0 vertex
attributes
- Break instance overlay/light back into 2 layout elements
- Write light directly as an int
- Make light a short backed float element
- Clamp overlay coords in common.frag to avoid explosions
- Explosions: integer vertex attributes sometimes blow up to massive
sizes, greater than Short.MAX_VALUE which should not be possible.
- Reorganize some texture/uniform binding code
- Reimplement normal debug mode
- Add debug mode for instance ID and light coordinates
- Pass an id into _flw_main
- Allow specifying how the debug color is applied, not sure if I want
to keep it though
- Do not store the debug mode in config