mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Initial refactoring on shader usage and generation
`IShaderSource` was designed with the idea that if you want a shader, you must want it for a node. So it depends heavily on being given a tile material and the node drawtype. But this doesn't make sense neither in theory nor in practice. This commit takes a small step towards removing the incorrect abstraction.
This commit is contained in:
parent
eb8beb335e
commit
a6293b9861
14 changed files with 81 additions and 53 deletions
|
@ -66,10 +66,12 @@ void populateInterlacedPipeline(RenderPipeline *pipeline, Client *client)
|
|||
}
|
||||
|
||||
pipeline->addStep<OffsetCameraStep>(0.0f);
|
||||
|
||||
IShaderSource *s = client->getShaderSource();
|
||||
u32 shader = s->getShader("3d_interlaced_merge", TILE_MATERIAL_BASIC);
|
||||
auto shader = s->getShaderRaw("3d_interlaced_merge");
|
||||
video::E_MATERIAL_TYPE material = s->getShaderInfo(shader).material;
|
||||
auto texture_map = { TEXTURE_LEFT, TEXTURE_RIGHT, TEXTURE_MASK };
|
||||
|
||||
auto merge = pipeline->addStep<PostProcessingStep>(material, texture_map);
|
||||
merge->setRenderSource(buffer);
|
||||
merge->setRenderTarget(pipeline->createOwned<ScreenTarget>());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue