mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 12:57:59 +02:00
more stuff fixed
This commit is contained in:
parent
bf85034f36
commit
02be965271
5 changed files with 27 additions and 23 deletions
|
@ -21,6 +21,7 @@
|
||||||
ProceduralSkybox::ProceduralSkybox() : graphics::Skybox() {
|
ProceduralSkybox::ProceduralSkybox() : graphics::Skybox() {
|
||||||
_procedural._vertexSource = skybox_vert::getSource();
|
_procedural._vertexSource = skybox_vert::getSource();
|
||||||
_procedural._opaquefragmentSource = skybox_frag::getSource();
|
_procedural._opaquefragmentSource = skybox_frag::getSource();
|
||||||
|
_procedural._transparentfragmentSource = skybox_frag::getSource();
|
||||||
// Adjust the pipeline state for background using the stencil test
|
// Adjust the pipeline state for background using the stencil test
|
||||||
_procedural.setDoesFade(false);
|
_procedural.setDoesFade(false);
|
||||||
// Must match PrepareStencil::STENCIL_BACKGROUND
|
// Must match PrepareStencil::STENCIL_BACKGROUND
|
||||||
|
@ -60,9 +61,13 @@ void ProceduralSkybox::render(gpu::Batch& batch, const ViewFrustum& viewFrustum,
|
||||||
batch.setModelTransform(Transform()); // only for Mac
|
batch.setModelTransform(Transform()); // only for Mac
|
||||||
|
|
||||||
auto& procedural = skybox._procedural;
|
auto& procedural = skybox._procedural;
|
||||||
procedural.prepare(batch, glm::vec3(0), glm::vec3(1), glm::quat());
|
|
||||||
|
// procedural.prepare(batch, glm::vec3(0), glm::vec3(1), glm::quat());
|
||||||
|
procedural.prepare(batch, glm::vec3(0), glm::vec3(1), glm::quat(), glm::vec4(glm::vec3(1.0f), 0.9));
|
||||||
|
|
||||||
auto textureSlot = procedural.getOpaqueShader()->getTextures().findLocation("cubeMap");
|
auto textureSlot = procedural.getOpaqueShader()->getTextures().findLocation("cubeMap");
|
||||||
auto bufferSlot = procedural.getOpaqueShader()->getUniformBuffers().findLocation("skyboxBuffer");
|
auto bufferSlot = procedural.getOpaqueShader()->getUniformBuffers().findLocation("skyboxBuffer");
|
||||||
|
|
||||||
skybox.prepare(batch, textureSlot, bufferSlot);
|
skybox.prepare(batch, textureSlot, bufferSlot);
|
||||||
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,8 +36,7 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Engine::Engine() : Task(EngineTask::JobModel::create("Engine")),
|
Engine::Engine() : _Engine(EngineTask::JobModel::create("Engine"), std::make_shared<RenderContext>())
|
||||||
_renderContext(std::make_shared<RenderContext>())
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,9 @@ namespace render {
|
||||||
// The render engine holds all render tasks, and is itself a render task.
|
// The render engine holds all render tasks, and is itself a render task.
|
||||||
// State flows through tasks to jobs via the render and scene contexts -
|
// State flows through tasks to jobs via the render and scene contexts -
|
||||||
// the engine should not be known from its jobs.
|
// the engine should not be known from its jobs.
|
||||||
class Engine : public Task {
|
class Engine : public _Engine {
|
||||||
|
|
||||||
|
//class Engine : public Task {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Engine();
|
Engine();
|
||||||
|
@ -93,19 +95,19 @@ namespace render {
|
||||||
void load();
|
void load();
|
||||||
|
|
||||||
// Register the scene
|
// Register the scene
|
||||||
void registerScene(const ScenePointer& scene) { _renderContext->_scene = scene; }
|
void registerScene(const ScenePointer& scene) { _context->_scene = scene; }
|
||||||
|
|
||||||
// acces the RenderContext
|
// acces the RenderContext
|
||||||
RenderContextPointer getRenderContext() const { return _renderContext; }
|
RenderContextPointer getRenderContext() const { return _context; }
|
||||||
|
|
||||||
// Render a frame
|
// Render a frame
|
||||||
// Must have a scene registered and a context set
|
// Must have a scene registered and a context set
|
||||||
void run() { assert(_renderContext); Task::run(_renderContext); }
|
// void run() { assert(_renderContext); Task::run(_renderContext); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
RenderContextPointer _renderContext;
|
// RenderContextPointer _renderContext;
|
||||||
|
|
||||||
void run(const RenderContextPointer& context) override { assert(_renderContext); Task::run(_renderContext); }
|
// void run(const RenderContextPointer& context) override { assert(_renderContext); Task::run(_renderContext); }
|
||||||
};
|
};
|
||||||
using EnginePointer = std::shared_ptr<Engine>;
|
using EnginePointer = std::shared_ptr<Engine>;
|
||||||
|
|
||||||
|
|
|
@ -379,7 +379,7 @@ public:
|
||||||
using TaskType = Task<JC, TP>;
|
using TaskType = Task<JC, TP>;
|
||||||
using ConceptPointer = typename TaskType::ConceptPointer;
|
using ConceptPointer = typename TaskType::ConceptPointer;
|
||||||
|
|
||||||
Engine(ConceptPointer concept) : TaskType(concept) {}
|
Engine(const ConceptPointer& concept, const ContextPointer& context) : TaskType(concept), _context(context) {}
|
||||||
~Engine() = default;
|
~Engine() = default;
|
||||||
|
|
||||||
void reset(const ContextPointer& context) { _context = context; }
|
void reset(const ContextPointer& context) { _context = context; }
|
||||||
|
|
|
@ -20,7 +20,7 @@ import "../jet.js" as Jet
|
||||||
Rectangle {
|
Rectangle {
|
||||||
HifiConstants { id: hifi;}
|
HifiConstants { id: hifi;}
|
||||||
color: hifi.colors.baseGray;
|
color: hifi.colors.baseGray;
|
||||||
id: root
|
id: root;
|
||||||
|
|
||||||
// width: parent ? parent.width : 200
|
// width: parent ? parent.width : 200
|
||||||
// height: parent ? parent.height : 400
|
// height: parent ? parent.height : 400
|
||||||
|
@ -29,11 +29,7 @@ Rectangle {
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
var message = ""
|
var message = ""
|
||||||
// functor = Jet.job_print_functor(function (line) { message += line + "\n"; }, false);
|
var maxDepth = 3;
|
||||||
|
|
||||||
// functor = Jet.job_list_functor(root.myArray);
|
|
||||||
|
|
||||||
var maxDepth = 4;
|
|
||||||
|
|
||||||
var jobTreePath = []
|
var jobTreePath = []
|
||||||
var jobsRoot;
|
var jobsRoot;
|
||||||
|
@ -72,6 +68,7 @@ Rectangle {
|
||||||
Jet.task_traverseTree(rootConfig, functor);
|
Jet.task_traverseTree(rootConfig, functor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ListModel {
|
ListModel {
|
||||||
id: jobsModel
|
id: jobsModel
|
||||||
}
|
}
|
||||||
|
@ -101,7 +98,7 @@ Rectangle {
|
||||||
property var config: root.rootConfig.getConfig(model.path + "." + model.name);
|
property var config: root.rootConfig.getConfig(model.path + "." + model.name);
|
||||||
text: (objRecursiveColumn.children.length > 2 ?
|
text: (objRecursiveColumn.children.length > 2 ?
|
||||||
objRecursiveColumn.children[1].visible ?
|
objRecursiveColumn.children[1].visible ?
|
||||||
qsTr("- ") : qsTr("+ ") : qsTr(" ")) + model.name + " ms=" + config.cpuRunTime.toFixed(3)
|
qsTr("- ") : qsTr("+ ") : qsTr(" ")) + model.name + " ms=" + config.cpuRunTime.toFixed(2)
|
||||||
checked: config.enabled
|
checked: config.enabled
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -113,11 +110,12 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ListView {
|
Original.ScrollView {
|
||||||
id: theView
|
anchors.fill: parent
|
||||||
anchors.fill: parent
|
ListView {
|
||||||
model: jobsModel
|
id: theView
|
||||||
delegate: objRecursiveDelegate
|
model: jobsModel
|
||||||
|
delegate: objRecursiveDelegate
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue