Files
SDL3CPlusPlus/tests/scripts/unit_cube_logic.lua
johndoe6345789 01f1e94994 feat(render-graph): Implement Lua-based render graph system
- Added render graph configuration to JSON files and runtime settings.
- Introduced RenderGraphScriptService to load and manage render graph definitions from Lua.
- Updated GraphicsService to handle render graph definitions.
- Enhanced cube_logic.lua with a sample render graph function.
- Modified various services and interfaces to support render graph functionality.
- Improved logging for render graph operations and configurations.
2026-01-06 00:14:00 +00:00

59 lines
1.4 KiB
Lua

local function identity_matrix()
return {
1.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0,
}
end
function get_scene_objects()
return {
{
vertices = {
{ position = {0.0, 0.0, 0.0}, color = {1.0, 0.0, 0.0} },
{ position = {1.0, 0.0, 0.0}, color = {0.0, 1.0, 0.0} },
{ position = {0.0, 1.0, 0.0}, color = {0.0, 0.0, 1.0} },
},
indices = {1, 2, 3},
compute_model_matrix = function(time)
return identity_matrix()
end,
shader_key = "test",
},
}
end
function get_shader_paths()
return {
test = {
vertex = "shaders/test.vert",
fragment = "shaders/test.frag",
},
}
end
function get_view_projection(aspect)
return identity_matrix()
end
function compute_model_matrix(time)
return identity_matrix()
end
function get_render_graph()
return {
resources = {
scene_hdr = {type = "color", format = "rgba16f", size = "swapchain"},
depth = {type = "depth", format = "d32", size = "swapchain"},
},
passes = {
{
name = "gbuffer",
kind = "gbuffer",
outputs = {color = "scene_hdr", depth = "depth"},
},
},
}
end