mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-07 03:22:27 +02:00
Fixed compilation with new shader system
This commit is contained in:
parent
3911ce59cc
commit
49549ced17
31 changed files with 273 additions and 281 deletions
|
@ -33,8 +33,8 @@
|
|||
#include "../Logging.h"
|
||||
#include "../CompositorHelper.h"
|
||||
|
||||
#include "hmd_ui_vert.h"
|
||||
#include "hmd_ui_frag.h"
|
||||
#include "render-utils/hmd_ui_vert.h"
|
||||
#include "render-utils/hmd_ui_frag.h"
|
||||
|
||||
static const QString MONO_PREVIEW = "Mono Preview";
|
||||
static const QString DISABLE_PREVIEW = "Disable Preview";
|
||||
|
@ -403,8 +403,8 @@ void HmdDisplayPlugin::HUDRenderer::build() {
|
|||
|
||||
void HmdDisplayPlugin::HUDRenderer::updatePipeline() {
|
||||
if (!pipeline) {
|
||||
auto vs = gpu::Shader::createVertex(std::string(hmd_ui_vert));
|
||||
auto ps = gpu::Shader::createPixel(std::string(hmd_ui_frag));
|
||||
auto vs = hmd_ui_vert::getShader();
|
||||
auto ps = hmd_ui_frag::getShader();
|
||||
auto program = gpu::Shader::createProgram(vs, ps);
|
||||
gpu::gl::GLBackend::makeProgram(*program, gpu::Shader::BindingSet());
|
||||
uniformsLocation = program->getUniformBuffers().findLocation("hudBuffer");
|
||||
|
|
|
@ -36,8 +36,8 @@ static ShapePipelinePointer shapePipelineFactory(const ShapePlumber& plumber, co
|
|||
gpu::State::FACTOR_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::ONE);
|
||||
PrepareStencil::testMask(*state);
|
||||
|
||||
auto vertShader = gpu::Shader::createVertex(std::string(textured_particle_vert));
|
||||
auto fragShader = gpu::Shader::createPixel(std::string(textured_particle_frag));
|
||||
auto vertShader = textured_particle_vert::getShader();
|
||||
auto fragShader = textured_particle_frag::getShader();
|
||||
|
||||
auto program = gpu::Shader::createProgram(vertShader, fragShader);
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
|
|
@ -48,8 +48,8 @@ struct PolyLineUniforms {
|
|||
|
||||
static render::ShapePipelinePointer shapePipelineFactory(const render::ShapePlumber& plumber, const render::ShapeKey& key) {
|
||||
if (!polylinePipeline) {
|
||||
auto VS = gpu::Shader::createVertex(std::string(paintStroke_vert));
|
||||
auto PS = gpu::Shader::createPixel(std::string(paintStroke_frag));
|
||||
auto VS = paintStroke_vert::getShader();
|
||||
auto PS = paintStroke_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(VS, PS);
|
||||
#ifdef POLYLINE_ENTITY_USE_FADE_EFFECT
|
||||
auto fadeVS = gpu::Shader::createVertex(std::string(paintStroke_fade_vert));
|
||||
|
|
|
@ -1461,8 +1461,8 @@ static gpu::Stream::FormatPointer _vertexFormat;
|
|||
|
||||
ShapePipelinePointer shapePipelineFactory(const ShapePlumber& plumber, const ShapeKey& key) {
|
||||
if (!_pipelines[0]) {
|
||||
gpu::ShaderPointer vertexShaders[2] = { gpu::Shader::createVertex(std::string(polyvox_vert)), gpu::Shader::createVertex(std::string(polyvox_fade_vert)) };
|
||||
gpu::ShaderPointer pixelShaders[2] = { gpu::Shader::createPixel(std::string(polyvox_frag)), gpu::Shader::createPixel(std::string(polyvox_fade_frag)) };
|
||||
gpu::ShaderPointer vertexShaders[2] = { polyvox_vert::getShader(), polyvox_fade_vert::getShader() };
|
||||
gpu::ShaderPointer pixelShaders[2] = { polyvox_frag::getShader(), polyvox_fade_frag::getShader() };
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
slotBindings.insert(gpu::Shader::Binding(std::string("materialBuffer"), MATERIAL_GPU_SLOT));
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
#include <GeometryCache.h>
|
||||
#include <PerfStat.h>
|
||||
|
||||
#include "simple_vert.h"
|
||||
#include "simple_frag.h"
|
||||
#include "render-utils/simple_vert.h"
|
||||
#include "render-utils/simple_frag.h"
|
||||
|
||||
//#define SHAPE_ENTITY_USE_FADE_EFFECT
|
||||
#ifdef SHAPE_ENTITY_USE_FADE_EFFECT
|
||||
|
@ -32,8 +32,8 @@ static const float SPHERE_ENTITY_SCALE = 0.5f;
|
|||
|
||||
|
||||
ShapeEntityRenderer::ShapeEntityRenderer(const EntityItemPointer& entity) : Parent(entity) {
|
||||
_procedural._vertexSource = simple_vert;
|
||||
_procedural._fragmentSource = simple_frag;
|
||||
_procedural._vertexSource = simple_vert::getSource();
|
||||
_procedural._fragmentSource = simple_frag::getSource();
|
||||
_procedural._opaqueState->setCullMode(gpu::State::CULL_NONE);
|
||||
_procedural._opaqueState->setDepthTest(true, true, gpu::LESS_EQUAL);
|
||||
PrepareStencil::testMaskDrawShape(*_procedural._opaqueState);
|
||||
|
|
|
@ -241,7 +241,7 @@ void Procedural::prepare(gpu::Batch& batch, const glm::vec3& position, const glm
|
|||
std::string fragmentShaderSource = _fragmentSource;
|
||||
size_t replaceIndex = fragmentShaderSource.find(PROCEDURAL_COMMON_BLOCK);
|
||||
if (replaceIndex != std::string::npos) {
|
||||
fragmentShaderSource.replace(replaceIndex, PROCEDURAL_COMMON_BLOCK.size(), ProceduralCommon_frag.h";
|
||||
fragmentShaderSource.replace(replaceIndex, PROCEDURAL_COMMON_BLOCK.size(), ProceduralCommon_frag::getSource());
|
||||
}
|
||||
|
||||
replaceIndex = fragmentShaderSource.find(PROCEDURAL_VERSION);
|
||||
|
|
|
@ -15,12 +15,12 @@
|
|||
#include <gpu/Context.h>
|
||||
#include <ViewFrustum.h>
|
||||
|
||||
#include "skybox_vert.h"
|
||||
#include "skybox_frag.h"
|
||||
#include "model/skybox_vert.h"
|
||||
#include "model/skybox_frag.h"
|
||||
|
||||
ProceduralSkybox::ProceduralSkybox() : model::Skybox() {
|
||||
_procedural._vertexSource = skybox_vert;
|
||||
_procedural._fragmentSource = skybox_frag;
|
||||
_procedural._vertexSource = skybox_vert::getSource();
|
||||
_procedural._fragmentSource = skybox_frag::getSource();
|
||||
// Adjust the pipeline state for background using the stencil test
|
||||
_procedural.setDoesFade(false);
|
||||
// Must match PrepareStencil::STENCIL_BACKGROUND
|
||||
|
|
|
@ -263,7 +263,7 @@ void AmbientOcclusionEffect::configure(const Config& config) {
|
|||
const gpu::PipelinePointer& AmbientOcclusionEffect::getOcclusionPipeline() {
|
||||
if (!_occlusionPipeline) {
|
||||
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(ssao_makeOcclusion_frag));
|
||||
auto ps = ssao_makeOcclusion_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
@ -288,7 +288,7 @@ const gpu::PipelinePointer& AmbientOcclusionEffect::getOcclusionPipeline() {
|
|||
const gpu::PipelinePointer& AmbientOcclusionEffect::getHBlurPipeline() {
|
||||
if (!_hBlurPipeline) {
|
||||
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(ssao_makeHorizontalBlur_frag));
|
||||
auto ps = ssao_makeHorizontalBlur_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
@ -311,7 +311,7 @@ const gpu::PipelinePointer& AmbientOcclusionEffect::getHBlurPipeline() {
|
|||
const gpu::PipelinePointer& AmbientOcclusionEffect::getVBlurPipeline() {
|
||||
if (!_vBlurPipeline) {
|
||||
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(ssao_makeVerticalBlur_frag));
|
||||
auto ps = ssao_makeVerticalBlur_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
@ -458,7 +458,7 @@ void DebugAmbientOcclusion::configure(const Config& config) {
|
|||
const gpu::PipelinePointer& DebugAmbientOcclusion::getDebugPipeline() {
|
||||
if (!_debugPipeline) {
|
||||
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(ssao_debugOcclusion_frag));
|
||||
auto ps = ssao_debugOcclusion_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
|
|
@ -102,8 +102,8 @@ AnimDebugDraw::AnimDebugDraw() :
|
|||
state->setBlendFunction(false, gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD,
|
||||
gpu::State::INV_SRC_ALPHA, gpu::State::FACTOR_ALPHA,
|
||||
gpu::State::BLEND_OP_ADD, gpu::State::ONE);
|
||||
auto vertShader = gpu::Shader::createVertex(std::string(animdebugdraw_vert));
|
||||
auto fragShader = gpu::Shader::createPixel(std::string(animdebugdraw_frag));
|
||||
auto vertShader = animdebugdraw_vert::getShader();
|
||||
auto fragShader = animdebugdraw_frag::getShader();
|
||||
auto program = gpu::Shader::createProgram(vertShader, fragShader);
|
||||
_pipeline = gpu::Pipeline::create(program, state);
|
||||
|
||||
|
|
|
@ -57,8 +57,8 @@ const gpu::PipelinePointer& Antialiasing::getAntialiasingPipeline(RenderArgs* ar
|
|||
}
|
||||
|
||||
if (!_antialiasingPipeline) {
|
||||
auto vs = gpu::Shader::createVertex(std::string(fxaa_vert));
|
||||
auto ps = gpu::Shader::createPixel(std::string(fxaa_frag));
|
||||
auto vs = fxaa_vert::getShader();
|
||||
auto ps = fxaa_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
@ -82,8 +82,8 @@ const gpu::PipelinePointer& Antialiasing::getAntialiasingPipeline(RenderArgs* ar
|
|||
|
||||
const gpu::PipelinePointer& Antialiasing::getBlendPipeline() {
|
||||
if (!_blendPipeline) {
|
||||
auto vs = gpu::Shader::createVertex(std::string(fxaa_vert));
|
||||
auto ps = gpu::Shader::createPixel(std::string(fxaa_blend_frag));
|
||||
auto vs = fxaa_vert::getShader();
|
||||
auto ps = fxaa_blend_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
|
|
@ -61,7 +61,7 @@ void BloomThreshold::run(const render::RenderContextPointer& renderContext, cons
|
|||
|
||||
if (!_pipeline) {
|
||||
auto vs = gpu::StandardShaderLib::getDrawTransformUnitQuadVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(BloomThreshold_frag));
|
||||
auto ps = BloomThreshold_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
@ -113,7 +113,7 @@ void BloomApply::run(const render::RenderContextPointer& renderContext, const In
|
|||
|
||||
if (!_pipeline) {
|
||||
auto vs = gpu::StandardShaderLib::getDrawTransformUnitQuadVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(BloomApply_frag));
|
||||
auto ps = BloomApply_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
|
|
@ -369,8 +369,7 @@ bool DebugDeferredBuffer::pipelineNeedsUpdate(Mode mode, std::string customFile)
|
|||
|
||||
const gpu::PipelinePointer& DebugDeferredBuffer::getPipeline(Mode mode, std::string customFile) {
|
||||
if (pipelineNeedsUpdate(mode, customFile)) {
|
||||
static const std::string VERTEX_SHADER { debug_deferred_buffer_vert };
|
||||
static const std::string FRAGMENT_SHADER { debug_deferred_buffer_frag };
|
||||
static const std::string FRAGMENT_SHADER { debug_deferred_buffer_frag::getSource() };
|
||||
static const std::string SOURCE_PLACEHOLDER { "//SOURCE_PLACEHOLDER" };
|
||||
static const auto SOURCE_PLACEHOLDER_INDEX = FRAGMENT_SHADER.find(SOURCE_PLACEHOLDER);
|
||||
Q_ASSERT_X(SOURCE_PLACEHOLDER_INDEX != std::string::npos, Q_FUNC_INFO,
|
||||
|
@ -380,7 +379,7 @@ const gpu::PipelinePointer& DebugDeferredBuffer::getPipeline(Mode mode, std::str
|
|||
bakedFragmentShader.replace(SOURCE_PLACEHOLDER_INDEX, SOURCE_PLACEHOLDER.size(),
|
||||
getShaderSourceCode(mode, customFile));
|
||||
|
||||
static const auto vs = gpu::Shader::createVertex(VERTEX_SHADER);
|
||||
const auto vs = debug_deferred_buffer_vert::getShader();
|
||||
const auto ps = gpu::Shader::createPixel(bakedFragmentShader);
|
||||
const auto program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ enum DeferredShader_BufferSlot {
|
|||
LIGHT_CLUSTER_GRID_CLUSTER_CONTENT_SLOT,
|
||||
};
|
||||
|
||||
static void loadLightProgram(const char* vertSource, const char* fragSource, bool lightVolume, gpu::PipelinePointer& program, LightLocationsPtr& locations);
|
||||
static void loadLightProgram(const gpu::ShaderPointer& vertShader, const gpu::ShaderPointer& fragShader, bool lightVolume, gpu::PipelinePointer& program, LightLocationsPtr& locations);
|
||||
|
||||
void DeferredLightingEffect::init() {
|
||||
_directionalAmbientSphereLightLocations = std::make_shared<LightLocations>();
|
||||
|
@ -91,14 +91,14 @@ void DeferredLightingEffect::init() {
|
|||
_localLightLocations = std::make_shared<LightLocations>();
|
||||
_localLightOutlineLocations = std::make_shared<LightLocations>();
|
||||
|
||||
loadLightProgram(deferred_light_vert, directional_ambient_light_frag, false, _directionalAmbientSphereLight, _directionalAmbientSphereLightLocations);
|
||||
loadLightProgram(deferred_light_vert, directional_skybox_light_frag, false, _directionalSkyboxLight, _directionalSkyboxLightLocations);
|
||||
loadLightProgram(deferred_light_vert::getShader(), directional_ambient_light_frag::getShader(), false, _directionalAmbientSphereLight, _directionalAmbientSphereLightLocations);
|
||||
loadLightProgram(deferred_light_vert::getShader(), directional_skybox_light_frag::getShader(), false, _directionalSkyboxLight, _directionalSkyboxLightLocations);
|
||||
|
||||
loadLightProgram(deferred_light_vert, directional_ambient_light_shadow_frag, false, _directionalAmbientSphereLightShadow, _directionalAmbientSphereLightShadowLocations);
|
||||
loadLightProgram(deferred_light_vert, directional_skybox_light_shadow_frag, false, _directionalSkyboxLightShadow, _directionalSkyboxLightShadowLocations);
|
||||
loadLightProgram(deferred_light_vert::getShader(), directional_ambient_light_shadow_frag::getShader(), false, _directionalAmbientSphereLightShadow, _directionalAmbientSphereLightShadowLocations);
|
||||
loadLightProgram(deferred_light_vert::getShader(), directional_skybox_light_shadow_frag::getShader(), false, _directionalSkyboxLightShadow, _directionalSkyboxLightShadowLocations);
|
||||
|
||||
loadLightProgram(deferred_light_vert, local_lights_shading_frag, true, _localLight, _localLightLocations);
|
||||
loadLightProgram(deferred_light_vert, local_lights_drawOutline_frag, true, _localLightOutline, _localLightOutlineLocations);
|
||||
loadLightProgram(deferred_light_vert::getShader(), local_lights_shading_frag::getShader(), true, _localLight, _localLightLocations);
|
||||
loadLightProgram(deferred_light_vert::getShader(), local_lights_drawOutline_frag::getShader(), true, _localLightOutline, _localLightOutlineLocations);
|
||||
}
|
||||
|
||||
void DeferredLightingEffect::setupKeyLightBatch(const RenderArgs* args, gpu::Batch& batch, int lightBufferUnit, int ambientBufferUnit, int skyboxCubemapUnit) {
|
||||
|
@ -144,11 +144,8 @@ void DeferredLightingEffect::unsetKeyLightBatch(gpu::Batch& batch, int lightBuff
|
|||
}
|
||||
}
|
||||
|
||||
static gpu::ShaderPointer makeLightProgram(const char* vertSource, const char* fragSource, LightLocationsPtr& locations) {
|
||||
auto VS = gpu::Shader::createVertex(std::string(vertSource));
|
||||
auto PS = gpu::Shader::createPixel(std::string(fragSource));
|
||||
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(VS, PS);
|
||||
static gpu::ShaderPointer makeLightProgram(const gpu::ShaderPointer& vertShader, const gpu::ShaderPointer& fragShader, LightLocationsPtr& locations) {
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vertShader, fragShader);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
slotBindings.insert(gpu::Shader::Binding(std::string("colorMap"), DEFERRED_BUFFER_COLOR_UNIT));
|
||||
|
@ -196,9 +193,9 @@ static gpu::ShaderPointer makeLightProgram(const char* vertSource, const char* f
|
|||
return program;
|
||||
}
|
||||
|
||||
static void loadLightProgram(const char* vertSource, const char* fragSource, bool lightVolume, gpu::PipelinePointer& pipeline, LightLocationsPtr& locations) {
|
||||
static void loadLightProgram(const gpu::ShaderPointer& vertShader, const gpu::ShaderPointer& fragShader, bool lightVolume, gpu::PipelinePointer& pipeline, LightLocationsPtr& locations) {
|
||||
|
||||
gpu::ShaderPointer program = makeLightProgram(vertSource, fragSource, locations);
|
||||
gpu::ShaderPointer program = makeLightProgram(vertShader, fragShader, locations);
|
||||
|
||||
auto state = std::make_shared<gpu::State>();
|
||||
state->setColorWriteMask(true, true, true, false);
|
||||
|
|
|
@ -133,7 +133,7 @@ void DrawHaze::run(const render::RenderContextPointer& renderContext, const Inpu
|
|||
RenderArgs* args = renderContext->args;
|
||||
|
||||
if (!_hazePipeline) {
|
||||
gpu::ShaderPointer ps = gpu::Shader::createPixel(std::string(Haze_frag));
|
||||
gpu::ShaderPointer ps = Haze_frag::getShader();
|
||||
gpu::ShaderPointer vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
||||
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
|
|
@ -1946,8 +1946,8 @@ void GeometryCache::renderGlowLine(gpu::Batch& batch, const glm::vec3& p1, const
|
|||
static std::once_flag once;
|
||||
std::call_once(once, [&] {
|
||||
auto state = std::make_shared<gpu::State>();
|
||||
auto VS = gpu::Shader::createVertex(std::string(glowLine_vert));
|
||||
auto PS = gpu::Shader::createPixel(std::string(glowLine_frag));
|
||||
auto VS = glowLine_vert::getShader();
|
||||
auto PS = glowLine_frag::getShader();
|
||||
auto program = gpu::Shader::createProgram(VS, PS);
|
||||
state->setCullMode(gpu::State::CULL_NONE);
|
||||
state->setDepthTest(true, false, gpu::LESS_EQUAL);
|
||||
|
@ -2002,8 +2002,8 @@ void GeometryCache::renderGlowLine(gpu::Batch& batch, const glm::vec3& p1, const
|
|||
|
||||
void GeometryCache::useSimpleDrawPipeline(gpu::Batch& batch, bool noBlend) {
|
||||
if (!_standardDrawPipeline) {
|
||||
auto vs = gpu::Shader::createVertex(std::string(standardTransformPNTC_vert));
|
||||
auto ps = gpu::Shader::createPixel(std::string(standardDrawTexture_frag));
|
||||
auto vs = standardTransformPNTC_vert::getShader();
|
||||
auto ps = standardDrawTexture_frag::getShader();
|
||||
auto program = gpu::Shader::createProgram(vs, ps);
|
||||
gpu::Shader::makeProgram((*program));
|
||||
|
||||
|
@ -2033,8 +2033,8 @@ void GeometryCache::useSimpleDrawPipeline(gpu::Batch& batch, bool noBlend) {
|
|||
|
||||
void GeometryCache::useGridPipeline(gpu::Batch& batch, GridBuffer gridBuffer, bool isLayered) {
|
||||
if (!_gridPipeline) {
|
||||
auto vs = gpu::Shader::createVertex(std::string(standardTransformPNTC_vert));
|
||||
auto ps = gpu::Shader::createPixel(std::string(grid_frag));
|
||||
auto vs = standardTransformPNTC_vert::getShader();
|
||||
auto ps = grid_frag::getShader();
|
||||
auto program = gpu::Shader::createProgram(vs, ps);
|
||||
gpu::Shader::makeProgram((*program));
|
||||
_gridSlot = program->getUniformBuffers().findLocation("gridBuffer");
|
||||
|
@ -2117,12 +2117,9 @@ inline bool operator==(const SimpleProgramKey& a, const SimpleProgramKey& b) {
|
|||
return a.getRaw() == b.getRaw();
|
||||
}
|
||||
|
||||
static void buildWebShader(const std::string& vertShaderText, const std::string& fragShaderText, bool blendEnable,
|
||||
static void buildWebShader(const gpu::ShaderPointer& vertShader, const gpu::ShaderPointer& fragShader, bool blendEnable,
|
||||
gpu::ShaderPointer& shaderPointerOut, gpu::PipelinePointer& pipelinePointerOut) {
|
||||
auto VS = gpu::Shader::createVertex(vertShaderText);
|
||||
auto PS = gpu::Shader::createPixel(fragShaderText);
|
||||
|
||||
shaderPointerOut = gpu::Shader::createProgram(VS, PS);
|
||||
shaderPointerOut = gpu::Shader::createProgram(vertShader, fragShader);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
gpu::Shader::makeProgram(*shaderPointerOut, slotBindings);
|
||||
|
@ -2145,8 +2142,8 @@ void GeometryCache::bindWebBrowserProgram(gpu::Batch& batch, bool transparent) {
|
|||
gpu::PipelinePointer GeometryCache::getWebBrowserProgram(bool transparent) {
|
||||
static std::once_flag once;
|
||||
std::call_once(once, [&]() {
|
||||
buildWebShader(simple_vert, simple_opaque_web_browser_frag, false, _simpleOpaqueWebBrowserShader, _simpleOpaqueWebBrowserPipelineNoAA);
|
||||
buildWebShader(simple_vert, simple_transparent_web_browser_frag, true, _simpleTransparentWebBrowserShader, _simpleTransparentWebBrowserPipelineNoAA);
|
||||
buildWebShader(simple_vert::getShader(), simple_opaque_web_browser_frag::getShader(), false, _simpleOpaqueWebBrowserShader, _simpleOpaqueWebBrowserPipelineNoAA);
|
||||
buildWebShader(simple_vert::getShader(), simple_transparent_web_browser_frag::getShader(), true, _simpleTransparentWebBrowserShader, _simpleTransparentWebBrowserPipelineNoAA);
|
||||
});
|
||||
|
||||
return transparent ? _simpleTransparentWebBrowserPipelineNoAA : _simpleOpaqueWebBrowserPipelineNoAA;
|
||||
|
@ -2175,9 +2172,9 @@ gpu::PipelinePointer GeometryCache::getSimplePipeline(bool textured, bool transp
|
|||
if (!fading) {
|
||||
static std::once_flag once;
|
||||
std::call_once(once, [&]() {
|
||||
auto VS = gpu::Shader::createVertex(std::string(simple_vert));
|
||||
auto PS = gpu::Shader::createPixel(std::string(simple_textured_frag));
|
||||
auto PSUnlit = gpu::Shader::createPixel(std::string(simple_textured_unlit_frag));
|
||||
auto VS = simple_vert::getShader();
|
||||
auto PS = simple_textured_frag::getShader();
|
||||
auto PSUnlit = simple_textured_unlit_frag::getShader();
|
||||
|
||||
_simpleShader = gpu::Shader::createProgram(VS, PS);
|
||||
_unlitShader = gpu::Shader::createProgram(VS, PSUnlit);
|
||||
|
@ -2190,9 +2187,9 @@ gpu::PipelinePointer GeometryCache::getSimplePipeline(bool textured, bool transp
|
|||
} else {
|
||||
static std::once_flag once;
|
||||
std::call_once(once, [&]() {
|
||||
auto VS = gpu::Shader::createVertex(std::string(simple_fade_vert));
|
||||
auto PS = gpu::Shader::createPixel(std::string(simple_textured_fade_frag));
|
||||
auto PSUnlit = gpu::Shader::createPixel(std::string(simple_textured_unlit_fade_frag));
|
||||
auto VS = simple_fade_vert::getShader();
|
||||
auto PS = simple_textured_fade_frag::getShader();
|
||||
auto PSUnlit = simple_textured_unlit_fade_frag::getShader();
|
||||
|
||||
_simpleFadeShader = gpu::Shader::createProgram(VS, PS);
|
||||
_unlitFadeShader = gpu::Shader::createProgram(VS, PSUnlit);
|
||||
|
|
|
@ -130,8 +130,8 @@ void DrawHighlightMask::run(const render::RenderContextPointer& renderContext, c
|
|||
fillState->setColorWriteMask(false, false, false, false);
|
||||
fillState->setCullMode(gpu::State::CULL_FRONT);
|
||||
|
||||
auto vs = gpu::Shader::createVertex(std::string(Highlight_aabox_vert));
|
||||
auto ps = gpu::Shader::createPixel(std::string(nop_frag));
|
||||
auto vs = Highlight_aabox_vert::getShader();
|
||||
auto ps = nop_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
@ -313,7 +313,7 @@ const gpu::PipelinePointer& DrawHighlight::getPipeline(const render::HighlightSt
|
|||
state->setStencilTest(true, 0, gpu::State::StencilTest(OUTLINE_STENCIL_MASK, 0xFF, gpu::EQUAL));
|
||||
|
||||
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(Highlight_frag));
|
||||
auto ps = Highlight_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
@ -325,7 +325,7 @@ const gpu::PipelinePointer& DrawHighlight::getPipeline(const render::HighlightSt
|
|||
|
||||
_pipeline = gpu::Pipeline::create(program, state);
|
||||
|
||||
ps = gpu::Shader::createPixel(std::string(Highlight_filled_frag));
|
||||
ps = Highlight_filled_frag::getShader();
|
||||
program = gpu::Shader::createProgram(vs, ps);
|
||||
gpu::Shader::makeProgram(*program, slotBindings);
|
||||
_pipelineFilled = gpu::Pipeline::create(program, state);
|
||||
|
@ -385,8 +385,7 @@ void DebugHighlight::run(const render::RenderContextPointer& renderContext, cons
|
|||
}
|
||||
|
||||
void DebugHighlight::initializePipelines() {
|
||||
static const std::string VERTEX_SHADER{ debug_deferred_buffer_vert };
|
||||
static const std::string FRAGMENT_SHADER{ debug_deferred_buffer_frag };
|
||||
static const std::string FRAGMENT_SHADER{ debug_deferred_buffer_frag::getSource() };
|
||||
static const std::string SOURCE_PLACEHOLDER{ "//SOURCE_PLACEHOLDER" };
|
||||
static const auto SOURCE_PLACEHOLDER_INDEX = FRAGMENT_SHADER.find(SOURCE_PLACEHOLDER);
|
||||
Q_ASSERT_X(SOURCE_PLACEHOLDER_INDEX != std::string::npos, Q_FUNC_INFO,
|
||||
|
@ -396,7 +395,7 @@ void DebugHighlight::initializePipelines() {
|
|||
state->setDepthTest(gpu::State::DepthTest(false, false));
|
||||
state->setStencilTest(true, 0, gpu::State::StencilTest(OUTLINE_STENCIL_MASK, 0xFF, gpu::EQUAL));
|
||||
|
||||
const auto vs = gpu::Shader::createVertex(VERTEX_SHADER);
|
||||
const auto vs = debug_deferred_buffer_vert::getShader();
|
||||
|
||||
// Depth shader
|
||||
{
|
||||
|
@ -553,14 +552,14 @@ const render::Varying DrawHighlightTask::addSelectItemJobs(JobModel& task, const
|
|||
#include "model_shadow_frag.h"
|
||||
|
||||
void DrawHighlightTask::initMaskPipelines(render::ShapePlumber& shapePlumber, gpu::StatePointer state) {
|
||||
auto modelVertex = gpu::Shader::createVertex(std::string(model_shadow_vert));
|
||||
auto modelPixel = gpu::Shader::createPixel(std::string(model_shadow_frag));
|
||||
auto modelVertex = model_shadow_vert::getShader();
|
||||
auto modelPixel = model_shadow_frag::getShader();
|
||||
gpu::ShaderPointer modelProgram = gpu::Shader::createProgram(modelVertex, modelPixel);
|
||||
shapePlumber.addPipeline(
|
||||
ShapeKey::Filter::Builder().withoutSkinned(),
|
||||
modelProgram, state);
|
||||
|
||||
auto skinVertex = gpu::Shader::createVertex(std::string(skin_model_shadow_vert));
|
||||
auto skinVertex = skin_model_shadow_vert::getShader();
|
||||
gpu::ShaderPointer skinProgram = gpu::Shader::createProgram(skinVertex, modelPixel);
|
||||
shapePlumber.addPipeline(
|
||||
ShapeKey::Filter::Builder().withSkinned(),
|
||||
|
|
|
@ -605,8 +605,8 @@ void DebugLightClusters::configure(const Config& config) {
|
|||
|
||||
const gpu::PipelinePointer DebugLightClusters::getDrawClusterGridPipeline() {
|
||||
if (!_drawClusterGrid) {
|
||||
auto vs = gpu::Shader::createVertex(std::string(lightClusters_drawGrid_vert));
|
||||
auto ps = gpu::Shader::createPixel(std::string(lightClusters_drawGrid_frag));
|
||||
auto vs = lightClusters_drawGrid_vert::getShader();
|
||||
auto ps = lightClusters_drawGrid_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
@ -635,7 +635,7 @@ const gpu::PipelinePointer DebugLightClusters::getDrawClusterFromDepthPipeline()
|
|||
if (!_drawClusterFromDepth) {
|
||||
// auto vs = gpu::Shader::createVertex(std::string(lightClusters_drawGrid_vert));
|
||||
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(lightClusters_drawClusterFromDepth_frag));
|
||||
auto ps = lightClusters_drawClusterFromDepth_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
@ -665,7 +665,7 @@ const gpu::PipelinePointer DebugLightClusters::getDrawClusterContentPipeline() {
|
|||
if (!_drawClusterContent) {
|
||||
// auto vs = gpu::Shader::createVertex(std::string(lightClusters_drawClusterContent_vert));
|
||||
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(lightClusters_drawClusterContent_frag));
|
||||
auto ps = lightClusters_drawClusterContent_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
|
|
@ -125,7 +125,7 @@ void Draw::run(const RenderContextPointer& renderContext,
|
|||
const gpu::PipelinePointer Stencil::getPipeline() {
|
||||
if (!_stencilPipeline) {
|
||||
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(nop_frag);
|
||||
auto ps = nop_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
gpu::Shader::makeProgram(*program);
|
||||
|
||||
|
|
|
@ -117,16 +117,16 @@ void batchSetter(const ShapePipeline& pipeline, gpu::Batch& batch, RenderArgs* a
|
|||
void lightBatchSetter(const ShapePipeline& pipeline, gpu::Batch& batch, RenderArgs* args);
|
||||
|
||||
void initOverlay3DPipelines(ShapePlumber& plumber, bool depthTest) {
|
||||
auto vertex = gpu::Shader::createVertex(std::string(overlay3D_vert));
|
||||
auto vertexModel = gpu::Shader::createVertex(std::string(model_vert));
|
||||
auto pixel = gpu::Shader::createPixel(std::string(overlay3D_frag));
|
||||
auto pixelTranslucent = gpu::Shader::createPixel(std::string(overlay3D_translucent_frag));
|
||||
auto pixelUnlit = gpu::Shader::createPixel(std::string(overlay3D_unlit_frag));
|
||||
auto pixelTranslucentUnlit = gpu::Shader::createPixel(std::string(overlay3D_translucent_unlit_frag));
|
||||
auto pixelModel = gpu::Shader::createPixel(std::string(overlay3D_model_frag));
|
||||
auto pixelModelTranslucent = gpu::Shader::createPixel(std::string(overlay3D_model_translucent_frag));
|
||||
auto pixelModelUnlit = gpu::Shader::createPixel(std::string(overlay3D_model_unlit_frag));
|
||||
auto pixelModelTranslucentUnlit = gpu::Shader::createPixel(std::string(overlay3D_model_translucent_unlit_frag));
|
||||
auto vertex = overlay3D_vert::getShader();
|
||||
auto vertexModel = model_vert::getShader();
|
||||
auto pixel = overlay3D_frag::getShader();
|
||||
auto pixelTranslucent = overlay3D_translucent_frag::getShader();
|
||||
auto pixelUnlit = overlay3D_unlit_frag::getShader();
|
||||
auto pixelTranslucentUnlit = overlay3D_translucent_unlit_frag::getShader();
|
||||
auto pixelModel = overlay3D_model_frag::getShader();
|
||||
auto pixelModelTranslucent = overlay3D_model_translucent_frag::getShader();
|
||||
auto pixelModelUnlit = overlay3D_model_unlit_frag::getShader();
|
||||
auto pixelModelTranslucentUnlit = overlay3D_model_translucent_unlit_frag::getShader();
|
||||
|
||||
auto opaqueProgram = gpu::Shader::createProgram(vertex, pixel);
|
||||
auto translucentProgram = gpu::Shader::createProgram(vertex, pixelTranslucent);
|
||||
|
@ -183,60 +183,60 @@ void initOverlay3DPipelines(ShapePlumber& plumber, bool depthTest) {
|
|||
|
||||
void initDeferredPipelines(render::ShapePlumber& plumber, const render::ShapePipeline::BatchSetter& batchSetter, const render::ShapePipeline::ItemSetter& itemSetter) {
|
||||
// Vertex shaders
|
||||
auto simpleVertex = gpu::Shader::createVertex(std::string(simple_vert));
|
||||
auto modelVertex = gpu::Shader::createVertex(std::string(model_vert));
|
||||
auto modelNormalMapVertex = gpu::Shader::createVertex(std::string(model_normal_map_vert));
|
||||
auto modelLightmapVertex = gpu::Shader::createVertex(std::string(model_lightmap_vert));
|
||||
auto modelLightmapNormalMapVertex = gpu::Shader::createVertex(std::string(model_lightmap_normal_map_vert));
|
||||
auto modelShadowVertex = gpu::Shader::createVertex(std::string(model_shadow_vert));
|
||||
auto skinModelVertex = gpu::Shader::createVertex(std::string(skin_model_vert));
|
||||
auto skinModelNormalMapVertex = gpu::Shader::createVertex(std::string(skin_model_normal_map_vert));
|
||||
auto skinModelShadowVertex = gpu::Shader::createVertex(std::string(skin_model_shadow_vert));
|
||||
auto modelLightmapFadeVertex = gpu::Shader::createVertex(std::string(model_lightmap_fade_vert));
|
||||
auto modelLightmapNormalMapFadeVertex = gpu::Shader::createVertex(std::string(model_lightmap_normal_map_fade_vert));
|
||||
auto skinModelFadeVertex = gpu::Shader::createVertex(std::string(skin_model_fade_vert));
|
||||
auto skinModelNormalMapFadeVertex = gpu::Shader::createVertex(std::string(skin_model_normal_map_fade_vert));
|
||||
auto simpleVertex = simple_vert::getShader();
|
||||
auto modelVertex = model_vert::getShader();
|
||||
auto modelNormalMapVertex = model_normal_map_vert::getShader();
|
||||
auto modelLightmapVertex = model_lightmap_vert::getShader();
|
||||
auto modelLightmapNormalMapVertex = model_lightmap_normal_map_vert::getShader();
|
||||
auto modelShadowVertex = model_shadow_vert::getShader();
|
||||
auto skinModelVertex = skin_model_vert::getShader();
|
||||
auto skinModelNormalMapVertex = skin_model_normal_map_vert::getShader();
|
||||
auto skinModelShadowVertex = skin_model_shadow_vert::getShader();
|
||||
auto modelLightmapFadeVertex = model_lightmap_fade_vert::getShader();
|
||||
auto modelLightmapNormalMapFadeVertex = model_lightmap_normal_map_fade_vert::getShader();
|
||||
auto skinModelFadeVertex = skin_model_fade_vert::getShader();
|
||||
auto skinModelNormalMapFadeVertex = skin_model_normal_map_fade_vert::getShader();
|
||||
|
||||
auto modelFadeVertex = gpu::Shader::createVertex(std::string(model_fade_vert));
|
||||
auto modelNormalMapFadeVertex = gpu::Shader::createVertex(std::string(model_normal_map_fade_vert));
|
||||
auto simpleFadeVertex = gpu::Shader::createVertex(std::string(simple_fade_vert));
|
||||
auto modelShadowFadeVertex = gpu::Shader::createVertex(std::string(model_shadow_fade_vert));
|
||||
auto skinModelShadowFadeVertex = gpu::Shader::createVertex(std::string(skin_model_shadow_fade_vert));
|
||||
auto modelFadeVertex = model_fade_vert::getShader();
|
||||
auto modelNormalMapFadeVertex = model_normal_map_fade_vert::getShader();
|
||||
auto simpleFadeVertex = simple_fade_vert::getShader();
|
||||
auto modelShadowFadeVertex = model_shadow_fade_vert::getShader();
|
||||
auto skinModelShadowFadeVertex = skin_model_shadow_fade_vert::getShader();
|
||||
|
||||
// Pixel shaders
|
||||
auto simplePixel = gpu::Shader::createPixel(std::string(simple_textured_frag));
|
||||
auto simpleUnlitPixel = gpu::Shader::createPixel(std::string(simple_textured_unlit_frag));
|
||||
auto simpleTranslucentPixel = gpu::Shader::createPixel(std::string(simple_transparent_textured_frag));
|
||||
auto simpleTranslucentUnlitPixel = gpu::Shader::createPixel(std::string(simple_transparent_textured_unlit_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));
|
||||
auto modelTranslucentPixel = gpu::Shader::createPixel(std::string(model_translucent_frag));
|
||||
auto modelTranslucentUnlitPixel = gpu::Shader::createPixel(std::string(model_translucent_unlit_frag));
|
||||
auto modelShadowPixel = gpu::Shader::createPixel(std::string(model_shadow_frag));
|
||||
auto modelLightmapPixel = gpu::Shader::createPixel(std::string(model_lightmap_frag));
|
||||
auto modelLightmapNormalMapPixel = gpu::Shader::createPixel(std::string(model_lightmap_normal_map_frag));
|
||||
auto modelLightmapSpecularMapPixel = gpu::Shader::createPixel(std::string(model_lightmap_specular_map_frag));
|
||||
auto modelLightmapNormalSpecularMapPixel = gpu::Shader::createPixel(std::string(model_lightmap_normal_specular_map_frag));
|
||||
auto modelLightmapFadePixel = gpu::Shader::createPixel(std::string(model_lightmap_fade_frag));
|
||||
auto modelLightmapNormalMapFadePixel = gpu::Shader::createPixel(std::string(model_lightmap_normal_map_fade_frag));
|
||||
auto modelLightmapSpecularMapFadePixel = gpu::Shader::createPixel(std::string(model_lightmap_specular_map_fade_frag));
|
||||
auto modelLightmapNormalSpecularMapFadePixel = gpu::Shader::createPixel(std::string(model_lightmap_normal_specular_map_fade_frag));
|
||||
auto simplePixel = simple_textured_frag::getShader();
|
||||
auto simpleUnlitPixel = simple_textured_unlit_frag::getShader();
|
||||
auto simpleTranslucentPixel = simple_transparent_textured_frag::getShader();
|
||||
auto simpleTranslucentUnlitPixel = simple_transparent_textured_unlit_frag::getShader();
|
||||
auto modelPixel = model_frag::getShader();
|
||||
auto modelUnlitPixel = model_unlit_frag::getShader();
|
||||
auto modelNormalMapPixel = model_normal_map_frag::getShader();
|
||||
auto modelSpecularMapPixel = model_specular_map_frag::getShader();
|
||||
auto modelNormalSpecularMapPixel = model_normal_specular_map_frag::getShader();
|
||||
auto modelTranslucentPixel = model_translucent_frag::getShader();
|
||||
auto modelTranslucentUnlitPixel = model_translucent_unlit_frag::getShader();
|
||||
auto modelShadowPixel = model_shadow_frag::getShader();
|
||||
auto modelLightmapPixel = model_lightmap_frag::getShader();
|
||||
auto modelLightmapNormalMapPixel = model_lightmap_normal_map_frag::getShader();
|
||||
auto modelLightmapSpecularMapPixel = model_lightmap_specular_map_frag::getShader();
|
||||
auto modelLightmapNormalSpecularMapPixel = model_lightmap_normal_specular_map_frag::getShader();
|
||||
auto modelLightmapFadePixel = model_lightmap_fade_frag::getShader();
|
||||
auto modelLightmapNormalMapFadePixel = model_lightmap_normal_map_fade_frag::getShader();
|
||||
auto modelLightmapSpecularMapFadePixel = model_lightmap_specular_map_fade_frag::getShader();
|
||||
auto modelLightmapNormalSpecularMapFadePixel = model_lightmap_normal_specular_map_fade_frag::getShader();
|
||||
|
||||
auto modelFadePixel = gpu::Shader::createPixel(std::string(model_fade_frag));
|
||||
auto modelUnlitFadePixel = gpu::Shader::createPixel(std::string(model_unlit_fade_frag));
|
||||
auto modelNormalMapFadePixel = gpu::Shader::createPixel(std::string(model_normal_map_fade_frag));
|
||||
auto modelSpecularMapFadePixel = gpu::Shader::createPixel(std::string(model_specular_map_fade_frag));
|
||||
auto modelNormalSpecularMapFadePixel = gpu::Shader::createPixel(std::string(model_normal_specular_map_fade_frag));
|
||||
auto modelShadowFadePixel = gpu::Shader::createPixel(std::string(model_shadow_fade_frag));
|
||||
auto modelTranslucentFadePixel = gpu::Shader::createPixel(std::string(model_translucent_fade_frag));
|
||||
auto modelTranslucentUnlitFadePixel = gpu::Shader::createPixel(std::string(model_translucent_unlit_fade_frag));
|
||||
auto simpleFadePixel = gpu::Shader::createPixel(std::string(simple_textured_fade_frag));
|
||||
auto simpleUnlitFadePixel = gpu::Shader::createPixel(std::string(simple_textured_unlit_fade_frag));
|
||||
auto simpleTranslucentFadePixel = gpu::Shader::createPixel(std::string(simple_transparent_textured_fade_frag));
|
||||
auto simpleTranslucentUnlitFadePixel = gpu::Shader::createPixel(std::string(simple_transparent_textured_unlit_fade_frag));
|
||||
auto modelFadePixel = model_fade_frag::getShader();
|
||||
auto modelUnlitFadePixel = model_unlit_fade_frag::getShader();
|
||||
auto modelNormalMapFadePixel = model_normal_map_fade_frag::getShader();
|
||||
auto modelSpecularMapFadePixel = model_specular_map_fade_frag::getShader();
|
||||
auto modelNormalSpecularMapFadePixel = model_normal_specular_map_fade_frag::getShader();
|
||||
auto modelShadowFadePixel = model_shadow_fade_frag::getShader();
|
||||
auto modelTranslucentFadePixel = model_translucent_fade_frag::getShader();
|
||||
auto modelTranslucentUnlitFadePixel = model_translucent_unlit_fade_frag::getShader();
|
||||
auto simpleFadePixel = simple_textured_fade_frag::getShader();
|
||||
auto simpleUnlitFadePixel = simple_textured_unlit_fade_frag::getShader();
|
||||
auto simpleTranslucentFadePixel = simple_transparent_textured_fade_frag::getShader();
|
||||
auto simpleTranslucentUnlitFadePixel = simple_transparent_textured_unlit_fade_frag::getShader();
|
||||
|
||||
using Key = render::ShapeKey;
|
||||
auto addPipeline = std::bind(&addPlumberPipeline, std::ref(plumber), _1, _2, _3, _4, _5);
|
||||
|
@ -438,17 +438,17 @@ void initDeferredPipelines(render::ShapePlumber& plumber, const render::ShapePip
|
|||
|
||||
void initForwardPipelines(render::ShapePlumber& plumber) {
|
||||
// Vertex shaders
|
||||
auto modelVertex = gpu::Shader::createVertex(std::string(model_vert));
|
||||
auto modelNormalMapVertex = gpu::Shader::createVertex(std::string(model_normal_map_vert));
|
||||
auto skinModelVertex = gpu::Shader::createVertex(std::string(skin_model_vert));
|
||||
auto skinModelNormalMapVertex = gpu::Shader::createVertex(std::string(skin_model_normal_map_vert));
|
||||
auto modelVertex = model_vert::getShader();
|
||||
auto modelNormalMapVertex = model_normal_map_vert::getShader();
|
||||
auto skinModelVertex = skin_model_vert::getShader();
|
||||
auto skinModelNormalMapVertex = skin_model_normal_map_vert::getShader();
|
||||
|
||||
// Pixel shaders
|
||||
auto modelPixel = gpu::Shader::createPixel(std::string(forward_model_frag));
|
||||
auto modelUnlitPixel = gpu::Shader::createPixel(std::string(forward_model_unlit_frag));
|
||||
auto modelNormalMapPixel = gpu::Shader::createPixel(std::string(forward_model_normal_map_frag));
|
||||
auto modelSpecularMapPixel = gpu::Shader::createPixel(std::string(forward_model_specular_map_frag));
|
||||
auto modelNormalSpecularMapPixel = gpu::Shader::createPixel(std::string(forward_model_normal_specular_map_frag));
|
||||
auto modelPixel = forward_model_frag::getShader();
|
||||
auto modelUnlitPixel = forward_model_unlit_frag::getShader();
|
||||
auto modelNormalMapPixel = forward_model_normal_map_frag::getShader();
|
||||
auto modelSpecularMapPixel = forward_model_specular_map_frag::getShader();
|
||||
auto modelNormalSpecularMapPixel = forward_model_normal_specular_map_frag::getShader();
|
||||
|
||||
using Key = render::ShapeKey;
|
||||
auto addPipeline = std::bind(&addPlumberPipeline, std::ref(plumber), _1, _2, _3, nullptr, nullptr);
|
||||
|
@ -574,29 +574,29 @@ void lightBatchSetter(const ShapePipeline& pipeline, gpu::Batch& batch, RenderAr
|
|||
}
|
||||
|
||||
void initZPassPipelines(ShapePlumber& shapePlumber, gpu::StatePointer state) {
|
||||
auto modelVertex = gpu::Shader::createVertex(std::string(model_shadow_vert));
|
||||
auto modelPixel = gpu::Shader::createPixel(std::string(model_shadow_frag));
|
||||
auto modelVertex = model_shadow_vert::getShader();
|
||||
auto modelPixel = model_shadow_frag::getShader();
|
||||
gpu::ShaderPointer modelProgram = gpu::Shader::createProgram(modelVertex, modelPixel);
|
||||
shapePlumber.addPipeline(
|
||||
ShapeKey::Filter::Builder().withoutSkinned().withoutFade(),
|
||||
modelProgram, state);
|
||||
|
||||
auto skinVertex = gpu::Shader::createVertex(std::string(skin_model_shadow_vert));
|
||||
auto skinPixel = gpu::Shader::createPixel(std::string(skin_model_shadow_frag));
|
||||
auto skinVertex = skin_model_shadow_vert::getShader();
|
||||
auto skinPixel = skin_model_shadow_frag::getShader();
|
||||
gpu::ShaderPointer skinProgram = gpu::Shader::createProgram(skinVertex, skinPixel);
|
||||
shapePlumber.addPipeline(
|
||||
ShapeKey::Filter::Builder().withSkinned().withoutFade(),
|
||||
skinProgram, state);
|
||||
|
||||
auto modelFadeVertex = gpu::Shader::createVertex(std::string(model_shadow_fade_vert));
|
||||
auto modelFadePixel = gpu::Shader::createPixel(std::string(model_shadow_fade_frag));
|
||||
auto modelFadeVertex = model_shadow_fade_vert::getShader();
|
||||
auto modelFadePixel = model_shadow_fade_frag::getShader();
|
||||
gpu::ShaderPointer modelFadeProgram = gpu::Shader::createProgram(modelFadeVertex, modelFadePixel);
|
||||
shapePlumber.addPipeline(
|
||||
ShapeKey::Filter::Builder().withoutSkinned().withFade(),
|
||||
modelFadeProgram, state);
|
||||
|
||||
auto skinFadeVertex = gpu::Shader::createVertex(std::string(skin_model_shadow_fade_vert));
|
||||
auto skinFadePixel = gpu::Shader::createPixel(std::string(skin_model_shadow_fade_frag));
|
||||
auto skinFadeVertex = skin_model_shadow_fade_vert::getShader();
|
||||
auto skinFadePixel = skin_model_shadow_fade_frag::getShader();
|
||||
gpu::ShaderPointer skinFadeProgram = gpu::Shader::createProgram(skinFadeVertex, skinFadePixel);
|
||||
shapePlumber.addPipeline(
|
||||
ShapeKey::Filter::Builder().withSkinned().withFade(),
|
||||
|
|
|
@ -60,7 +60,7 @@ gpu::PipelinePointer PrepareStencil::getMeshStencilPipeline() {
|
|||
gpu::PipelinePointer PrepareStencil::getPaintStencilPipeline() {
|
||||
if (!_paintStencilPipeline) {
|
||||
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(stencil_drawMask_frag);
|
||||
auto ps = stencil_drawMask_frag::getShader();
|
||||
auto program = gpu::Shader::createProgram(vs, ps);
|
||||
gpu::Shader::makeProgram((*program));
|
||||
|
||||
|
|
|
@ -308,7 +308,7 @@ void diffuseProfileGPU(gpu::TexturePointer& profileMap, RenderArgs* args) {
|
|||
gpu::PipelinePointer makePipeline;
|
||||
{
|
||||
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(subsurfaceScattering_makeProfile_frag));
|
||||
auto ps = subsurfaceScattering_makeProfile_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
@ -344,7 +344,7 @@ void diffuseScatterGPU(const gpu::TexturePointer& profileMap, gpu::TexturePointe
|
|||
gpu::PipelinePointer makePipeline;
|
||||
{
|
||||
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(subsurfaceScattering_makeLUT_frag));
|
||||
auto ps = subsurfaceScattering_makeLUT_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
@ -382,7 +382,7 @@ void computeSpecularBeckmannGPU(gpu::TexturePointer& beckmannMap, RenderArgs* ar
|
|||
gpu::PipelinePointer makePipeline;
|
||||
{
|
||||
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(subsurfaceScattering_makeSpecularBeckmann_frag));
|
||||
auto ps = subsurfaceScattering_makeSpecularBeckmann_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
@ -457,7 +457,7 @@ void DebugSubsurfaceScattering::configure(const Config& config) {
|
|||
gpu::PipelinePointer DebugSubsurfaceScattering::getScatteringPipeline() {
|
||||
if (!_scatteringPipeline) {
|
||||
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(subsurfaceScattering_drawScattering_frag));
|
||||
auto ps = subsurfaceScattering_drawScattering_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
|
|
@ -212,7 +212,7 @@ void LinearDepthPass::run(const render::RenderContextPointer& renderContext, con
|
|||
const gpu::PipelinePointer& LinearDepthPass::getLinearDepthPipeline() {
|
||||
if (!_linearDepthPipeline) {
|
||||
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(surfaceGeometry_makeLinearDepth_frag);
|
||||
auto ps = surfaceGeometry_makeLinearDepth_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
@ -239,7 +239,7 @@ const gpu::PipelinePointer& LinearDepthPass::getLinearDepthPipeline() {
|
|||
const gpu::PipelinePointer& LinearDepthPass::getDownsamplePipeline() {
|
||||
if (!_downsamplePipeline) {
|
||||
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(surfaceGeometry_downsampleDepthNormal_frag);
|
||||
auto ps = surfaceGeometry_downsampleDepthNormal_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
@ -540,7 +540,7 @@ void SurfaceGeometryPass::run(const render::RenderContextPointer& renderContext,
|
|||
const gpu::PipelinePointer& SurfaceGeometryPass::getCurvaturePipeline() {
|
||||
if (!_curvaturePipeline) {
|
||||
auto vs = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(surfaceGeometry_makeCurvature_frag);
|
||||
auto ps = surfaceGeometry_makeCurvature_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
|
|
@ -28,7 +28,7 @@ ToneMappingEffect::ToneMappingEffect() {
|
|||
}
|
||||
|
||||
void ToneMappingEffect::init() {
|
||||
auto blitPS = gpu::ShaderPointer(gpu::Shader::createPixel(std::string(toneMapping_frag));
|
||||
auto blitPS = toneMapping_frag::getShader();
|
||||
|
||||
auto blitVS = gpu::StandardShaderLib::getDrawViewportQuadTransformTexcoordVS();
|
||||
auto blitProgram = gpu::ShaderPointer(gpu::Shader::createProgram(blitVS, blitPS));
|
||||
|
|
|
@ -78,7 +78,7 @@ void SetupZones::run(const RenderContextPointer& context, const Inputs& inputs)
|
|||
const gpu::PipelinePointer& DebugZoneLighting::getKeyLightPipeline() {
|
||||
if (!_keyLightPipeline) {
|
||||
auto vs = gpu::StandardShaderLib::getDrawTransformUnitQuadVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(zone_drawKeyLight_frag));
|
||||
auto ps = zone_drawKeyLight_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
@ -99,7 +99,7 @@ const gpu::PipelinePointer& DebugZoneLighting::getKeyLightPipeline() {
|
|||
const gpu::PipelinePointer& DebugZoneLighting::getAmbientPipeline() {
|
||||
if (!_ambientPipeline) {
|
||||
auto vs = gpu::StandardShaderLib::getDrawTransformUnitQuadVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(zone_drawAmbient_frag));
|
||||
auto ps = zone_drawAmbient_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
@ -120,7 +120,7 @@ const gpu::PipelinePointer& DebugZoneLighting::getAmbientPipeline() {
|
|||
const gpu::PipelinePointer& DebugZoneLighting::getBackgroundPipeline() {
|
||||
if (!_backgroundPipeline) {
|
||||
auto vs = gpu::StandardShaderLib::getDrawTransformUnitQuadVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(zone_drawSkybox_frag));
|
||||
auto ps = zone_drawSkybox_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
|
|
@ -223,9 +223,9 @@ void Font::setupGPU() {
|
|||
|
||||
// Setup render pipeline
|
||||
{
|
||||
auto vertexShader = gpu::Shader::createVertex(std::string(sdf_text3D_vert));
|
||||
auto pixelShader = gpu::Shader::createPixel(std::string(sdf_text3D_frag));
|
||||
auto pixelShaderTransparent = gpu::Shader::createPixel(std::string(sdf_text3D_transparent_frag));
|
||||
auto vertexShader = sdf_text3D_vert::getShader();
|
||||
auto pixelShader = sdf_text3D_frag::getShader();
|
||||
auto pixelShaderTransparent = sdf_text3D_transparent_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vertexShader, pixelShader);
|
||||
gpu::ShaderPointer programTransparent = gpu::Shader::createProgram(vertexShader, pixelShaderTransparent);
|
||||
|
||||
|
|
|
@ -210,7 +210,7 @@ BlurGaussian::BlurGaussian(bool generateOutputFramebuffer, unsigned int downsamp
|
|||
gpu::PipelinePointer BlurGaussian::getBlurVPipeline() {
|
||||
if (!_blurVPipeline) {
|
||||
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(blurGaussianV_frag));
|
||||
auto ps = blurGaussianV_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
@ -232,7 +232,7 @@ gpu::PipelinePointer BlurGaussian::getBlurVPipeline() {
|
|||
gpu::PipelinePointer BlurGaussian::getBlurHPipeline() {
|
||||
if (!_blurHPipeline) {
|
||||
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(blurGaussianH_frag));
|
||||
auto ps = blurGaussianH_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
@ -324,7 +324,7 @@ BlurGaussianDepthAware::BlurGaussianDepthAware(bool generateOutputFramebuffer, c
|
|||
gpu::PipelinePointer BlurGaussianDepthAware::getBlurVPipeline() {
|
||||
if (!_blurVPipeline) {
|
||||
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(blurGaussianDepthAwareV_frag));
|
||||
auto ps = blurGaussianDepthAwareV_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
@ -347,7 +347,7 @@ gpu::PipelinePointer BlurGaussianDepthAware::getBlurVPipeline() {
|
|||
gpu::PipelinePointer BlurGaussianDepthAware::getBlurHPipeline() {
|
||||
if (!_blurHPipeline) {
|
||||
auto vs = gpu::StandardShaderLib::getDrawUnitQuadTexcoordVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(blurGaussianDepthAwareH_frag));
|
||||
auto ps = blurGaussianDepthAwareH_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
|
|
@ -34,8 +34,8 @@ using namespace render;
|
|||
|
||||
const gpu::PipelinePointer DrawSceneOctree::getDrawCellBoundsPipeline() {
|
||||
if (!_drawCellBoundsPipeline) {
|
||||
auto vs = gpu::Shader::createVertex(std::string(drawCellBounds_vert));
|
||||
auto ps = gpu::Shader::createPixel(std::string(drawCellBounds_frag));
|
||||
auto vs = drawCellBounds_vert::getShader();
|
||||
auto ps = drawCellBounds_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
@ -59,7 +59,7 @@ const gpu::PipelinePointer DrawSceneOctree::getDrawCellBoundsPipeline() {
|
|||
const gpu::PipelinePointer DrawSceneOctree::getDrawLODReticlePipeline() {
|
||||
if (!_drawLODReticlePipeline) {
|
||||
auto vs = gpu::StandardShaderLib::getDrawTransformUnitQuadVS();
|
||||
auto ps = gpu::Shader::createPixel(std::string(drawLODReticle_frag));
|
||||
auto ps = drawLODReticle_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
@ -162,8 +162,8 @@ void DrawSceneOctree::run(const RenderContextPointer& renderContext, const ItemS
|
|||
|
||||
const gpu::PipelinePointer DrawItemSelection::getDrawItemBoundPipeline() {
|
||||
if (!_drawItemBoundPipeline) {
|
||||
auto vs = gpu::Shader::createVertex(std::string(drawItemBounds_vert));
|
||||
auto ps = gpu::Shader::createPixel(std::string(drawItemBounds_frag));
|
||||
auto vs = drawItemBounds_vert::getShader();
|
||||
auto ps = drawItemBounds_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
|
|
@ -35,8 +35,8 @@ void DrawStatusConfig::dirtyHelper() {
|
|||
|
||||
const gpu::PipelinePointer DrawStatus::getDrawItemBoundsPipeline() {
|
||||
if (!_drawItemBoundsPipeline) {
|
||||
auto vs = gpu::Shader::createVertex(std::string(drawItemBounds_vert));
|
||||
auto ps = gpu::Shader::createPixel(std::string(drawItemBounds_frag));
|
||||
auto vs = drawItemBounds_vert::getShader();
|
||||
auto ps = drawItemBounds_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
@ -63,8 +63,8 @@ const gpu::PipelinePointer DrawStatus::getDrawItemBoundsPipeline() {
|
|||
|
||||
const gpu::PipelinePointer DrawStatus::getDrawItemStatusPipeline() {
|
||||
if (!_drawItemStatusPipeline) {
|
||||
auto vs = gpu::Shader::createVertex(std::string(drawItemStatus_vert));
|
||||
auto ps = gpu::Shader::createPixel(std::string(drawItemStatus_frag));
|
||||
auto vs = drawItemStatus_vert::getShader();
|
||||
auto ps = drawItemStatus_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
|
|
@ -155,8 +155,8 @@ void DrawLight::run(const RenderContextPointer& renderContext, const ItemBounds&
|
|||
|
||||
const gpu::PipelinePointer DrawBounds::getPipeline() {
|
||||
if (!_boundsPipeline) {
|
||||
auto vs = gpu::Shader::createVertex(std::string(drawItemBounds_vert));
|
||||
auto ps = gpu::Shader::createPixel(std::string(drawItemBounds_frag));
|
||||
auto vs = drawItemBounds_vert::getShader();
|
||||
auto ps = drawItemBounds_frag::getShader();
|
||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
|
|
@ -23,65 +23,65 @@
|
|||
|
||||
#include <gl/QOpenGLContextWrapper.h>
|
||||
|
||||
#include "simple_vert.h"
|
||||
#include "simple_frag.h"
|
||||
#include "simple_textured_frag.h"
|
||||
#include "simple_textured_unlit_frag.h"
|
||||
#include "render-utils/simple_vert.h"
|
||||
#include "render-utils/simple_frag.h"
|
||||
#include "render-utils/simple_textured_frag.h"
|
||||
#include "render-utils/simple_textured_unlit_frag.h"
|
||||
|
||||
#include "deferred_light_vert.h"
|
||||
#include "deferred_light_point_vert.h"
|
||||
#include "deferred_light_spot_vert.h"
|
||||
#include "render-utils/deferred_light_vert.h"
|
||||
#include "render-utils/deferred_light_point_vert.h"
|
||||
#include "render-utils/deferred_light_spot_vert.h"
|
||||
|
||||
#include "directional_ambient_light_frag.h"
|
||||
#include "directional_skybox_light_frag.h"
|
||||
#include "render-utils/directional_ambient_light_frag.h"
|
||||
#include "render-utils/directional_skybox_light_frag.h"
|
||||
|
||||
#include "standardTransformPNTC_vert.h"
|
||||
#include "standardDrawTexture_frag.h"
|
||||
#include "render-utils/standardTransformPNTC_vert.h"
|
||||
#include "render-utils/standardDrawTexture_frag.h"
|
||||
|
||||
#include "model_vert.h"
|
||||
#include "model_shadow_vert.h"
|
||||
#include "model_normal_map_vert.h"
|
||||
#include "model_lightmap_vert.h"
|
||||
#include "model_lightmap_normal_map_vert.h"
|
||||
#include "skin_model_vert.h"
|
||||
#include "skin_model_shadow_vert.h"
|
||||
#include "skin_model_normal_map_vert.h"
|
||||
#include "render-utils/model_vert.h"
|
||||
#include "render-utils/model_shadow_vert.h"
|
||||
#include "render-utils/model_normal_map_vert.h"
|
||||
#include "render-utils/model_lightmap_vert.h"
|
||||
#include "render-utils/model_lightmap_normal_map_vert.h"
|
||||
#include "render-utils/skin_model_vert.h"
|
||||
#include "render-utils/skin_model_shadow_vert.h"
|
||||
#include "render-utils/skin_model_normal_map_vert.h"
|
||||
|
||||
#include "model_frag.h"
|
||||
#include "model_shadow_frag.h"
|
||||
#include "model_normal_map_frag.h"
|
||||
#include "model_normal_specular_map_frag.h"
|
||||
#include "model_specular_map_frag.h"
|
||||
#include "model_lightmap_frag.h"
|
||||
#include "model_lightmap_normal_map_frag.h"
|
||||
#include "model_lightmap_normal_specular_map_frag.h"
|
||||
#include "model_lightmap_specular_map_frag.h"
|
||||
#include "model_translucent_frag.h"
|
||||
#include "render-utils/model_frag.h"
|
||||
#include "render-utils/model_shadow_frag.h"
|
||||
#include "render-utils/model_normal_map_frag.h"
|
||||
#include "render-utils/model_normal_specular_map_frag.h"
|
||||
#include "render-utils/model_specular_map_frag.h"
|
||||
#include "render-utils/model_lightmap_frag.h"
|
||||
#include "render-utils/model_lightmap_normal_map_frag.h"
|
||||
#include "render-utils/model_lightmap_normal_specular_map_frag.h"
|
||||
#include "render-utils/model_lightmap_specular_map_frag.h"
|
||||
#include "render-utils/model_translucent_frag.h"
|
||||
|
||||
#include "textured_particle_frag.h"
|
||||
#include "textured_particle_vert.h"
|
||||
#include "entities-renderer/textured_particle_frag.h"
|
||||
#include "entities-renderer/textured_particle_vert.h"
|
||||
|
||||
#include "overlay3D_vert.h"
|
||||
#include "overlay3D_frag.h"
|
||||
#include "render-utils/overlay3D_vert.h"
|
||||
#include "render-utils/overlay3D_frag.h"
|
||||
|
||||
#include "skybox_vert.h"
|
||||
#include "skybox_frag.h"
|
||||
#include "model/skybox_vert.h"
|
||||
#include "model/skybox_frag.h"
|
||||
|
||||
#include "DrawTransformUnitQuad_vert.h"
|
||||
#include "DrawTexcoordRectTransformUnitQuad_vert.h"
|
||||
#include "DrawViewportQuadTransformTexcoord_vert.h"
|
||||
#include "DrawTexture_frag.h"
|
||||
#include "DrawTextureOpaque_frag.h"
|
||||
#include "DrawColoredTexture_frag.h"
|
||||
#include "gpu/DrawTransformUnitQuad_vert.h"
|
||||
#include "gpu/DrawTexcoordRectTransformUnitQuad_vert.h"
|
||||
#include "gpu/DrawViewportQuadTransformTexcoord_vert.h"
|
||||
#include "gpu/DrawTexture_frag.h"
|
||||
#include "gpu/DrawTextureOpaque_frag.h"
|
||||
#include "gpu/DrawColoredTexture_frag.h"
|
||||
|
||||
#include "sdf_text3D_vert.h"
|
||||
#include "sdf_text3D_frag.h"
|
||||
#include "render-utils/sdf_text3D_vert.h"
|
||||
#include "render-utils/sdf_text3D_frag.h"
|
||||
|
||||
#include "paintStroke_vert.h"
|
||||
#include "paintStroke_frag.h"
|
||||
#include "entities-renderer/paintStroke_vert.h"
|
||||
#include "entities-renderer/paintStroke_frag.h"
|
||||
|
||||
#include "polyvox_vert.h"
|
||||
#include "polyvox_frag.h"
|
||||
#include "entities-renderer/polyvox_vert.h"
|
||||
#include "entities-renderer/polyvox_frag.h"
|
||||
|
||||
// Create a simple OpenGL window that renders text in various ways
|
||||
class QTestWindow : public QWindow {
|
||||
|
@ -159,54 +159,54 @@ void QTestWindow::draw() {
|
|||
|
||||
static std::once_flag once;
|
||||
std::call_once(once, [&]{
|
||||
testShaderBuild(sdf_text3D_vert, sdf_text3D_frag.h";
|
||||
testShaderBuild(sdf_text3D_vert::getSource(), sdf_text3D_frag::getSource());
|
||||
|
||||
testShaderBuild(DrawTransformUnitQuad_vert, DrawTexture_frag.h";
|
||||
testShaderBuild(DrawTexcoordRectTransformUnitQuad_vert, DrawTexture_frag.h";
|
||||
testShaderBuild(DrawViewportQuadTransformTexcoord_vert, DrawTexture_frag.h";
|
||||
testShaderBuild(DrawTransformUnitQuad_vert, DrawTextureOpaque_frag.h";
|
||||
testShaderBuild(DrawTransformUnitQuad_vert, DrawColoredTexture_frag.h";
|
||||
testShaderBuild(DrawTransformUnitQuad_vert::getSource(), DrawTexture_frag::getSource());
|
||||
testShaderBuild(DrawTexcoordRectTransformUnitQuad_vert::getSource(), DrawTexture_frag::getSource());
|
||||
testShaderBuild(DrawViewportQuadTransformTexcoord_vert::getSource(), DrawTexture_frag::getSource());
|
||||
testShaderBuild(DrawTransformUnitQuad_vert::getSource(), DrawTextureOpaque_frag::getSource());
|
||||
testShaderBuild(DrawTransformUnitQuad_vert::getSource(), DrawColoredTexture_frag::getSource());
|
||||
|
||||
testShaderBuild(skybox_vert, skybox_frag.h";
|
||||
testShaderBuild(simple_vert, simple_frag.h";
|
||||
testShaderBuild(simple_vert, simple_textured_frag.h";
|
||||
testShaderBuild(simple_vert, simple_textured_unlit_frag.h";
|
||||
testShaderBuild(deferred_light_vert, directional_ambient_light_frag.h";
|
||||
testShaderBuild(deferred_light_vert, directional_skybox_light_frag.h";
|
||||
testShaderBuild(standardTransformPNTC_vert, standardDrawTexture_frag.h";
|
||||
testShaderBuild(standardTransformPNTC_vert, DrawTextureOpaque_frag.h";
|
||||
testShaderBuild(skybox_vert::getSource(), skybox_frag::getSource());
|
||||
testShaderBuild(simple_vert::getSource(), simple_frag::getSource());
|
||||
testShaderBuild(simple_vert::getSource(), simple_textured_frag::getSource());
|
||||
testShaderBuild(simple_vert::getSource(), simple_textured_unlit_frag::getSource());
|
||||
testShaderBuild(deferred_light_vert::getSource(), directional_ambient_light_frag::getSource());
|
||||
testShaderBuild(deferred_light_vert::getSource(), directional_skybox_light_frag::getSource());
|
||||
testShaderBuild(standardTransformPNTC_vert::getSource(), standardDrawTexture_frag::getSource());
|
||||
testShaderBuild(standardTransformPNTC_vert::getSource(), DrawTextureOpaque_frag::getSource());
|
||||
|
||||
testShaderBuild(model_vert, model_frag.h";
|
||||
testShaderBuild(model_normal_map_vert, model_normal_map_frag.h";
|
||||
testShaderBuild(model_vert, model_specular_map_frag.h";
|
||||
testShaderBuild(model_normal_map_vert, model_normal_specular_map_frag.h";
|
||||
testShaderBuild(model_vert, model_translucent_frag.h";
|
||||
testShaderBuild(model_normal_map_vert, model_translucent_frag.h";
|
||||
testShaderBuild(model_lightmap_vert, model_lightmap_frag.h";
|
||||
testShaderBuild(model_lightmap_normal_map_vert, model_lightmap_normal_map_frag.h";
|
||||
testShaderBuild(model_lightmap_vert, model_lightmap_specular_map_frag.h";
|
||||
testShaderBuild(model_lightmap_normal_map_vert, model_lightmap_normal_specular_map_frag.h";
|
||||
testShaderBuild(model_vert::getSource(), model_frag::getSource());
|
||||
testShaderBuild(model_normal_map_vert::getSource(), model_normal_map_frag::getSource());
|
||||
testShaderBuild(model_vert::getSource(), model_specular_map_frag::getSource());
|
||||
testShaderBuild(model_normal_map_vert::getSource(), model_normal_specular_map_frag::getSource());
|
||||
testShaderBuild(model_vert::getSource(), model_translucent_frag::getSource());
|
||||
testShaderBuild(model_normal_map_vert::getSource(), model_translucent_frag::getSource());
|
||||
testShaderBuild(model_lightmap_vert::getSource(), model_lightmap_frag::getSource());
|
||||
testShaderBuild(model_lightmap_normal_map_vert::getSource(), model_lightmap_normal_map_frag::getSource());
|
||||
testShaderBuild(model_lightmap_vert::getSource(), model_lightmap_specular_map_frag::getSource());
|
||||
testShaderBuild(model_lightmap_normal_map_vert::getSource(), model_lightmap_normal_specular_map_frag::getSource());
|
||||
|
||||
testShaderBuild(skin_model_vert, model_frag.h";
|
||||
testShaderBuild(skin_model_normal_map_vert, model_normal_map_frag.h";
|
||||
testShaderBuild(skin_model_vert, model_specular_map_frag.h";
|
||||
testShaderBuild(skin_model_normal_map_vert, model_normal_specular_map_frag.h";
|
||||
testShaderBuild(skin_model_vert, model_translucent_frag.h";
|
||||
testShaderBuild(skin_model_normal_map_vert, model_translucent_frag.h";
|
||||
testShaderBuild(skin_model_vert::getSource(), model_frag::getSource());
|
||||
testShaderBuild(skin_model_normal_map_vert::getSource(), model_normal_map_frag::getSource());
|
||||
testShaderBuild(skin_model_vert::getSource(), model_specular_map_frag::getSource());
|
||||
testShaderBuild(skin_model_normal_map_vert::getSource(), model_normal_specular_map_frag::getSource());
|
||||
testShaderBuild(skin_model_vert::getSource(), model_translucent_frag::getSource());
|
||||
testShaderBuild(skin_model_normal_map_vert::getSource(), model_translucent_frag::getSource());
|
||||
|
||||
testShaderBuild(model_shadow_vert, model_shadow_frag.h";
|
||||
testShaderBuild(textured_particle_vert, textured_particle_frag.h";
|
||||
testShaderBuild(model_shadow_vert::getSource(), model_shadow_frag::getSource());
|
||||
testShaderBuild(textured_particle_vert::getSource(), textured_particle_frag::getSource());
|
||||
/* FIXME: Bring back the ssao shader tests
|
||||
testShaderBuild(gaussian_blur_vertical_vert, gaussian_blur_frag.h";
|
||||
testShaderBuild(gaussian_blur_horizontal_vert, gaussian_blur_frag.h";
|
||||
testShaderBuild(ambient_occlusion_vert, ambient_occlusion_frag.h";
|
||||
testShaderBuild(ambient_occlusion_vert, occlusion_blend_frag.h";
|
||||
testShaderBuild(gaussian_blur_vert::getSource()ical_vert::getSource(), gaussian_blur_frag::getSource());
|
||||
testShaderBuild(gaussian_blur_horizontal_vert::getSource(), gaussian_blur_frag::getSource());
|
||||
testShaderBuild(ambient_occlusion_vert::getSource(), ambient_occlusion_frag::getSource());
|
||||
testShaderBuild(ambient_occlusion_vert::getSource(), occlusion_blend_frag::getSource());
|
||||
*/
|
||||
|
||||
testShaderBuild(overlay3D_vert, overlay3D_frag.h";
|
||||
testShaderBuild(overlay3D_vert::getSource(), overlay3D_frag::getSource());
|
||||
|
||||
testShaderBuild(paintStroke_vert,paintStroke_frag.h";
|
||||
testShaderBuild(polyvox_vert, polyvox_frag.h";
|
||||
testShaderBuild(paintStroke_vert::getSource(),paintStroke_frag::getSource());
|
||||
testShaderBuild(polyvox_vert::getSource(), polyvox_frag::getSource());
|
||||
|
||||
});
|
||||
_context.swapBuffers(this);
|
||||
|
|
|
@ -184,7 +184,7 @@ int main (int argc, char** argv) {
|
|||
srcStream.open(srcFilename, std::fstream::in);
|
||||
if (!srcStream.is_open()) {
|
||||
cerr << "Failed to open source file <" << srcFilename << ">" << endl;
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto scribe = std::make_shared<TextTemplate>(srcFilename, config);
|
||||
|
@ -194,7 +194,7 @@ int main (int argc, char** argv) {
|
|||
int numErrors = scribe->scribe(destStringStream, srcStream, vars);
|
||||
if (numErrors) {
|
||||
cerr << "Scribe " << srcFilename << "> failed: " << numErrors << " errors." << endl;
|
||||
return 0;
|
||||
return 1;
|
||||
};
|
||||
|
||||
|
||||
|
@ -279,7 +279,7 @@ int main (int argc, char** argv) {
|
|||
headerFile << headerStringStream.str();
|
||||
} else {
|
||||
cerr << "Scribe output file <" << headerFileName << "> failed to open." << endl;
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
cerr << sourceStringStream.str();
|
||||
|
@ -310,7 +310,7 @@ int main (int argc, char** argv) {
|
|||
sourceFile.open(sourceFileName, std::fstream::out);
|
||||
if (!sourceFile.is_open()) {
|
||||
cerr << "Scribe output file <" << sourceFileName << "> failed to open." << endl;
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
sourceFile << sourceStringStream.str();
|
||||
} else {
|
||||
|
@ -323,7 +323,7 @@ int main (int argc, char** argv) {
|
|||
destFileStream.open(destFilename, std::fstream::out);
|
||||
if (!destFileStream.is_open()) {
|
||||
cerr << "Scribe output file <" << destFilename << "> failed to open." << endl;
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
destFileStream << destStringStream.str();
|
||||
|
|
Loading…
Reference in a new issue