I am implementing Gaussian splatting rendering using ogre-next v3. I’m not sure how to implement this using Unlit, so I’m using HLMS low-level instead. Currently, the HLMS low-level material script works in GLSL and HLSL, but it does not work on Metal. How can I fix this?
Problematic part 1: It seems that param_named_auto is not working.
vertex_program gsplatting_vp_glsl glsl glsles glslang
{
source gsplat_quad_vp.glsl
enable_include_header true
}
vertex_program gsplatting_vp_hlsl hlsl
{
source gsplat_quad_vp.hlsl
entry_point main
target vs_5_0 vs_4_0
}
vertex_program gsplatting_vp_metal metal
{
source gsplat_quad_vp.metal
entry_point main_metal
}
vertex_program gsplatting_vp unified
{
delegate gsplatting_vp_glsl
delegate gsplatting_vp_hlsl
delegate gsplatting_vp_metal
default_params
{
param_named_auto projmatrix worldviewproj_matrix
param_named_auto viewmatrix worldview_matrix
param_named_auto vpsize viewport_size
param_named_auto fovy fov
}
}
fragment_program gsplatting_fp_glsl glsl glsles glslang
{
source gsplat_quad_fp.glsl
}
fragment_program gsplatting_fp_hlsl hlsl
{
source gsplat_quad_fp.hlsl
entry_point main
target ps_5_0
}
fragment_program gsplatting_fp_metal metal
{
source gsplat_quad_fp.metal
entry_point main_metal
}
fragment_program gsplatting_fp unified
{
delegate gsplatting_fp_glsl
delegate gsplatting_fp_hlsl
delegate gsplatting_fp_metal
}
material pointcloud_quad
{
receive_shadows off
technique
{
pass
{
scene_blend alpha_blend
depth_write off
vertex_program_ref gsplatting_vp
{
}
fragment_program_ref gsplatting_fp
{
}
}
}
}
struct Uniforms
{
float4x4 projmatrix;
float4x4 viewmatrix;
float fovy;
float4 vpsize;
};
vertex VS_OUTPUT main_metal(VS_INPUT in [[stage_in]],
constant Uniforms& u [[buffer(0)]])
I also tried getting the uniform inputs separately. For example, const float4x4& projmatrix [[buffer(0)]], viewmarix [[buffer(1)]], and so on.
Problematic part 2: I’m not sure how to pass the input data to the vertex shader.
struct VS_INPUT
{
float3 position [[attribute(0)]];
float4 colour [[attribute(1)]];
float3 uv0 [[attribute(2)]];
float3 uv1 [[attribute(3)]];
float2 uv2 [[attribute(4)]];
};
Error message:
07:07:27: OGRE EXCEPTION(3:RenderingAPIException): Failed to create pipeline state for rendering, error: Vertex attribute colour(1) is missing from the vertex descriptor in MetalRenderSystem::_hlmsPipelineStateObjectCreated at /Users/taesookwon/ogre-next32/RenderSystems/Metal/src/OgreMetalRenderSystem.mm (line 1752)
I am implementing Gaussian splatting rendering using ogre-next v3. I’m not sure how to implement this using Unlit, so I’m using HLMS low-level instead. Currently, the HLMS low-level material script works in GLSL and HLSL, but it does not work on Metal. How can I fix this?
Problematic part 1: It seems that param_named_auto is not working.
I also tried getting the uniform inputs separately. For example, const float4x4& projmatrix [[buffer(0)]], viewmarix [[buffer(1)]], and so on.
Problematic part 2: I’m not sure how to pass the input data to the vertex shader.
Error message: