mirror of
https://github.com/overte-org/overte.git
synced 2025-07-10 22:58:43 +02:00
Merge pull request #13766 from SamGondelman/shaders
Miscellaneous shader fixes
This commit is contained in:
commit
16b483b338
16 changed files with 129 additions and 269 deletions
|
@ -35,9 +35,7 @@ ShapeEntityRenderer::ShapeEntityRenderer(const EntityItemPointer& entity) : Pare
|
||||||
_procedural._vertexSource = gpu::Shader::getVertexShaderSource(shader::render_utils::vertex::simple);
|
_procedural._vertexSource = gpu::Shader::getVertexShaderSource(shader::render_utils::vertex::simple);
|
||||||
// FIXME: Setup proper uniform slots and use correct pipelines for forward rendering
|
// FIXME: Setup proper uniform slots and use correct pipelines for forward rendering
|
||||||
_procedural._opaquefragmentSource = gpu::Shader::getFragmentShaderSource(shader::render_utils::fragment::simple);
|
_procedural._opaquefragmentSource = gpu::Shader::getFragmentShaderSource(shader::render_utils::fragment::simple);
|
||||||
// FIXME: Transparent procedural entities only seem to work if they use the opaque pipelines
|
_procedural._transparentfragmentSource = gpu::Shader::getFragmentShaderSource(shader::render_utils::fragment::simple_transparent);
|
||||||
//_procedural._transparentfragmentSource = simple_transparent_frag::getSource();
|
|
||||||
_procedural._transparentfragmentSource = _procedural._opaquefragmentSource;
|
|
||||||
_procedural._opaqueState->setCullMode(gpu::State::CULL_NONE);
|
_procedural._opaqueState->setCullMode(gpu::State::CULL_NONE);
|
||||||
_procedural._opaqueState->setDepthTest(true, true, gpu::LESS_EQUAL);
|
_procedural._opaqueState->setDepthTest(true, true, gpu::LESS_EQUAL);
|
||||||
PrepareStencil::testMaskDrawShape(*_procedural._opaqueState);
|
PrepareStencil::testMaskDrawShape(*_procedural._opaqueState);
|
||||||
|
|
|
@ -149,7 +149,7 @@ void main(void) {
|
||||||
vec3 UP = vec3(0, 1, 0);
|
vec3 UP = vec3(0, 1, 0);
|
||||||
vec3 modelUpWorld;
|
vec3 modelUpWorld;
|
||||||
<$transformModelToWorldDir(cam, obj, UP, modelUpWorld)$>
|
<$transformModelToWorldDir(cam, obj, UP, modelUpWorld)$>
|
||||||
vec3 upWorld = mix(UP, normalize(modelUpWorld), particle.rotateWithEntity);
|
vec3 upWorld = mix(UP, normalize(modelUpWorld), float(particle.rotateWithEntity));
|
||||||
vec3 upEye = normalize(view3 * upWorld);
|
vec3 upEye = normalize(view3 * upWorld);
|
||||||
vec3 FORWARD = vec3(0, 0, -1);
|
vec3 FORWARD = vec3(0, 0, -1);
|
||||||
vec3 particleRight = normalize(cross(FORWARD, upEye));
|
vec3 particleRight = normalize(cross(FORWARD, upEye));
|
||||||
|
|
|
@ -39,7 +39,4 @@ void main(void) {
|
||||||
// Procedural Shaders are expected to be Gamma corrected so let's bring back the RGB in linear space for the rest of the pipeline
|
// Procedural Shaders are expected to be Gamma corrected so let's bring back the RGB in linear space for the rest of the pipeline
|
||||||
color = pow(color, vec3(2.2));
|
color = pow(color, vec3(2.2));
|
||||||
_fragColor = vec4(color, 0.0);
|
_fragColor = vec4(color, 0.0);
|
||||||
|
|
||||||
// FIXME: scribe does not yet scrub out else statements
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,9 +51,9 @@ void main(void) {
|
||||||
#ifdef PROCEDURAL
|
#ifdef PROCEDURAL
|
||||||
|
|
||||||
#ifdef PROCEDURAL_V1
|
#ifdef PROCEDURAL_V1
|
||||||
specular = getProceduralColor().rgb;
|
diffuse = getProceduralColor().rgb;
|
||||||
// Procedural Shaders are expected to be Gamma corrected so let's bring back the RGB in linear space for the rest of the pipeline
|
// Procedural Shaders are expected to be Gamma corrected so let's bring back the RGB in linear space for the rest of the pipeline
|
||||||
//specular = pow(specular, vec3(2.2));
|
//diffuse = pow(diffuse, vec3(2.2));
|
||||||
emissiveAmount = 1.0;
|
emissiveAmount = 1.0;
|
||||||
#else
|
#else
|
||||||
emissiveAmount = getProceduralColors(diffuse, specular, shininess);
|
emissiveAmount = getProceduralColors(diffuse, specular, shininess);
|
||||||
|
|
|
@ -1,93 +0,0 @@
|
||||||
<@include gpu/Config.slh@>
|
|
||||||
<$VERSION_HEADER$>
|
|
||||||
// Generated on <$_SCRIBE_DATE$>
|
|
||||||
//
|
|
||||||
// forward_simple_transparent.frag
|
|
||||||
// fragment shader
|
|
||||||
//
|
|
||||||
// Created by Andrzej Kapolka on 9/15/14.
|
|
||||||
// Copyright 2014 High Fidelity, Inc.
|
|
||||||
//
|
|
||||||
// Distributed under the Apache License, Version 2.0.
|
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
||||||
//
|
|
||||||
<@include DefaultMaterials.slh@>
|
|
||||||
|
|
||||||
<@include ForwardGlobalLight.slh@>
|
|
||||||
<$declareEvalGlobalLightingAlphaBlended()$>
|
|
||||||
|
|
||||||
// the interpolated normal
|
|
||||||
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
|
|
||||||
layout(location=RENDER_UTILS_ATTR_NORMAL_MS) in vec3 _normalMS;
|
|
||||||
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;
|
|
||||||
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
|
|
||||||
#define _texCoord0 _texCoord01.xy
|
|
||||||
#define _texCoord1 _texCoord01.zw
|
|
||||||
layout(location=RENDER_UTILS_ATTR_POSITION_MS) in vec4 _positionMS;
|
|
||||||
layout(location=RENDER_UTILS_ATTR_POSITION_ES) in vec4 _positionES;
|
|
||||||
|
|
||||||
// For retro-compatibility
|
|
||||||
#define _normal _normalWS
|
|
||||||
#define _modelNormal _normalMS
|
|
||||||
#define _position _positionMS
|
|
||||||
#define _eyePosition _positionES
|
|
||||||
|
|
||||||
layout(location=0) out vec4 _fragColor0;
|
|
||||||
|
|
||||||
//PROCEDURAL_COMMON_BLOCK
|
|
||||||
|
|
||||||
#line 1001
|
|
||||||
//PROCEDURAL_BLOCK
|
|
||||||
|
|
||||||
#line 2030
|
|
||||||
void main(void) {
|
|
||||||
vec3 normal = normalize(_normalWS.xyz);
|
|
||||||
vec3 diffuse = _color.rgb;
|
|
||||||
vec3 specular = DEFAULT_SPECULAR;
|
|
||||||
float shininess = DEFAULT_SHININESS;
|
|
||||||
float emissiveAmount = 0.0;
|
|
||||||
|
|
||||||
#ifdef PROCEDURAL
|
|
||||||
|
|
||||||
#ifdef PROCEDURAL_V1
|
|
||||||
specular = getProceduralColor().rgb;
|
|
||||||
// Procedural Shaders are expected to be Gamma corrected so let's bring back the RGB in linear space for the rest of the pipeline
|
|
||||||
//specular = pow(specular, vec3(2.2));
|
|
||||||
emissiveAmount = 1.0;
|
|
||||||
#else
|
|
||||||
emissiveAmount = getProceduralColors(diffuse, specular, shininess);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
TransformCamera cam = getTransformCamera();
|
|
||||||
vec3 fragPosition = _positionES.xyz;
|
|
||||||
|
|
||||||
if (emissiveAmount > 0.0) {
|
|
||||||
_fragColor0 = vec4(evalGlobalLightingAlphaBlendedWithHaze(
|
|
||||||
cam._viewInverse,
|
|
||||||
1.0,
|
|
||||||
DEFAULT_OCCLUSION,
|
|
||||||
fragPosition,
|
|
||||||
normal,
|
|
||||||
specular,
|
|
||||||
DEFAULT_FRESNEL,
|
|
||||||
DEFAULT_METALLIC,
|
|
||||||
DEFAULT_EMISSIVE,
|
|
||||||
DEFAULT_ROUGHNESS, _color.a),
|
|
||||||
_color.a);
|
|
||||||
} else {
|
|
||||||
_fragColor0 = vec4(evalGlobalLightingAlphaBlendedWithHaze(
|
|
||||||
cam._viewInverse,
|
|
||||||
1.0,
|
|
||||||
DEFAULT_OCCLUSION,
|
|
||||||
fragPosition,
|
|
||||||
normal,
|
|
||||||
diffuse,
|
|
||||||
DEFAULT_FRESNEL,
|
|
||||||
DEFAULT_METALLIC,
|
|
||||||
DEFAULT_EMISSIVE,
|
|
||||||
DEFAULT_ROUGHNESS, _color.a),
|
|
||||||
_color.a);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -12,7 +12,7 @@
|
||||||
<@include gpu/Transform.slh@>
|
<@include gpu/Transform.slh@>
|
||||||
<$declareStandardTransform()$>
|
<$declareStandardTransform()$>
|
||||||
|
|
||||||
layout(std140, binding=0) uniform parabolaData {
|
struct ParabolaData {
|
||||||
vec3 velocity;
|
vec3 velocity;
|
||||||
float parabolicDistance;
|
float parabolicDistance;
|
||||||
vec3 acceleration;
|
vec3 acceleration;
|
||||||
|
@ -20,34 +20,38 @@ layout(std140, binding=0) uniform parabolaData {
|
||||||
vec4 color;
|
vec4 color;
|
||||||
int numSections;
|
int numSections;
|
||||||
ivec3 spare;
|
ivec3 spare;
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(std140, binding=0) uniform parabolaData {
|
||||||
|
ParabolaData _parabolaData;
|
||||||
};
|
};
|
||||||
|
|
||||||
layout(location=0) out vec4 _color;
|
layout(location=0) out vec4 _color;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
_color = color;
|
_color = _parabolaData.color;
|
||||||
|
|
||||||
float t = parabolicDistance * (float(gl_VertexID / 2) / float(numSections));
|
float t = _parabolaData.parabolicDistance * (float(gl_VertexID / 2) / float(_parabolaData.numSections));
|
||||||
|
|
||||||
vec4 pos = vec4(velocity * t + 0.5 * acceleration * t * t, 1);
|
vec4 pos = vec4(_parabolaData.velocity * t + 0.5 * _parabolaData.acceleration * t * t, 1);
|
||||||
const float EPSILON = 0.00001;
|
const float EPSILON = 0.00001;
|
||||||
vec4 normal;
|
vec4 normal;
|
||||||
|
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
TransformObject obj = getTransformObject();
|
TransformObject obj = getTransformObject();
|
||||||
if (dot(acceleration, acceleration) < EPSILON) {
|
if (dot(_parabolaData.acceleration, _parabolaData.acceleration) < EPSILON) {
|
||||||
// Handle case where acceleration == (0, 0, 0)
|
// Handle case where acceleration == (0, 0, 0)
|
||||||
vec3 eyeUp = vec3(0, 1, 0);
|
vec3 eyeUp = vec3(0, 1, 0);
|
||||||
vec3 worldUp;
|
vec3 worldUp;
|
||||||
<$transformEyeToWorldDir(cam, eyeUp, worldUp)$>
|
<$transformEyeToWorldDir(cam, eyeUp, worldUp)$>
|
||||||
normal = vec4(normalize(cross(velocity, worldUp)), 0);
|
normal = vec4(normalize(cross(_parabolaData.velocity, worldUp)), 0);
|
||||||
} else {
|
} else {
|
||||||
normal = vec4(normalize(cross(velocity, acceleration)), 0);
|
normal = vec4(normalize(cross(_parabolaData.velocity, _parabolaData.acceleration)), 0);
|
||||||
}
|
}
|
||||||
if (gl_VertexID % 2 == 0) {
|
if (gl_VertexID % 2 == 0) {
|
||||||
pos += 0.5 * width * normal;
|
pos += 0.5 * _parabolaData.width * normal;
|
||||||
} else {
|
} else {
|
||||||
pos -= 0.5 * width * normal;
|
pos -= 0.5 * _parabolaData.width * normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
<$transformModelToClipPos(cam, obj, pos, gl_Position)$>
|
<$transformModelToClipPos(cam, obj, pos, gl_Position)$>
|
||||||
|
|
|
@ -48,9 +48,9 @@ void main(void) {
|
||||||
#ifdef PROCEDURAL
|
#ifdef PROCEDURAL
|
||||||
|
|
||||||
#ifdef PROCEDURAL_V1
|
#ifdef PROCEDURAL_V1
|
||||||
specular = getProceduralColor().rgb;
|
diffuse = getProceduralColor().rgb;
|
||||||
// Procedural Shaders are expected to be Gamma corrected so let's bring back the RGB in linear space for the rest of the pipeline
|
// Procedural Shaders are expected to be Gamma corrected so let's bring back the RGB in linear space for the rest of the pipeline
|
||||||
//specular = pow(specular, vec3(2.2));
|
//diffuse = pow(diffuse, vec3(2.2));
|
||||||
emissiveAmount = 1.0;
|
emissiveAmount = 1.0;
|
||||||
#else
|
#else
|
||||||
emissiveAmount = getProceduralColors(diffuse, specular, shininess);
|
emissiveAmount = getProceduralColors(diffuse, specular, shininess);
|
||||||
|
|
|
@ -11,8 +11,10 @@
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
<@include DefaultMaterials.slh@>
|
||||||
|
|
||||||
<@include DeferredBufferWrite.slh@>
|
<@include DeferredGlobalLight.slh@>
|
||||||
|
<$declareEvalGlobalLightingAlphaBlendedWithHaze()$>
|
||||||
|
|
||||||
<@include render-utils/ShaderConstants.h@>
|
<@include render-utils/ShaderConstants.h@>
|
||||||
|
|
||||||
|
@ -26,6 +28,8 @@ layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
|
||||||
layout(location=RENDER_UTILS_ATTR_POSITION_MS) in vec4 _positionMS;
|
layout(location=RENDER_UTILS_ATTR_POSITION_MS) in vec4 _positionMS;
|
||||||
layout(location=RENDER_UTILS_ATTR_POSITION_ES) in vec4 _positionES;
|
layout(location=RENDER_UTILS_ATTR_POSITION_ES) in vec4 _positionES;
|
||||||
|
|
||||||
|
layout(location=0) out vec4 _fragColor0;
|
||||||
|
|
||||||
// For retro-compatibility
|
// For retro-compatibility
|
||||||
#define _normal _normalWS
|
#define _normal _normalWS
|
||||||
#define _modelNormal _normalMS
|
#define _modelNormal _normalMS
|
||||||
|
@ -48,9 +52,9 @@ void main(void) {
|
||||||
#ifdef PROCEDURAL
|
#ifdef PROCEDURAL
|
||||||
|
|
||||||
#ifdef PROCEDURAL_V1
|
#ifdef PROCEDURAL_V1
|
||||||
specular = getProceduralColor().rgb;
|
diffuse = getProceduralColor().rgb;
|
||||||
// Procedural Shaders are expected to be Gamma corrected so let's bring back the RGB in linear space for the rest of the pipeline
|
// Procedural Shaders are expected to be Gamma corrected so let's bring back the RGB in linear space for the rest of the pipeline
|
||||||
//specular = pow(specular, vec3(2.2));
|
//diffuse = pow(diffuse, vec3(2.2));
|
||||||
emissiveAmount = 1.0;
|
emissiveAmount = 1.0;
|
||||||
#else
|
#else
|
||||||
emissiveAmount = getProceduralColors(diffuse, specular, shininess);
|
emissiveAmount = getProceduralColors(diffuse, specular, shininess);
|
||||||
|
@ -58,19 +62,23 @@ void main(void) {
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
TransformCamera cam = getTransformCamera();
|
||||||
|
vec3 fragPosition = _positionES.xyz;
|
||||||
|
|
||||||
if (emissiveAmount > 0.0) {
|
if (emissiveAmount > 0.0) {
|
||||||
packDeferredFragmentTranslucent(
|
_fragColor0 = vec4(diffuse, _color.a);
|
||||||
normal,
|
|
||||||
_color.a,
|
|
||||||
specular,
|
|
||||||
DEFAULT_FRESNEL,
|
|
||||||
DEFAULT_ROUGHNESS);
|
|
||||||
} else {
|
} else {
|
||||||
packDeferredFragmentTranslucent(
|
_fragColor0 = vec4(evalGlobalLightingAlphaBlendedWithHaze(
|
||||||
|
cam._viewInverse,
|
||||||
|
1.0,
|
||||||
|
DEFAULT_OCCLUSION,
|
||||||
|
fragPosition,
|
||||||
normal,
|
normal,
|
||||||
_color.a,
|
|
||||||
diffuse,
|
diffuse,
|
||||||
DEFAULT_FRESNEL,
|
DEFAULT_FRESNEL,
|
||||||
DEFAULT_ROUGHNESS);
|
length(specular),
|
||||||
|
DEFAULT_EMISSIVE,
|
||||||
|
max(0.0, 1.0 - shininess / 128.0), _color.a),
|
||||||
|
_color.a);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,10 +22,8 @@
|
||||||
|
|
||||||
#include "Args.h"
|
#include "Args.h"
|
||||||
|
|
||||||
|
|
||||||
using namespace render;
|
using namespace render;
|
||||||
|
|
||||||
|
|
||||||
const gpu::PipelinePointer DrawSceneOctree::getDrawCellBoundsPipeline() {
|
const gpu::PipelinePointer DrawSceneOctree::getDrawCellBoundsPipeline() {
|
||||||
if (!_drawCellBoundsPipeline) {
|
if (!_drawCellBoundsPipeline) {
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(shader::render::program::drawCellBounds);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(shader::render::program::drawCellBounds);
|
||||||
|
@ -71,7 +69,6 @@ void DrawSceneOctree::run(const RenderContextPointer& renderContext, const ItemS
|
||||||
std::static_pointer_cast<Config>(renderContext->jobConfig)->numAllocatedCells = (int)scene->getSpatialTree().getNumAllocatedCells();
|
std::static_pointer_cast<Config>(renderContext->jobConfig)->numAllocatedCells = (int)scene->getSpatialTree().getNumAllocatedCells();
|
||||||
std::static_pointer_cast<Config>(renderContext->jobConfig)->numFreeCells = (int)scene->getSpatialTree().getNumFreeCells();
|
std::static_pointer_cast<Config>(renderContext->jobConfig)->numFreeCells = (int)scene->getSpatialTree().getNumFreeCells();
|
||||||
|
|
||||||
|
|
||||||
gpu::doInBatch("DrawSceneOctree::run", args->_context, [&](gpu::Batch& batch) {
|
gpu::doInBatch("DrawSceneOctree::run", args->_context, [&](gpu::Batch& batch) {
|
||||||
glm::mat4 projMat;
|
glm::mat4 projMat;
|
||||||
Transform viewMat;
|
Transform viewMat;
|
||||||
|
@ -86,44 +83,30 @@ void DrawSceneOctree::run(const RenderContextPointer& renderContext, const ItemS
|
||||||
// bind the one gpu::Pipeline we need
|
// bind the one gpu::Pipeline we need
|
||||||
batch.setPipeline(getDrawCellBoundsPipeline());
|
batch.setPipeline(getDrawCellBoundsPipeline());
|
||||||
|
|
||||||
if (_showVisibleCells) {
|
auto drawCellBounds = [this, &scene, &batch](const std::vector<gpu::Stamp>& cells) {
|
||||||
|
for (const auto& cellID : cells) {
|
||||||
for (const auto& cellID : inSelection.cellSelection.insideCells) {
|
|
||||||
auto cell = scene->getSpatialTree().getConcreteCell(cellID);
|
auto cell = scene->getSpatialTree().getConcreteCell(cellID);
|
||||||
auto cellLoc = cell.getlocation();
|
auto cellLoc = cell.getlocation();
|
||||||
glm::ivec4 cellLocation(cellLoc.pos.x, cellLoc.pos.y, cellLoc.pos.z, cellLoc.depth);
|
glm::ivec4 cellLocation(cellLoc.pos.x, cellLoc.pos.y, cellLoc.pos.z, cellLoc.depth);
|
||||||
|
|
||||||
bool doDraw = true;
|
bool empty = cell.isBrickEmpty() || !cell.hasBrick();
|
||||||
if (cell.isBrickEmpty() || !cell.hasBrick()) {
|
if (empty) {
|
||||||
if (!_showEmptyCells) {
|
if (!_showEmptyCells) {
|
||||||
doDraw = false;
|
continue;
|
||||||
}
|
}
|
||||||
cellLocation.w *= -1;
|
cellLocation.w *= -1.0;
|
||||||
|
} else if (!empty && !_showVisibleCells) {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
if (doDraw) {
|
|
||||||
batch._glUniform4iv(gpu::slot::uniform::Extra0, 1, ((const int*)(&cellLocation)));
|
|
||||||
batch.draw(gpu::LINES, 24, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const auto& cellID : inSelection.cellSelection.partialCells) {
|
batch._glUniform4iv(gpu::slot::uniform::Extra0, 1, ((const int*)(&cellLocation)));
|
||||||
auto cell = scene->getSpatialTree().getConcreteCell(cellID);
|
batch.draw(gpu::LINES, 24, 0);
|
||||||
auto cellLoc = cell.getlocation();
|
|
||||||
glm::ivec4 cellLocation(cellLoc.pos.x, cellLoc.pos.y, cellLoc.pos.z, cellLoc.depth);
|
|
||||||
|
|
||||||
bool doDraw = true;
|
|
||||||
if (cell.isBrickEmpty() || !cell.hasBrick()) {
|
|
||||||
if (!_showEmptyCells) {
|
|
||||||
doDraw = false;
|
|
||||||
}
|
|
||||||
cellLocation.w *= -1;
|
|
||||||
}
|
|
||||||
if (doDraw) {
|
|
||||||
batch._glUniform4iv(gpu::slot::uniform::Extra0, 1, ((const int*)(&cellLocation)));
|
|
||||||
batch.draw(gpu::LINES, 24, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
|
drawCellBounds(inSelection.cellSelection.insideCells);
|
||||||
|
drawCellBounds(inSelection.cellSelection.partialCells);
|
||||||
|
|
||||||
// Draw the LOD Reticle
|
// Draw the LOD Reticle
|
||||||
{
|
{
|
||||||
float angle = glm::degrees(getPerspectiveAccuracyAngle(args->_sizeScale, args->_boundaryLevelAdjust));
|
float angle = glm::degrees(getPerspectiveAccuracyAngle(args->_sizeScale, args->_boundaryLevelAdjust));
|
||||||
|
@ -142,10 +125,6 @@ const gpu::PipelinePointer DrawItemSelection::getDrawItemBoundPipeline() {
|
||||||
if (!_drawItemBoundPipeline) {
|
if (!_drawItemBoundPipeline) {
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(shader::render::program::drawItemBounds);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(shader::render::program::drawItemBounds);
|
||||||
|
|
||||||
//_drawItemBoundPosLoc = program->getUniforms().findLocation("inBoundPos");
|
|
||||||
//_drawItemBoundDimLoc = program->getUniforms().findLocation("inBoundDim");
|
|
||||||
//_drawCellLocationLoc = program->getUniforms().findLocation("inCellLocation");
|
|
||||||
|
|
||||||
auto state = std::make_shared<gpu::State>();
|
auto state = std::make_shared<gpu::State>();
|
||||||
|
|
||||||
state->setDepthTest(true, false, gpu::LESS_EQUAL);
|
state->setDepthTest(true, false, gpu::LESS_EQUAL);
|
||||||
|
@ -173,6 +152,19 @@ void DrawItemSelection::run(const RenderContextPointer& renderContext, const Ite
|
||||||
RenderArgs* args = renderContext->args;
|
RenderArgs* args = renderContext->args;
|
||||||
auto& scene = renderContext->_scene;
|
auto& scene = renderContext->_scene;
|
||||||
|
|
||||||
|
if (!_boundsBufferInside) {
|
||||||
|
_boundsBufferInside = std::make_shared<gpu::Buffer>(sizeof(render::ItemBound));
|
||||||
|
}
|
||||||
|
if (!_boundsBufferInsideSubcell) {
|
||||||
|
_boundsBufferInsideSubcell = std::make_shared<gpu::Buffer>(sizeof(render::ItemBound));
|
||||||
|
}
|
||||||
|
if (!_boundsBufferPartial) {
|
||||||
|
_boundsBufferPartial = std::make_shared<gpu::Buffer>(sizeof(render::ItemBound));
|
||||||
|
}
|
||||||
|
if (!_boundsBufferPartialSubcell) {
|
||||||
|
_boundsBufferPartialSubcell = std::make_shared<gpu::Buffer>(sizeof(render::ItemBound));
|
||||||
|
}
|
||||||
|
|
||||||
gpu::doInBatch("DrawItemSelection::run", args->_context, [&](gpu::Batch& batch) {
|
gpu::doInBatch("DrawItemSelection::run", args->_context, [&](gpu::Batch& batch) {
|
||||||
glm::mat4 projMat;
|
glm::mat4 projMat;
|
||||||
Transform viewMat;
|
Transform viewMat;
|
||||||
|
@ -187,63 +179,35 @@ void DrawItemSelection::run(const RenderContextPointer& renderContext, const Ite
|
||||||
// bind the one gpu::Pipeline we need
|
// bind the one gpu::Pipeline we need
|
||||||
batch.setPipeline(getDrawItemBoundPipeline());
|
batch.setPipeline(getDrawItemBoundPipeline());
|
||||||
|
|
||||||
|
auto drawItemBounds = [&](const render::ItemIDs itemIDs, const gpu::BufferPointer buffer) {
|
||||||
|
render::ItemBounds itemBounds;
|
||||||
|
for (const auto& itemID : itemIDs) {
|
||||||
|
auto& item = scene->getItem(itemID);
|
||||||
|
auto itemBound = item.getBound();
|
||||||
|
if (!itemBound.isInvalid()) {
|
||||||
|
itemBounds.emplace_back(itemID, itemBound);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemBounds.size() > 0) {
|
||||||
|
buffer->setData(itemBounds.size() * sizeof(render::ItemBound), (const gpu::Byte*) itemBounds.data());
|
||||||
|
batch.setResourceBuffer(0, buffer);
|
||||||
|
batch.draw(gpu::LINES, (gpu::uint32) itemBounds.size() * 24, 0);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if (_showInsideItems) {
|
if (_showInsideItems) {
|
||||||
for (const auto& itemID : inSelection.insideItems) {
|
drawItemBounds(inSelection.insideItems, _boundsBufferInside);
|
||||||
auto& item = scene->getItem(itemID);
|
|
||||||
auto itemBound = item.getBound();
|
|
||||||
auto itemCell = scene->getSpatialTree().getCellLocation(item.getCell());
|
|
||||||
glm::ivec4 cellLocation(0, 0, 0, itemCell.depth);
|
|
||||||
|
|
||||||
//batch._glUniform4iv(_drawCellLocationLoc, 1, ((const int*)(&cellLocation)));
|
|
||||||
//batch._glUniform3fv(_drawItemBoundPosLoc, 1, (const float*)(&itemBound.getCorner()));
|
|
||||||
//batch._glUniform3fv(_drawItemBoundDimLoc, 1, (const float*)(&itemBound.getScale()));
|
|
||||||
|
|
||||||
batch.draw(gpu::LINES, 24, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_showInsideSubcellItems) {
|
if (_showInsideSubcellItems) {
|
||||||
for (const auto& itemID : inSelection.insideSubcellItems) {
|
drawItemBounds(inSelection.insideSubcellItems, _boundsBufferInsideSubcell);
|
||||||
auto& item = scene->getItem(itemID);
|
|
||||||
auto itemBound = item.getBound();
|
|
||||||
auto itemCell = scene->getSpatialTree().getCellLocation(item.getCell());
|
|
||||||
glm::ivec4 cellLocation(0, 0, 1, itemCell.depth);
|
|
||||||
|
|
||||||
//batch._glUniform4iv(_drawCellLocationLoc, 1, ((const int*)(&cellLocation)));
|
|
||||||
//batch._glUniform3fv(_drawItemBoundPosLoc, 1, (const float*)(&itemBound.getCorner()));
|
|
||||||
//batch._glUniform3fv(_drawItemBoundDimLoc, 1, (const float*)(&itemBound.getScale()));
|
|
||||||
|
|
||||||
batch.draw(gpu::LINES, 24, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_showPartialItems) {
|
if (_showPartialItems) {
|
||||||
for (const auto& itemID : inSelection.partialItems) {
|
drawItemBounds(inSelection.partialItems, _boundsBufferPartial);
|
||||||
auto& item = scene->getItem(itemID);
|
|
||||||
auto itemBound = item.getBound();
|
|
||||||
auto itemCell = scene->getSpatialTree().getCellLocation(item.getCell());
|
|
||||||
glm::ivec4 cellLocation(0, 0, 0, itemCell.depth);
|
|
||||||
|
|
||||||
//batch._glUniform4iv(_drawCellLocationLoc, 1, ((const int*)(&cellLocation)));
|
|
||||||
//batch._glUniform3fv(_drawItemBoundPosLoc, 1, (const float*)(&itemBound.getCorner()));
|
|
||||||
//batch._glUniform3fv(_drawItemBoundDimLoc, 1, (const float*)(&itemBound.getScale()));
|
|
||||||
|
|
||||||
batch.draw(gpu::LINES, 24, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_showPartialSubcellItems) {
|
if (_showPartialSubcellItems) {
|
||||||
for (const auto& itemID : inSelection.partialSubcellItems) {
|
drawItemBounds(inSelection.partialSubcellItems, _boundsBufferPartialSubcell);
|
||||||
auto& item = scene->getItem(itemID);
|
|
||||||
auto itemBound = item.getBound();
|
|
||||||
auto itemCell = scene->getSpatialTree().getCellLocation(item.getCell());
|
|
||||||
glm::ivec4 cellLocation(0, 0, 1, itemCell.depth);
|
|
||||||
//batch._glUniform4iv(_drawCellLocationLoc, 1, ((const int*)(&cellLocation)));
|
|
||||||
//batch._glUniform3fv(_drawItemBoundPosLoc, 1, (const float*)(&itemBound.getCorner()));
|
|
||||||
//batch._glUniform3fv(_drawItemBoundDimLoc, 1, (const float*)(&itemBound.getScale()));
|
|
||||||
|
|
||||||
batch.draw(gpu::LINES, 24, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
batch.setResourceBuffer(0, 0);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,6 @@ namespace render {
|
||||||
|
|
||||||
class DrawSceneOctree {
|
class DrawSceneOctree {
|
||||||
gpu::PipelinePointer _drawCellBoundsPipeline;
|
gpu::PipelinePointer _drawCellBoundsPipeline;
|
||||||
gpu::BufferPointer _cells;
|
|
||||||
gpu::PipelinePointer _drawLODReticlePipeline;
|
gpu::PipelinePointer _drawLODReticlePipeline;
|
||||||
gpu::PipelinePointer _drawItemBoundPipeline;
|
gpu::PipelinePointer _drawItemBoundPipeline;
|
||||||
|
|
||||||
|
@ -107,6 +106,10 @@ namespace render {
|
||||||
|
|
||||||
class DrawItemSelection {
|
class DrawItemSelection {
|
||||||
gpu::PipelinePointer _drawItemBoundPipeline;
|
gpu::PipelinePointer _drawItemBoundPipeline;
|
||||||
|
gpu::BufferPointer _boundsBufferInside;
|
||||||
|
gpu::BufferPointer _boundsBufferInsideSubcell;
|
||||||
|
gpu::BufferPointer _boundsBufferPartial;
|
||||||
|
gpu::BufferPointer _boundsBufferPartialSubcell;
|
||||||
|
|
||||||
bool _showInsideItems; // initialized by Config
|
bool _showInsideItems; // initialized by Config
|
||||||
bool _showInsideSubcellItems; // initialized by Config
|
bool _showInsideSubcellItems; // initialized by Config
|
||||||
|
|
|
@ -33,9 +33,6 @@ void DrawStatusConfig::dirtyHelper() {
|
||||||
const gpu::PipelinePointer DrawStatus::getDrawItemBoundsPipeline() {
|
const gpu::PipelinePointer DrawStatus::getDrawItemBoundsPipeline() {
|
||||||
if (!_drawItemBoundsPipeline) {
|
if (!_drawItemBoundsPipeline) {
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(shader::render::program::drawItemBounds);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(shader::render::program::drawItemBounds);
|
||||||
//_drawItemBoundPosLoc = program->getUniforms().findLocation("inBoundPos");
|
|
||||||
//_drawItemBoundDimLoc = program->getUniforms().findLocation("inBoundDim");
|
|
||||||
//_drawItemCellLocLoc = program->getUniforms().findLocation("inCellLocation");
|
|
||||||
|
|
||||||
auto state = std::make_shared<gpu::State>();
|
auto state = std::make_shared<gpu::State>();
|
||||||
|
|
||||||
|
@ -54,11 +51,7 @@ const gpu::PipelinePointer DrawStatus::getDrawItemBoundsPipeline() {
|
||||||
|
|
||||||
const gpu::PipelinePointer DrawStatus::getDrawItemStatusPipeline() {
|
const gpu::PipelinePointer DrawStatus::getDrawItemStatusPipeline() {
|
||||||
if (!_drawItemStatusPipeline) {
|
if (!_drawItemStatusPipeline) {
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(shader::render::program::blurGaussianDepthAwareV);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(shader::render::program::drawItemStatus);
|
||||||
//_drawItemStatusPosLoc = program->getUniforms().findLocation("");
|
|
||||||
//_drawItemStatusDimLoc = program->getUniforms().findLocation("");
|
|
||||||
//_drawItemStatusValue0Loc = program->getUniforms().findLocation("");
|
|
||||||
//_drawItemStatusValue1Loc = program->getUniforms().findLocation("");
|
|
||||||
|
|
||||||
auto state = std::make_shared<gpu::State>();
|
auto state = std::make_shared<gpu::State>();
|
||||||
|
|
||||||
|
@ -99,36 +92,30 @@ void DrawStatus::run(const RenderContextPointer& renderContext, const Input& inp
|
||||||
const auto& inItems = input.get0();
|
const auto& inItems = input.get0();
|
||||||
const auto jitter = input.get1();
|
const auto jitter = input.get1();
|
||||||
|
|
||||||
// FIrst thing, we collect the bound and the status for all the items we want to render
|
// First thing, we collect the bound and the status for all the items we want to render
|
||||||
int nbItems = 0;
|
int nbItems = 0;
|
||||||
|
render::ItemBounds itemBounds;
|
||||||
|
std::vector<std::pair<glm::ivec4, glm::ivec4>> itemStatus;
|
||||||
{
|
{
|
||||||
_itemBounds.resize(inItems.size());
|
|
||||||
_itemStatus.resize(inItems.size());
|
|
||||||
_itemCells.resize(inItems.size());
|
|
||||||
|
|
||||||
// AABox* itemAABox = reinterpret_cast<AABox*> (_itemBounds->editData());
|
|
||||||
// glm::ivec4* itemStatus = reinterpret_cast<glm::ivec4*> (_itemStatus->editData());
|
|
||||||
// Octree::Location* itemCell = reinterpret_cast<Octree::Location*> (_itemCells->editData());
|
|
||||||
for (size_t i = 0; i < inItems.size(); ++i) {
|
for (size_t i = 0; i < inItems.size(); ++i) {
|
||||||
const auto& item = inItems[i];
|
const auto& item = inItems[i];
|
||||||
if (!item.bound.isInvalid()) {
|
if (!item.bound.isInvalid()) {
|
||||||
if (!item.bound.isNull()) {
|
if (!item.bound.isNull()) {
|
||||||
_itemBounds[i] = item.bound;
|
itemBounds.emplace_back(render::ItemBound(item.id, item.bound));
|
||||||
} else {
|
} else {
|
||||||
_itemBounds[i].setBox(item.bound.getCorner(), 0.1f);
|
itemBounds.emplace_back(item.id, AABox(item.bound.getCorner(), 0.1f));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
auto& itemScene = scene->getItem(item.id);
|
auto& itemScene = scene->getItem(item.id);
|
||||||
_itemCells[i] = scene->getSpatialTree().getCellLocation(itemScene.getCell());
|
|
||||||
|
|
||||||
auto itemStatusPointer = itemScene.getStatus();
|
auto itemStatusPointer = itemScene.getStatus();
|
||||||
if (itemStatusPointer) {
|
if (itemStatusPointer) {
|
||||||
|
itemStatus.push_back(std::pair<glm::ivec4, glm::ivec4>());
|
||||||
// Query the current status values, this is where the statusGetter lambda get called
|
// Query the current status values, this is where the statusGetter lambda get called
|
||||||
auto&& currentStatusValues = itemStatusPointer->getCurrentValues();
|
auto&& currentStatusValues = itemStatusPointer->getCurrentValues();
|
||||||
int valueNum = 0;
|
int valueNum = 0;
|
||||||
for (int vec4Num = 0; vec4Num < NUM_STATUS_VEC4_PER_ITEM; vec4Num++) {
|
for (int vec4Num = 0; vec4Num < NUM_STATUS_VEC4_PER_ITEM; vec4Num++) {
|
||||||
auto& value = (vec4Num ? _itemStatus[i].first : _itemStatus[i].second);
|
auto& value = (vec4Num ? itemStatus[nbItems].first : itemStatus[nbItems].second);
|
||||||
value = glm::ivec4(Item::Status::Value::INVALID.getPackedData());
|
value = glm::ivec4(Item::Status::Value::INVALID.getPackedData());
|
||||||
for (int component = 0; component < VEC4_LENGTH; component++) {
|
for (int component = 0; component < VEC4_LENGTH; component++) {
|
||||||
valueNum = vec4Num * VEC4_LENGTH + component;
|
valueNum = vec4Num * VEC4_LENGTH + component;
|
||||||
|
@ -138,7 +125,8 @@ void DrawStatus::run(const RenderContextPointer& renderContext, const Input& inp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_itemStatus[i].first = _itemStatus[i].second = glm::ivec4(Item::Status::Value::INVALID.getPackedData());
|
auto invalid = glm::ivec4(Item::Status::Value::INVALID.getPackedData());
|
||||||
|
itemStatus.emplace_back(invalid, invalid);
|
||||||
}
|
}
|
||||||
nbItems++;
|
nbItems++;
|
||||||
}
|
}
|
||||||
|
@ -149,7 +137,11 @@ void DrawStatus::run(const RenderContextPointer& renderContext, const Input& inp
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allright, something to render let's do it
|
if (!_boundsBuffer) {
|
||||||
|
_boundsBuffer = std::make_shared<gpu::Buffer>(sizeof(render::ItemBound));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Alright, something to render let's do it
|
||||||
gpu::doInBatch("DrawStatus::run", args->_context, [&](gpu::Batch& batch) {
|
gpu::doInBatch("DrawStatus::run", args->_context, [&](gpu::Batch& batch) {
|
||||||
glm::mat4 projMat;
|
glm::mat4 projMat;
|
||||||
Transform viewMat;
|
Transform viewMat;
|
||||||
|
@ -165,32 +157,24 @@ void DrawStatus::run(const RenderContextPointer& renderContext, const Input& inp
|
||||||
// bind the one gpu::Pipeline we need
|
// bind the one gpu::Pipeline we need
|
||||||
batch.setPipeline(getDrawItemBoundsPipeline());
|
batch.setPipeline(getDrawItemBoundsPipeline());
|
||||||
|
|
||||||
//AABox* itemAABox = reinterpret_cast<AABox*> (_itemBounds->editData());
|
_boundsBuffer->setData(itemBounds.size() * sizeof(render::ItemBound), (const gpu::Byte*) itemBounds.data());
|
||||||
//glm::ivec4* itemStatus = reinterpret_cast<glm::ivec4*> (_itemStatus->editData());
|
|
||||||
//Octree::Location* itemCell = reinterpret_cast<Octree::Location*> (_itemCells->editData());
|
|
||||||
|
|
||||||
const unsigned int VEC3_ADRESS_OFFSET = 3;
|
|
||||||
|
|
||||||
if (_showDisplay) {
|
if (_showDisplay) {
|
||||||
for (int i = 0; i < nbItems; i++) {
|
batch.setResourceBuffer(0, _boundsBuffer);
|
||||||
//batch._glUniform3fv(gpu::slot::uniform::Extra0, 1, (const float*)&(_itemBounds[i]));
|
batch.draw(gpu::LINES, (gpu::uint32) itemBounds.size() * 24, 0);
|
||||||
//batch._glUniform3fv(gpu::slot::uniform::Extra1, 1, ((const float*)&(_itemBounds[i])) + VEC3_ADRESS_OFFSET);
|
|
||||||
//glm::ivec4 cellLocation(_itemCells[i].pos, _itemCells[i].depth);
|
|
||||||
//batch._glUniform4iv(_drawItemCellLocLoc, 1, ((const int*)(&cellLocation)));
|
|
||||||
batch.draw(gpu::LINES, 24, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
batch.setResourceBuffer(0, 0);
|
||||||
|
|
||||||
batch.setResourceTexture(0, gpu::TextureView(getStatusIconMap(), 0));
|
batch.setResourceTexture(0, gpu::TextureView(getStatusIconMap(), 0));
|
||||||
|
|
||||||
batch.setPipeline(getDrawItemStatusPipeline());
|
batch.setPipeline(getDrawItemStatusPipeline());
|
||||||
|
|
||||||
if (_showNetwork) {
|
if (_showNetwork) {
|
||||||
for (int i = 0; i < nbItems; i++) {
|
for (size_t i = 0; i < itemBounds.size(); i++) {
|
||||||
batch._glUniform3fv(gpu::slot::uniform::Extra0, 1, (const float*)&(_itemBounds[i]));
|
batch._glUniform3fv(gpu::slot::uniform::Extra0, 1, (const float*)&itemBounds[i].bound.getCorner());
|
||||||
batch._glUniform3fv(gpu::slot::uniform::Extra1, 1, ((const float*)&(_itemBounds[i])) + VEC3_ADRESS_OFFSET);
|
batch._glUniform3fv(gpu::slot::uniform::Extra1, 1, ((const float*)&itemBounds[i].bound.getScale()));
|
||||||
batch._glUniform4iv(gpu::slot::uniform::Extra2, 1, (const int*)&(_itemStatus[i].first));
|
batch._glUniform4iv(gpu::slot::uniform::Extra2, 1, (const int*)&(itemStatus[i].first));
|
||||||
batch._glUniform4iv(gpu::slot::uniform::Extra3, 1, (const int*)&(_itemStatus[i].second));
|
batch._glUniform4iv(gpu::slot::uniform::Extra3, 1, (const int*)&(itemStatus[i].second));
|
||||||
batch.draw(gpu::TRIANGLES, 24 * NUM_STATUS_VEC4_PER_ITEM, 0);
|
batch.draw(gpu::TRIANGLES, 24 * NUM_STATUS_VEC4_PER_ITEM, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,12 +62,7 @@ namespace render {
|
||||||
gpu::PipelinePointer _drawItemBoundsPipeline;
|
gpu::PipelinePointer _drawItemBoundsPipeline;
|
||||||
gpu::PipelinePointer _drawItemStatusPipeline;
|
gpu::PipelinePointer _drawItemStatusPipeline;
|
||||||
|
|
||||||
std::vector<AABox> _itemBounds;
|
gpu::BufferPointer _boundsBuffer;
|
||||||
std::vector<std::pair<glm::ivec4, glm::ivec4>> _itemStatus;
|
|
||||||
std::vector<Octree::Location> _itemCells;
|
|
||||||
//gpu::BufferPointer _itemBounds;
|
|
||||||
//gpu::BufferPointer _itemCells;
|
|
||||||
//gpu::BufferPointer _itemStatus;
|
|
||||||
gpu::TexturePointer _statusIconMap;
|
gpu::TexturePointer _statusIconMap;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -321,6 +321,7 @@ inline QDebug operator<<(QDebug debug, const ItemFilter& me) {
|
||||||
// Handy type to just pass the ID and the bound of an item
|
// Handy type to just pass the ID and the bound of an item
|
||||||
class ItemBound {
|
class ItemBound {
|
||||||
public:
|
public:
|
||||||
|
ItemBound() {}
|
||||||
ItemBound(ItemID id) : id(id) { }
|
ItemBound(ItemID id) : id(id) { }
|
||||||
ItemBound(ItemID id, const AABox& bound) : id(id), bound(bound) { }
|
ItemBound(ItemID id, const AABox& bound) : id(id), bound(bound) { }
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,6 @@ layout(location=GPU_UNIFORM_EXTRA0) uniform ivec4 inCellLocation;
|
||||||
|
|
||||||
layout(location=0) out vec4 varColor;
|
layout(location=0) out vec4 varColor;
|
||||||
|
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
const vec4 UNIT_BOX[8] = vec4[8](
|
const vec4 UNIT_BOX[8] = vec4[8](
|
||||||
vec4(0.0, 0.0, 0.0, 1.0),
|
vec4(0.0, 0.0, 0.0, 1.0),
|
||||||
|
|
|
@ -20,10 +20,8 @@
|
||||||
<@include gpu/Color.slh@>
|
<@include gpu/Color.slh@>
|
||||||
<$declareColorWheel()$>
|
<$declareColorWheel()$>
|
||||||
|
|
||||||
|
|
||||||
layout(location=GPU_UNIFORM_COLOR) uniform vec4 inColor;
|
layout(location=GPU_UNIFORM_COLOR) uniform vec4 inColor;
|
||||||
|
|
||||||
|
|
||||||
struct ItemBound {
|
struct ItemBound {
|
||||||
vec4 id_boundPos;
|
vec4 id_boundPos;
|
||||||
vec4 boundDim_s;
|
vec4 boundDim_s;
|
||||||
|
@ -48,8 +46,6 @@ ItemBound getItemBound(int i) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
layout(location=0) out vec4 varColor;
|
layout(location=0) out vec4 varColor;
|
||||||
layout(location=1) out vec2 varTexcoord;
|
layout(location=1) out vec2 varTexcoord;
|
||||||
|
|
||||||
|
|
|
@ -95,8 +95,12 @@ Column {
|
||||||
|
|
||||||
GroupBox {
|
GroupBox {
|
||||||
title: "Render Items"
|
title: "Render Items"
|
||||||
|
anchors.left: parent.left;
|
||||||
|
anchors.right: parent.right;
|
||||||
|
|
||||||
Column{
|
Column{
|
||||||
|
anchors.left: parent.left;
|
||||||
|
anchors.right: parent.right;
|
||||||
Repeater {
|
Repeater {
|
||||||
model: [ "Opaque:RenderMainView.DrawOpaqueDeferred", "Transparent:RenderMainView.DrawTransparentDeferred", "Light:RenderMainView.DrawLight",
|
model: [ "Opaque:RenderMainView.DrawOpaqueDeferred", "Transparent:RenderMainView.DrawTransparentDeferred", "Light:RenderMainView.DrawLight",
|
||||||
"Opaque Overlays:RenderMainView.DrawOverlay3DOpaque", "Transparent Overlays:RenderMainView.DrawOverlay3DTransparent" ]
|
"Opaque Overlays:RenderMainView.DrawOverlay3DOpaque", "Transparent Overlays:RenderMainView.DrawOverlay3DTransparent" ]
|
||||||
|
|
Loading…
Reference in a new issue