Add new uniforms to cull shader

This commit is contained in:
Kneelawk 2024-03-04 18:21:36 -08:00
parent 3e55ae6aea
commit 8f4958ee2a
Failed to generate hash of commit
3 changed files with 13 additions and 1 deletions

View file

@ -82,7 +82,12 @@ public class IndirectPrograms extends AtomicReferenceCounted {
.withComponent(IndirectComponent::create)
.withResource(InstanceType::cullShader)
.withResource(CULL_SHADER_MAIN))
.postLink((key, program) -> program.setUniformBlockBinding("_FlwFrameUniforms", Uniforms.FRAME_INDEX))
.postLink((key, program) -> {
program.setUniformBlockBinding("_FlwFrameUniforms", Uniforms.FRAME_INDEX);
program.setUniformBlockBinding("_FlwOptionsUniforms", Uniforms.OPTIONS_INDEX);
program.setUniformBlockBinding("_FlwPlayerUniforms", Uniforms.PLAYER_INDEX);
program.setUniformBlockBinding("_FlwLevelUniforms", Uniforms.LEVEL_INDEX);
})
.harness("culling", sources);
}

View file

@ -2,6 +2,9 @@
#include "flywheel:internal/indirect/model_descriptor.glsl"
#include "flywheel:internal/indirect/object.glsl"
#include "flywheel:internal/uniforms/frame.glsl"
#include "flywheel:internal/uniforms/options.glsl"
#include "flywheel:internal/uniforms/player.glsl"
#include "flywheel:internal/uniforms/level.glsl"
#include "flywheel:util/matrix.glsl"
layout(local_size_x = _FLW_SUBGROUP_SIZE) in;

View file

@ -3,3 +3,7 @@
// Fog doesn't seem like a valid thing to query during the cull pass. Other uniforms added in the
// future may also be excluded, and we'll have to document each one.
// #include "flywheel:internal/uniforms/fog.glsl"
#include "flywheel:internal/uniforms/options.glsl"
#include "flywheel:internal/uniforms/player.glsl"
#include "flywheel:internal/uniforms/level.glsl"