mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 10:47:11 +02:00
add opaque forward model shaders
This commit is contained in:
parent
f7cb2ec85b
commit
6b984d38d3
1 changed files with 19 additions and 1 deletions
|
@ -222,9 +222,14 @@ void initDeferredPipelines(render::ShapePlumber& plumber) {
|
||||||
void initForwardPipelines(render::ShapePlumber& plumber) {
|
void initForwardPipelines(render::ShapePlumber& plumber) {
|
||||||
// Vertex shaders
|
// Vertex shaders
|
||||||
auto modelVertex = gpu::Shader::createVertex(std::string(model_vert));
|
auto modelVertex = gpu::Shader::createVertex(std::string(model_vert));
|
||||||
|
auto modelNormalMapVertex = gpu::Shader::createVertex(std::string(model_normal_map_vert));
|
||||||
|
|
||||||
// Pixel shaders
|
// Pixel shaders
|
||||||
auto modelPixel = gpu::Shader::createPixel(std::string(model_frag));
|
auto modelPixel = gpu::Shader::createPixel(std::string(model_frag));
|
||||||
|
auto modelUnlitPixel = gpu::Shader::createPixel(std::string(model_unlit_frag));
|
||||||
|
auto modelNormalMapPixel = gpu::Shader::createPixel(std::string(model_normal_map_frag));
|
||||||
|
auto modelSpecularMapPixel = gpu::Shader::createPixel(std::string(model_specular_map_frag));
|
||||||
|
auto modelNormalSpecularMapPixel = gpu::Shader::createPixel(std::string(model_normal_specular_map_frag));
|
||||||
|
|
||||||
using Key = render::ShapeKey;
|
using Key = render::ShapeKey;
|
||||||
auto addPipeline = std::bind(&addPlumberPipeline, std::ref(plumber), _1, _2, _3);
|
auto addPipeline = std::bind(&addPlumberPipeline, std::ref(plumber), _1, _2, _3);
|
||||||
|
@ -232,7 +237,20 @@ void initForwardPipelines(render::ShapePlumber& plumber) {
|
||||||
addPipeline(
|
addPipeline(
|
||||||
Key::Builder(),
|
Key::Builder(),
|
||||||
modelVertex, modelPixel);
|
modelVertex, modelPixel);
|
||||||
}
|
addPipeline(
|
||||||
|
Key::Builder().withUnlit(),
|
||||||
|
modelVertex, modelUnlitPixel);
|
||||||
|
addPipeline(
|
||||||
|
Key::Builder().withTangents(),
|
||||||
|
modelNormalMapVertex, modelNormalMapPixel);
|
||||||
|
addPipeline(
|
||||||
|
Key::Builder().withSpecular(),
|
||||||
|
modelVertex, modelSpecularMapPixel);
|
||||||
|
addPipeline(
|
||||||
|
Key::Builder().withTangents().withSpecular(),
|
||||||
|
modelNormalMapVertex, modelNormalSpecularMapPixel);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void addPlumberPipeline(ShapePlumber& plumber,
|
void addPlumberPipeline(ShapePlumber& plumber,
|
||||||
const ShapeKey& key, const gpu::ShaderPointer& vertex, const gpu::ShaderPointer& pixel) {
|
const ShapeKey& key, const gpu::ShaderPointer& vertex, const gpu::ShaderPointer& pixel) {
|
||||||
|
|
Loading…
Reference in a new issue