mirror of
https://github.com/overte-org/overte.git
synced 2025-07-10 14:38:31 +02:00
Selection of edited object working
This commit is contained in:
parent
8a12d0c106
commit
6a31dc2659
7 changed files with 291 additions and 73 deletions
|
@ -448,7 +448,7 @@ void GLBackend::do_glUniform1i(const Batch& batch, size_t paramOffset) {
|
|||
}
|
||||
updatePipeline();
|
||||
|
||||
glUniform1f(
|
||||
glUniform1i(
|
||||
GET_UNIFORM_LOCATION(batch._params[paramOffset + 1]._int),
|
||||
batch._params[paramOffset + 0]._int);
|
||||
(void)CHECK_GL_ERROR();
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include <gpu/Context.h>
|
||||
|
||||
void FadeSwitchJob::configure(const Config& config) {
|
||||
_isEditEnabled = config.editFade;
|
||||
_parameters->_isEditEnabled = config.editFade;
|
||||
}
|
||||
|
||||
void FadeSwitchJob::run(const render::RenderContextPointer& renderContext, const Input& input, Output& output) {
|
||||
|
@ -22,13 +22,50 @@ void FadeSwitchJob::run(const render::RenderContextPointer& renderContext, const
|
|||
normalOutputs[RenderFetchCullSortTask::BACKGROUND] = input[RenderFetchCullSortTask::BACKGROUND];
|
||||
normalOutputs[RenderFetchCullSortTask::SPATIAL_SELECTION] = input[RenderFetchCullSortTask::SPATIAL_SELECTION];
|
||||
|
||||
// Find the nearest item that intersects the view direction
|
||||
const render::Item* editedItem = nullptr;
|
||||
if (_parameters->_isEditEnabled) {
|
||||
float nearestOpaqueDistance = std::numeric_limits<float>::max();
|
||||
float nearestTransparentDistance = std::numeric_limits<float>::max();
|
||||
const render::Item* nearestItem;
|
||||
|
||||
editedItem = findNearestItem(renderContext, input[RenderFetchCullSortTask::OPAQUE_SHAPE], nearestOpaqueDistance);
|
||||
nearestItem = findNearestItem(renderContext, input[RenderFetchCullSortTask::TRANSPARENT_SHAPE], nearestTransparentDistance);
|
||||
if (nearestTransparentDistance < nearestOpaqueDistance) {
|
||||
editedItem = nearestItem;
|
||||
}
|
||||
}
|
||||
|
||||
// Now, distribute items that need to be faded accross both outputs
|
||||
distribute(renderContext, input[RenderFetchCullSortTask::OPAQUE_SHAPE], normalOutputs[RenderFetchCullSortTask::OPAQUE_SHAPE], fadeOutputs[OPAQUE_SHAPE]);
|
||||
distribute(renderContext, input[RenderFetchCullSortTask::TRANSPARENT_SHAPE], normalOutputs[RenderFetchCullSortTask::TRANSPARENT_SHAPE], fadeOutputs[TRANSPARENT_SHAPE]);
|
||||
distribute(renderContext, input[RenderFetchCullSortTask::OPAQUE_SHAPE], normalOutputs[RenderFetchCullSortTask::OPAQUE_SHAPE], fadeOutputs[OPAQUE_SHAPE], editedItem);
|
||||
distribute(renderContext, input[RenderFetchCullSortTask::TRANSPARENT_SHAPE], normalOutputs[RenderFetchCullSortTask::TRANSPARENT_SHAPE], fadeOutputs[TRANSPARENT_SHAPE], editedItem);
|
||||
}
|
||||
|
||||
const render::Item* FadeSwitchJob::findNearestItem(const render::RenderContextPointer& renderContext, const render::Varying& input, float& minIsectDistance) const {
|
||||
const glm::vec3 rayOrigin = renderContext->args->getViewFrustum().getPosition();
|
||||
const glm::vec3 rayDirection = renderContext->args->getViewFrustum().getDirection();
|
||||
const auto& inputItems = input.get<render::ItemBounds>();
|
||||
auto& scene = renderContext->_scene;
|
||||
BoxFace face;
|
||||
glm::vec3 normal;
|
||||
float isectDistance;
|
||||
const render::Item* nearestItem = nullptr;
|
||||
const float minDistance = 5.f;
|
||||
|
||||
for (const auto& itemBound : inputItems) {
|
||||
if (itemBound.bound.findRayIntersection(rayOrigin, rayDirection, isectDistance, face, normal)) {
|
||||
if (isectDistance>minDistance && isectDistance < minIsectDistance) {
|
||||
auto& item = scene->getItem(itemBound.id);
|
||||
nearestItem = &item;
|
||||
minIsectDistance = isectDistance;
|
||||
}
|
||||
}
|
||||
}
|
||||
return nearestItem;
|
||||
}
|
||||
|
||||
void FadeSwitchJob::distribute(const render::RenderContextPointer& renderContext, const render::Varying& input,
|
||||
render::Varying& normalOutput, render::Varying& fadeOutput) const {
|
||||
render::Varying& normalOutput, render::Varying& fadeOutput, const render::Item* editedItem) const {
|
||||
auto& scene = renderContext->_scene;
|
||||
assert(_parameters);
|
||||
const double fadeDuration = double(_parameters->_durations[FadeJobConfig::ELEMENT_ENTER_LEAVE_DOMAIN]) * USECS_PER_SECOND;
|
||||
|
@ -41,7 +78,7 @@ void FadeSwitchJob::distribute(const render::RenderContextPointer& renderContext
|
|||
for (const auto& itemBound : inputItems) {
|
||||
auto& item = scene->getItem(itemBound.id);
|
||||
|
||||
if (!item.mustFade()) {
|
||||
if (!item.mustFade() && &item!=editedItem) {
|
||||
// No need to fade
|
||||
normalOutput.template edit<render::ItemBounds>().emplace_back(itemBound);
|
||||
}
|
||||
|
@ -49,9 +86,107 @@ void FadeSwitchJob::distribute(const render::RenderContextPointer& renderContext
|
|||
fadeOutput.template edit<render::ItemBounds>().emplace_back(itemBound);
|
||||
}
|
||||
}
|
||||
/* if (!_isEditEnabled) {
|
||||
}
|
||||
|
||||
}*/
|
||||
void FadeJobConfig::setEditedCategory(int value) {
|
||||
assert(value < EVENT_CATEGORY_COUNT);
|
||||
editedCategory = std::min<int>(EVENT_CATEGORY_COUNT, value);
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
void FadeJobConfig::setDuration(float value) {
|
||||
duration[editedCategory] = value;
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
void FadeJobConfig::setBaseSizeX(float value) {
|
||||
baseSize[editedCategory].x = value;
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
void FadeJobConfig::setBaseSizeY(float value) {
|
||||
baseSize[editedCategory].y = value;
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
void FadeJobConfig::setBaseSizeZ(float value) {
|
||||
baseSize[editedCategory].z = value;
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
void FadeJobConfig::setBaseLevel(float value) {
|
||||
baseLevel[editedCategory] = value;
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
void FadeJobConfig::setBaseInverted(bool value) {
|
||||
baseInverted[editedCategory] = value;
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
void FadeJobConfig::setNoiseSizeX(float value) {
|
||||
noiseSize[editedCategory].x = value;
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
void FadeJobConfig::setNoiseSizeY(float value) {
|
||||
noiseSize[editedCategory].y = value;
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
void FadeJobConfig::setNoiseSizeZ(float value) {
|
||||
noiseSize[editedCategory].z = value;
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
void FadeJobConfig::setNoiseLevel(float value) {
|
||||
noiseLevel[editedCategory] = value;
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
void FadeJobConfig::setEdgeWidth(float value) {
|
||||
edgeWidth[editedCategory] = value;
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
void FadeJobConfig::setEdgeInnerColorR(float value) {
|
||||
edgeInnerColor[editedCategory].r = value;
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
void FadeJobConfig::setEdgeInnerColorG(float value) {
|
||||
edgeInnerColor[editedCategory].g = value;
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
void FadeJobConfig::setEdgeInnerColorB(float value) {
|
||||
edgeInnerColor[editedCategory].b = value;
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
void FadeJobConfig::setEdgeInnerIntensity(float value) {
|
||||
edgeInnerColor[editedCategory].a = value;
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
void FadeJobConfig::setEdgeOuterColorR(float value) {
|
||||
edgeOuterColor[editedCategory].r = value;
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
void FadeJobConfig::setEdgeOuterColorG(float value) {
|
||||
edgeOuterColor[editedCategory].g = value;
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
void FadeJobConfig::setEdgeOuterColorB(float value) {
|
||||
edgeOuterColor[editedCategory].b = value;
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
void FadeJobConfig::setEdgeOuterIntensity(float value) {
|
||||
edgeOuterColor[editedCategory].a = value;
|
||||
emit dirty();
|
||||
}
|
||||
|
||||
FadeConfigureJob::FadeConfigureJob(FadeCommonParameters::Pointer commonParams) :
|
||||
|
@ -63,6 +198,7 @@ FadeConfigureJob::FadeConfigureJob(FadeCommonParameters::Pointer commonParams) :
|
|||
|
||||
void FadeConfigureJob::configure(const Config& config) {
|
||||
assert(_parameters);
|
||||
_parameters->_editedCategory = config.editedCategory;
|
||||
for (auto i = 0; i < FadeJobConfig::EVENT_CATEGORY_COUNT; i++) {
|
||||
auto& configuration = _configurations[i];
|
||||
|
||||
|
@ -101,18 +237,6 @@ const FadeRenderJob* FadeRenderJob::_currentInstance{ nullptr };
|
|||
gpu::TexturePointer FadeRenderJob::_currentFadeMaskMap;
|
||||
const gpu::BufferView* FadeRenderJob::_currentFadeBuffer{ nullptr };
|
||||
|
||||
float FadeRenderJob::computeFadePercent(quint64 startTime) {
|
||||
assert(_currentInstance);
|
||||
float fadeAlpha = 1.0f;
|
||||
const double INV_FADE_PERIOD = 1.0 / (double)(_currentInstance->_parameters->_durations[FadeJobConfig::ELEMENT_ENTER_LEAVE_DOMAIN] * USECS_PER_SECOND);
|
||||
double fraction = (double)(int64_t(usecTimestampNow()) - int64_t(startTime)) * INV_FADE_PERIOD;
|
||||
fraction = std::max(fraction, 0.0);
|
||||
if (fraction < 1.0) {
|
||||
fadeAlpha = Interpolate::easeInOutQuad(fraction);
|
||||
}
|
||||
return fadeAlpha;
|
||||
}
|
||||
|
||||
void FadeRenderJob::run(const render::RenderContextPointer& renderContext, const Input& inputs) {
|
||||
assert(renderContext->args);
|
||||
assert(renderContext->args->hasViewFrustum());
|
||||
|
@ -125,15 +249,23 @@ void FadeRenderJob::run(const render::RenderContextPointer& renderContext, const
|
|||
const auto& fadeMaskMap = configuration.get0();
|
||||
const auto& fadeParamBuffer = configuration.get1();
|
||||
|
||||
// Very, very ugly hack to keep track of the current fade render job
|
||||
RenderArgs* args = renderContext->args;
|
||||
render::ShapeKey::Builder defaultKeyBuilder;
|
||||
|
||||
defaultKeyBuilder.withFade();
|
||||
|
||||
// Update interactive edit effect
|
||||
if (_parameters->_isEditEnabled) {
|
||||
updateFadeEdit();
|
||||
}
|
||||
else {
|
||||
_editStartTime = 0;
|
||||
}
|
||||
|
||||
gpu::doInBatch(args->_context, [&](gpu::Batch& batch) {
|
||||
args->_batch = &batch;
|
||||
|
||||
// Very, very ugly hack to keep track of the current fade render job
|
||||
_currentInstance = this;
|
||||
_currentFadeMaskMap = fadeMaskMap;
|
||||
_currentFadeBuffer = &fadeParamBuffer;
|
||||
|
@ -180,6 +312,69 @@ void FadeRenderJob::run(const render::RenderContextPointer& renderContext, const
|
|||
}
|
||||
}
|
||||
|
||||
float FadeRenderJob::computeElementEnterThreshold(double time) const {
|
||||
float fadeAlpha = 1.0f;
|
||||
const double INV_FADE_PERIOD = 1.0 / (double)(_parameters->_durations[FadeJobConfig::ELEMENT_ENTER_LEAVE_DOMAIN]);
|
||||
double fraction = time * INV_FADE_PERIOD;
|
||||
fraction = std::max(fraction, 0.0);
|
||||
if (fraction < 1.0) {
|
||||
fadeAlpha = Interpolate::easeInOutQuad(fraction);
|
||||
}
|
||||
return fadeAlpha;
|
||||
}
|
||||
|
||||
float FadeRenderJob::computeFadePercent(quint64 startTime) {
|
||||
const double time = (double)(int64_t(usecTimestampNow()) - int64_t(startTime)) / (double)(USECS_PER_SECOND);
|
||||
assert(_currentInstance);
|
||||
return _currentInstance->computeElementEnterThreshold(time);
|
||||
}
|
||||
|
||||
void FadeRenderJob::updateFadeEdit() {
|
||||
if (_editStartTime == 0) {
|
||||
_editStartTime = usecTimestampNow();
|
||||
}
|
||||
|
||||
const double time = (int64_t(usecTimestampNow()) - int64_t(_editStartTime)) / double(USECS_PER_SECOND);
|
||||
|
||||
switch (_parameters->_editedCategory) {
|
||||
case FadeJobConfig::ELEMENT_ENTER_LEAVE_DOMAIN:
|
||||
{
|
||||
const double waitTime = 0.5; // Wait between fade in and out
|
||||
const float eventDuration = _parameters->_durations[FadeJobConfig::ELEMENT_ENTER_LEAVE_DOMAIN];
|
||||
double cycleTime = fmod(time, (eventDuration+waitTime) * 2.0);
|
||||
|
||||
if (cycleTime < eventDuration) {
|
||||
_editThreshold = 1.f-computeElementEnterThreshold(cycleTime);
|
||||
}
|
||||
else if (cycleTime < (eventDuration + waitTime)) {
|
||||
_editThreshold = 0.f;
|
||||
}
|
||||
else if (cycleTime < (2 * eventDuration + waitTime)) {
|
||||
_editThreshold = computeElementEnterThreshold(cycleTime- (eventDuration + waitTime));
|
||||
}
|
||||
else {
|
||||
_editThreshold = 1.f;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case FadeJobConfig::BUBBLE_ISECT_OWNER:
|
||||
break;
|
||||
|
||||
case FadeJobConfig::BUBBLE_ISECT_TRESPASSER:
|
||||
break;
|
||||
|
||||
case FadeJobConfig::USER_ENTER_LEAVE_DOMAIN:
|
||||
break;
|
||||
|
||||
case FadeJobConfig::AVATAR_CHANGE:
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
|
||||
void FadeRenderJob::bindPerBatch(gpu::Batch& batch, int fadeMaskMapLocation, int fadeBufferLocation) {
|
||||
assert(_currentFadeMaskMap);
|
||||
assert(_currentFadeBuffer!=nullptr);
|
||||
|
@ -210,17 +405,26 @@ bool FadeRenderJob::bindPerItem(gpu::Batch& batch, const gpu::Pipeline* pipeline
|
|||
auto fadeCategoryLocation = uniforms.findLocation("fadeCategory");
|
||||
|
||||
if (fadeNoiseOffsetLocation >= 0 || fadeBaseOffsetLocation>=0 || fadeThresholdLocation >= 0 || fadeCategoryLocation>=0) {
|
||||
float percent;
|
||||
float threshold;
|
||||
int eventCategory = FadeJobConfig::ELEMENT_ENTER_LEAVE_DOMAIN;
|
||||
|
||||
percent = computeFadePercent(startTime);
|
||||
batch._glUniform1i(fadeCategoryLocation, FadeJobConfig::ELEMENT_ENTER_LEAVE_DOMAIN);
|
||||
batch._glUniform1f(fadeThresholdLocation, 1.f-percent);
|
||||
threshold = 1.f-computeFadePercent(startTime);
|
||||
|
||||
// Manage interactive edition override
|
||||
assert(_currentInstance);
|
||||
if (_currentInstance->_parameters->_isEditEnabled) {
|
||||
eventCategory = _currentInstance->_parameters->_editedCategory;
|
||||
threshold = _currentInstance->_editThreshold;
|
||||
}
|
||||
|
||||
batch._glUniform1i(fadeCategoryLocation, eventCategory);
|
||||
batch._glUniform1f(fadeThresholdLocation, threshold);
|
||||
// This is really temporary
|
||||
batch._glUniform3f(fadeNoiseOffsetLocation, offset.x, offset.y, offset.z);
|
||||
// This is really temporary
|
||||
batch._glUniform3f(fadeBaseOffsetLocation, offset.x, offset.y, offset.z);
|
||||
|
||||
return percent < 1.f;
|
||||
return threshold > 0.f;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -66,63 +66,63 @@ public:
|
|||
EVENT_CATEGORY_COUNT
|
||||
};
|
||||
|
||||
void setEditedCategory(int value) { assert(value < EVENT_CATEGORY_COUNT); editedCategory = std::min<int>(EVENT_CATEGORY_COUNT, value); }
|
||||
void setEditedCategory(int value);
|
||||
|
||||
void setDuration(float value) { duration[editedCategory] = value; }
|
||||
void setDuration(float value);
|
||||
float getDuration() const { return duration[editedCategory]; }
|
||||
|
||||
void setBaseSizeX(float value) { baseSize[editedCategory].x = value; }
|
||||
void setBaseSizeX(float value);
|
||||
float getBaseSizeX() const { return baseSize[editedCategory].x; }
|
||||
|
||||
void setBaseSizeY(float value) { baseSize[editedCategory].y = value; }
|
||||
void setBaseSizeY(float value);
|
||||
float getBaseSizeY() const { return baseSize[editedCategory].y; }
|
||||
|
||||
void setBaseSizeZ(float value) { baseSize[editedCategory].z = value; }
|
||||
void setBaseSizeZ(float value);
|
||||
float getBaseSizeZ() const { return baseSize[editedCategory].z; }
|
||||
|
||||
void setBaseLevel(float value) { baseLevel[editedCategory] = value; }
|
||||
void setBaseLevel(float value);
|
||||
float getBaseLevel() const { return baseLevel[editedCategory]; }
|
||||
|
||||
void setBaseInverted(bool value) { baseInverted[editedCategory] = value; }
|
||||
void setBaseInverted(bool value);
|
||||
bool isBaseInverted() const { return baseInverted[editedCategory]; }
|
||||
|
||||
void setNoiseSizeX(float value) { noiseSize[editedCategory].x = value; }
|
||||
void setNoiseSizeX(float value);
|
||||
float getNoiseSizeX() const { return noiseSize[editedCategory].x; }
|
||||
|
||||
void setNoiseSizeY(float value) { noiseSize[editedCategory].y = value; }
|
||||
void setNoiseSizeY(float value);
|
||||
float getNoiseSizeY() const { return noiseSize[editedCategory].y; }
|
||||
|
||||
void setNoiseSizeZ(float value) { noiseSize[editedCategory].z = value; }
|
||||
void setNoiseSizeZ(float value);
|
||||
float getNoiseSizeZ() const { return noiseSize[editedCategory].z; }
|
||||
|
||||
void setNoiseLevel(float value) { noiseLevel[editedCategory] = value; }
|
||||
void setNoiseLevel(float value);
|
||||
float getNoiseLevel() const { return noiseLevel[editedCategory]; }
|
||||
|
||||
void setEdgeWidth(float value) { edgeWidth[editedCategory] = value; }
|
||||
void setEdgeWidth(float value);
|
||||
float getEdgeWidth() const { return edgeWidth[editedCategory]; }
|
||||
|
||||
void setEdgeInnerColorR(float value) { edgeInnerColor[editedCategory].r = value; }
|
||||
void setEdgeInnerColorR(float value);
|
||||
float getEdgeInnerColorR() const { return edgeInnerColor[editedCategory].r; }
|
||||
|
||||
void setEdgeInnerColorG(float value) { edgeInnerColor[editedCategory].g = value; }
|
||||
void setEdgeInnerColorG(float value);
|
||||
float getEdgeInnerColorG() const { return edgeInnerColor[editedCategory].g; }
|
||||
|
||||
void setEdgeInnerColorB(float value) { edgeInnerColor[editedCategory].b = value; }
|
||||
void setEdgeInnerColorB(float value);
|
||||
float getEdgeInnerColorB() const { return edgeInnerColor[editedCategory].b; }
|
||||
|
||||
void setEdgeInnerIntensity(float value) { edgeInnerColor[editedCategory].a = value; }
|
||||
void setEdgeInnerIntensity(float value);
|
||||
float getEdgeInnerIntensity() const { return edgeInnerColor[editedCategory].a; }
|
||||
|
||||
void setEdgeOuterColorR(float value) { edgeOuterColor[editedCategory].r = value; }
|
||||
void setEdgeOuterColorR(float value);
|
||||
float getEdgeOuterColorR() const { return edgeOuterColor[editedCategory].r; }
|
||||
|
||||
void setEdgeOuterColorG(float value) { edgeOuterColor[editedCategory].g = value; }
|
||||
void setEdgeOuterColorG(float value);
|
||||
float getEdgeOuterColorG() const { return edgeOuterColor[editedCategory].g; }
|
||||
|
||||
void setEdgeOuterColorB(float value) { edgeOuterColor[editedCategory].b = value; }
|
||||
void setEdgeOuterColorB(float value);
|
||||
float getEdgeOuterColorB() const { return edgeOuterColor[editedCategory].b; }
|
||||
|
||||
void setEdgeOuterIntensity(float value) { edgeOuterColor[editedCategory].a = value; }
|
||||
void setEdgeOuterIntensity(float value);
|
||||
float getEdgeOuterIntensity() const { return edgeOuterColor[editedCategory].a; }
|
||||
|
||||
int editedCategory{ ELEMENT_ENTER_LEAVE_DOMAIN };
|
||||
|
@ -199,6 +199,8 @@ struct FadeCommonParameters
|
|||
{
|
||||
using Pointer = std::shared_ptr<FadeCommonParameters>;
|
||||
|
||||
bool _isEditEnabled{ false };
|
||||
int _editedCategory{ FadeJobConfig::ELEMENT_ENTER_LEAVE_DOMAIN };
|
||||
float _durations[FadeJobConfig::EVENT_CATEGORY_COUNT]{
|
||||
30.0f, // ELEMENT_ENTER_LEAVE_DOMAIN
|
||||
0.0f, // BUBBLE_ISECT_OWNER
|
||||
|
@ -233,10 +235,10 @@ public:
|
|||
private:
|
||||
|
||||
FadeCommonParameters::Pointer _parameters;
|
||||
bool _isEditEnabled{ false };
|
||||
|
||||
void distribute(const render::RenderContextPointer& renderContext, const render::Varying& input,
|
||||
render::Varying& normalOutput, render::Varying& fadeOutput) const;
|
||||
render::Varying& normalOutput, render::Varying& fadeOutput, const render::Item* editedItem = nullptr) const;
|
||||
const render::Item* findNearestItem(const render::RenderContextPointer& renderContext, const render::Varying& input, float& minIsectDistance) const;
|
||||
};
|
||||
|
||||
struct FadeParameters
|
||||
|
@ -308,7 +310,13 @@ private:
|
|||
render::ShapePlumberPointer _shapePlumber;
|
||||
FadeCommonParameters::Pointer _parameters;
|
||||
|
||||
float computeElementEnterThreshold(double time) const;
|
||||
|
||||
// Everything needed for interactive edition
|
||||
uint64_t _editStartTime{ 0 };
|
||||
float _editThreshold{ 0.f };
|
||||
|
||||
void updateFadeEdit();
|
||||
};
|
||||
|
||||
#endif // hifi_FadeEffect_h
|
||||
|
|
|
@ -103,6 +103,7 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren
|
|||
const auto fadeOpaqueInputs = FadeRenderJob::Input(fadeOpaques, lightingModel, fadeConfigureOutputs).hasVarying();
|
||||
task.addJob<FadeRenderJob>("DrawFadeOpaque", fadeOpaqueInputs, commonFadeParameters, shapePlumber);
|
||||
|
||||
|
||||
task.addJob<EndGPURangeTimer>("OpaqueRangeTimer", opaqueRangeTimer);
|
||||
|
||||
|
||||
|
@ -173,6 +174,7 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren
|
|||
task.addJob<ToneMappingDeferred>("ToneMapping", toneMappingInputs);
|
||||
|
||||
{ // DEbug the bounds of the rendered items, still look at the zbuffer
|
||||
task.addJob<DrawBounds>("DrawFadedOpaqueBounds", fadeOpaques);
|
||||
task.addJob<DrawBounds>("DrawMetaBounds", metas);
|
||||
task.addJob<DrawBounds>("DrawOpaqueBounds", opaques);
|
||||
task.addJob<DrawBounds>("DrawTransparentBounds", transparents);
|
||||
|
|
|
@ -115,6 +115,7 @@ namespace render {
|
|||
|
||||
uint32_t _globalShapeKey { 0 };
|
||||
bool _enableTexturing { true };
|
||||
|
||||
bool _enableFade{ false };
|
||||
|
||||
RenderDetails _details;
|
||||
|
|
|
@ -19,3 +19,4 @@ var window = new OverlayWindow({
|
|||
});
|
||||
window.setPosition(50, 50);
|
||||
window.closed.connect(function() { Script.stop(); });
|
||||
Render.getConfig("RenderMainView.DrawFadedOpaqueBounds").enabled = true
|
|
@ -13,20 +13,22 @@ import QtQuick.Controls 1.4
|
|||
import "configSlider"
|
||||
|
||||
Column {
|
||||
property var config: Render.getConfig("RenderDeferredTask");
|
||||
id: root
|
||||
property var config: Render.getConfig("RenderMainView.FadeConfigure");
|
||||
property var switchConfig: Render.getConfig("RenderMainView.FadeSwitch");
|
||||
spacing: 8
|
||||
Row {
|
||||
spacing: 8
|
||||
|
||||
CheckBox {
|
||||
text: "Edit Fade"
|
||||
checked: config["editFade"]
|
||||
onCheckedChanged: { config["editFade"] = checked }
|
||||
checked: root.switchConfig["editFade"]
|
||||
onCheckedChanged: { root.switchConfig["editFade"] = checked }
|
||||
}
|
||||
ComboBox {
|
||||
width: 400
|
||||
model: ["Elements enter/leave domain", "Bubble isect. - Owner POV", "Bubble isect. - Trespasser POV", "Another user leaves/arrives", "Changing an avatar"]
|
||||
onCurrentIndexChanged: { config["editedCategory"] = currentIndex }
|
||||
onCurrentIndexChanged: { root.config["editedCategory"] = currentIndex }
|
||||
}
|
||||
}
|
||||
Column {
|
||||
|
@ -35,7 +37,7 @@ Column {
|
|||
ConfigSlider {
|
||||
label: "Duration"
|
||||
integral: false
|
||||
config: config
|
||||
config: root.config
|
||||
property: "duration"
|
||||
max: 10.0
|
||||
min: 0.1
|
||||
|
@ -50,7 +52,7 @@ Column {
|
|||
ConfigSlider {
|
||||
label: "Size X"
|
||||
integral: false
|
||||
config: config
|
||||
config: root.config
|
||||
property: "baseSizeX"
|
||||
max: 1.0
|
||||
min: 0.0
|
||||
|
@ -59,7 +61,7 @@ Column {
|
|||
ConfigSlider {
|
||||
label: "Size Y"
|
||||
integral: false
|
||||
config: config
|
||||
config: root.config
|
||||
property: "baseSizeY"
|
||||
max: 1.0
|
||||
min: 0.0
|
||||
|
@ -68,7 +70,7 @@ Column {
|
|||
ConfigSlider {
|
||||
label: "Size Z"
|
||||
integral: false
|
||||
config: config
|
||||
config: root.config
|
||||
property: "baseSizeZ"
|
||||
max: 1.0
|
||||
min: 0.0
|
||||
|
@ -77,7 +79,7 @@ Column {
|
|||
ConfigSlider {
|
||||
label: "Level"
|
||||
integral: false
|
||||
config: config
|
||||
config: root.config
|
||||
property: "baseLevel"
|
||||
max: 1.0
|
||||
min: 0.0
|
||||
|
@ -85,8 +87,8 @@ Column {
|
|||
}
|
||||
CheckBox {
|
||||
text: "Invert"
|
||||
checked: config["baseInverted"]
|
||||
onCheckedChanged: { config["baseInverted"] = checked }
|
||||
checked: root.config["baseInverted"]
|
||||
onCheckedChanged: { root.config["baseInverted"] = checked }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -99,7 +101,7 @@ Column {
|
|||
ConfigSlider {
|
||||
label: "Size X"
|
||||
integral: false
|
||||
config: config
|
||||
config: root.config
|
||||
property: "noiseSizeX"
|
||||
max: 1.0
|
||||
min: 0.0
|
||||
|
@ -108,7 +110,7 @@ Column {
|
|||
ConfigSlider {
|
||||
label: "Size Y"
|
||||
integral: false
|
||||
config: config
|
||||
config: root.config
|
||||
property: "noiseSizeY"
|
||||
max: 1.0
|
||||
min: 0.0
|
||||
|
@ -117,7 +119,7 @@ Column {
|
|||
ConfigSlider {
|
||||
label: "Size Z"
|
||||
integral: false
|
||||
config: config
|
||||
config: root.config
|
||||
property: "noiseSizeZ"
|
||||
max: 1.0
|
||||
min: 0.0
|
||||
|
@ -126,7 +128,7 @@ Column {
|
|||
ConfigSlider {
|
||||
label: "Level"
|
||||
integral: false
|
||||
config: config
|
||||
config: root.config
|
||||
property: "noiseLevel"
|
||||
max: 1.0
|
||||
min: 0.0
|
||||
|
@ -143,7 +145,7 @@ Column {
|
|||
ConfigSlider {
|
||||
label: "Width"
|
||||
integral: false
|
||||
config: config
|
||||
config: root.config
|
||||
property: "edgeWidth"
|
||||
max: 1.0
|
||||
min: 0.0
|
||||
|
@ -156,7 +158,7 @@ Column {
|
|||
ConfigSlider {
|
||||
label: "Color R"
|
||||
integral: false
|
||||
config: config
|
||||
config: root.config
|
||||
property: "edgeInnerColorR"
|
||||
max: 1.0
|
||||
min: 0.0
|
||||
|
@ -165,7 +167,7 @@ Column {
|
|||
ConfigSlider {
|
||||
label: "Color G"
|
||||
integral: false
|
||||
config: config
|
||||
config: root.config
|
||||
property: "edgeInnerColorG"
|
||||
max: 1.0
|
||||
min: 0.0
|
||||
|
@ -174,7 +176,7 @@ Column {
|
|||
ConfigSlider {
|
||||
label: "Color B"
|
||||
integral: false
|
||||
config: config
|
||||
config: root.config
|
||||
property: "edgeInnerColorB"
|
||||
max: 1.0
|
||||
min: 0.0
|
||||
|
@ -183,7 +185,7 @@ Column {
|
|||
ConfigSlider {
|
||||
label: "Color intensity"
|
||||
integral: false
|
||||
config: config
|
||||
config: root.config
|
||||
property: "edgeInnerIntensity"
|
||||
max: 5.0
|
||||
min: 0.0
|
||||
|
@ -198,7 +200,7 @@ Column {
|
|||
ConfigSlider {
|
||||
label: "Color R"
|
||||
integral: false
|
||||
config: config
|
||||
config: root.config
|
||||
property: "edgeOuterColorR"
|
||||
max: 1.0
|
||||
min: 0.0
|
||||
|
@ -207,7 +209,7 @@ Column {
|
|||
ConfigSlider {
|
||||
label: "Color G"
|
||||
integral: false
|
||||
config: config
|
||||
config: root.config
|
||||
property: "edgeOuterColorG"
|
||||
max: 1.0
|
||||
min: 0.0
|
||||
|
@ -216,7 +218,7 @@ Column {
|
|||
ConfigSlider {
|
||||
label: "Color B"
|
||||
integral: false
|
||||
config: config
|
||||
config: root.config
|
||||
property: "edgeOuterColorB"
|
||||
max: 1.0
|
||||
min: 0.0
|
||||
|
@ -225,7 +227,7 @@ Column {
|
|||
ConfigSlider {
|
||||
label: "Color intensity"
|
||||
integral: false
|
||||
config: config
|
||||
config: root.config
|
||||
property: "edgeOuterIntensity"
|
||||
max: 5.0
|
||||
min: 0.0
|
||||
|
|
Loading…
Reference in a new issue