Line SDF gradient

Line sdf gradient rebase
This commit is contained in:
Bart Louwers
2023-10-06 14:04:41 +02:00
committed by GitHub
3 changed files with 187 additions and 1 deletions

View File

@@ -140,7 +140,7 @@ void RendererBackend::initShaders(gfx::ShaderRegistry& shaders, const ProgramPar
shaders::BuiltIn::HillshadePrepareShader,
shaders::BuiltIn::LineShader,
shaders::BuiltIn::LineGradientShader,
// shaders::BuiltIn::LineSDFShader,
shaders::BuiltIn::LineSDFShader,
shaders::BuiltIn::LinePatternShader,
shaders::BuiltIn::RasterShader,
shaders::BuiltIn::SymbolIconShader,

View File

@@ -45,5 +45,27 @@ const std::array<TextureInfo, 1> ShaderSource<BuiltIn::LinePatternShader, gfx::B
TextureInfo{0, "u_image"},
};
const std::array<AttributeInfo, 9> ShaderSource<BuiltIn::LineSDFShader, gfx::Backend::Type::Metal>::attributes = {
AttributeInfo{0, gfx::AttributeDataType::Short2, 1, "a_pos_normal"},
AttributeInfo{1, gfx::AttributeDataType::UByte4, 1, "a_data"},
AttributeInfo{2, gfx::AttributeDataType::Float4, 1, "a_color"},
AttributeInfo{3, gfx::AttributeDataType::Float2, 1, "a_blur"},
AttributeInfo{4, gfx::AttributeDataType::Float2, 1, "a_opacity"},
AttributeInfo{5, gfx::AttributeDataType::Float2, 1, "a_gapwidth"},
AttributeInfo{6, gfx::AttributeDataType::Float2, 1, "a_offset"},
AttributeInfo{7, gfx::AttributeDataType::Float2, 1, "a_width"},
AttributeInfo{8, gfx::AttributeDataType::Float2, 1, "a_floorwidth"},
};
const std::array<UniformBlockInfo, 5> ShaderSource<BuiltIn::LineSDFShader, gfx::Backend::Type::Metal>::uniforms = {
UniformBlockInfo{9, true, true, sizeof(LineSDFUBO), "LineSDFUBO"},
UniformBlockInfo{10, true, false, sizeof(LineSDFPropertiesUBO), "LineSDFPropertiesUBO"},
UniformBlockInfo{11, true, false, sizeof(LineSDFInterpolationUBO), "LineSDFInterpolationUBO"},
UniformBlockInfo{12, true, true, sizeof(LinePermutationUBO), "LinePermutationUBO"},
UniformBlockInfo{13, true, false, sizeof(ExpressionInputsUBO), "ExpressionInputsUBO"},
};
const std::array<TextureInfo, 1> ShaderSource<BuiltIn::LineSDFShader, gfx::Backend::Type::Metal>::textures = {
TextureInfo{0, "u_image"},
};
} // namespace shaders
} // namespace mbgl