Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple shaders for models #30

Open
Avokadoen opened this issue Jan 9, 2023 · 0 comments
Open

Support multiple shaders for models #30

Avokadoen opened this issue Jan 9, 2023 · 0 comments

Comments

@Avokadoen
Copy link
Owner

Avokadoen commented Jan 9, 2023

API:

      var context = try RenderContext.init(allocator, window, &[_]PipelineInitialize{
            .{
                .update_rate = .{ .time_seconds = 0.01 },
                .vertex_path = "some/path/shader.vert",
                .fragment_path = "some/path/shader.frag",
                .mesh_instances =  &[_]RenderContext.MesInstancehInitializeContex{
                    .{
                        .cgltf_path = "models/ScifiHelmet/SciFiHelmet.gltf",
                        .instance_count = 1,
                    },
                    .{
                        .cgltf_path = "models/BoxTextured/BoxTextured.gltf",
                        .instance_count = 2,
                    },
                }, 
            },
            .{
                .update_rate = .{ .time_seconds = 0.05 },
                .vertex_path = "some_different/path/shader.vert",
                .fragment_path = "some_different/path/shader.frag",
                .mesh_instances =  &[_]RenderContext.MesInstancehInitializeContex{
                    .{
                        .cgltf_path = "models/ScifiHelmet/SciFiHelmet.gltf",
                        .instance_count = 3,
                    },
                    .{
                        .cgltf_path = "models/BoxTextured/BoxTextured.gltf",
                        .instance_count = 4,
                    },
                }, 
            },
    });

Of course mesh and instance handles would need to be updated as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant