mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 12:28:02 +02:00
Preparing to introducte TransitionStage
This commit is contained in:
parent
69a7ec42fd
commit
5ab093dc38
5 changed files with 101 additions and 360 deletions
|
@ -829,10 +829,10 @@ void RenderablePolyVoxEntityItem::render(RenderArgs* args) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply fade effect
|
// Apply fade effect
|
||||||
if (args->_enableFade) {
|
/* if (args->_enableFade) {
|
||||||
FadeRenderJob::bindPerBatch(batch, render::ShapePipeline::Slot::MAP::FADE_MASK, render::ShapePipeline::Slot::BUFFER::FADE_PARAMETERS);
|
FadeRenderJob::bindPerBatch(batch, render::ShapePipeline::Slot::MAP::FADE_MASK, render::ShapePipeline::Slot::BUFFER::FADE_PARAMETERS);
|
||||||
FadeRenderJob::bindPerItem(batch, pipeline.get(), glm::vec3(0, 0, 0), _fadeStartTime);
|
FadeRenderJob::bindPerItem(batch, pipeline.get(), glm::vec3(0, 0, 0), _fadeStartTime);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
int voxelVolumeSizeLocation = pipeline->getProgram()->getUniforms().findLocation("voxelVolumeSize");
|
int voxelVolumeSizeLocation = pipeline->getProgram()->getUniforms().findLocation("voxelVolumeSize");
|
||||||
batch._glUniform3f(voxelVolumeSizeLocation, voxelVolumeSize.x, voxelVolumeSize.y, voxelVolumeSize.z);
|
batch._glUniform3f(voxelVolumeSizeLocation, voxelVolumeSize.x, voxelVolumeSize.y, voxelVolumeSize.z);
|
||||||
|
|
|
@ -21,103 +21,6 @@ inline float valueToParameterPow(float value, const double minValue, const doubl
|
||||||
return (float)(log(double(value) / minValue) / log(maxOverMinValue));
|
return (float)(log(double(value) / minValue) / log(maxOverMinValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
void FadeSwitchJob::configure(const Config& config) {
|
|
||||||
_parameters->_isEditEnabled = config.editFade;
|
|
||||||
}
|
|
||||||
|
|
||||||
void FadeSwitchJob::run(const render::RenderContextPointer& renderContext, const Input& input, Output& output) {
|
|
||||||
auto& normalOutputs = output.edit0().edit0();
|
|
||||||
auto& fadeOutputs = output.edit1();
|
|
||||||
|
|
||||||
// Only shapes are affected by fade at this time.
|
|
||||||
normalOutputs[RenderFetchCullSortTask::LIGHT].edit<render::ItemBounds>() = input.get0()[RenderFetchCullSortTask::LIGHT].get<render::ItemBounds>();
|
|
||||||
normalOutputs[RenderFetchCullSortTask::META].edit<render::ItemBounds>() = input.get0()[RenderFetchCullSortTask::META].get<render::ItemBounds>();
|
|
||||||
normalOutputs[RenderFetchCullSortTask::OVERLAY_OPAQUE_SHAPE].edit<render::ItemBounds>() = input.get0()[RenderFetchCullSortTask::OVERLAY_OPAQUE_SHAPE].get<render::ItemBounds>();
|
|
||||||
normalOutputs[RenderFetchCullSortTask::OVERLAY_TRANSPARENT_SHAPE].edit<render::ItemBounds>() = input.get0()[RenderFetchCullSortTask::OVERLAY_TRANSPARENT_SHAPE].get<render::ItemBounds>();
|
|
||||||
normalOutputs[RenderFetchCullSortTask::BACKGROUND].edit<render::ItemBounds>() = input.get0()[RenderFetchCullSortTask::BACKGROUND].get<render::ItemBounds>();
|
|
||||||
output.edit0().edit1() = input.get1();
|
|
||||||
|
|
||||||
// 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.get0()[RenderFetchCullSortTask::OPAQUE_SHAPE], nearestOpaqueDistance);
|
|
||||||
nearestItem = findNearestItem(renderContext, input.get0()[RenderFetchCullSortTask::TRANSPARENT_SHAPE], nearestTransparentDistance);
|
|
||||||
if (nearestTransparentDistance < nearestOpaqueDistance) {
|
|
||||||
editedItem = nearestItem;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (editedItem) {
|
|
||||||
output.edit2() = editedItem->getBound();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now, distribute items that need to be faded accross both outputs
|
|
||||||
distribute(renderContext, input.get0()[RenderFetchCullSortTask::OPAQUE_SHAPE], normalOutputs[RenderFetchCullSortTask::OPAQUE_SHAPE], fadeOutputs[OPAQUE_SHAPE], editedItem);
|
|
||||||
distribute(renderContext, input.get0()[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 = 2.f;
|
|
||||||
|
|
||||||
for (const auto& itemBound : inputItems) {
|
|
||||||
if (!itemBound.bound.contains(rayOrigin) && itemBound.bound.findRayIntersection(rayOrigin, rayDirection, isectDistance, face, normal)) {
|
|
||||||
if (isectDistance>minDistance && isectDistance < minIsectDistance) {
|
|
||||||
auto& item = scene->getItem(itemBound.id);
|
|
||||||
|
|
||||||
if (item.getKey().isShape() && !item.getKey().isMeta()) {
|
|
||||||
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::Item* editedItem) const {
|
|
||||||
auto& scene = renderContext->_scene;
|
|
||||||
assert(_parameters);
|
|
||||||
const auto& inputItems = input.get<render::ItemBounds>();
|
|
||||||
|
|
||||||
// Clear previous values
|
|
||||||
normalOutput.edit<render::ItemBounds>().clear();
|
|
||||||
fadeOutput.edit<render::ItemBounds>().clear();
|
|
||||||
|
|
||||||
for (const auto& itemBound : inputItems) {
|
|
||||||
auto& item = scene->getItem(itemBound.id);
|
|
||||||
|
|
||||||
// if (!item.mustFade() && &item!=editedItem) {
|
|
||||||
// No need to fade
|
|
||||||
normalOutput.edit<render::ItemBounds>().emplace_back(itemBound);
|
|
||||||
/* }
|
|
||||||
else {
|
|
||||||
fadeOutput.edit<render::ItemBounds>().emplace_back(itemBound);
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FadeCommonParameters::FadeCommonParameters()
|
|
||||||
{
|
|
||||||
_durations[FadeJobConfig::ELEMENT_ENTER_LEAVE_DOMAIN] = 0.f;
|
|
||||||
_durations[FadeJobConfig::BUBBLE_ISECT_OWNER] = 0.f;
|
|
||||||
_durations[FadeJobConfig::BUBBLE_ISECT_TRESPASSER] = 0.f;
|
|
||||||
_durations[FadeJobConfig::USER_ENTER_LEAVE_DOMAIN] = 0.f;
|
|
||||||
_durations[FadeJobConfig::AVATAR_CHANGE] = 0.f;
|
|
||||||
}
|
|
||||||
|
|
||||||
FadeJobConfig::FadeJobConfig()
|
FadeJobConfig::FadeJobConfig()
|
||||||
{
|
{
|
||||||
events[FadeJobConfig::ELEMENT_ENTER_LEAVE_DOMAIN].noiseSize = glm::vec3{ 0.75f, 0.75f, 0.75f };
|
events[FadeJobConfig::ELEMENT_ENTER_LEAVE_DOMAIN].noiseSize = glm::vec3{ 0.75f, 0.75f, 0.75f };
|
||||||
|
@ -556,137 +459,54 @@ void FadeJobConfig::load() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FadeConfigureJob::FadeConfigureJob(FadeCommonParameters::Pointer commonParams) :
|
FadeJob::FadeJob()
|
||||||
_parameters{ commonParams }
|
|
||||||
{
|
{
|
||||||
auto texturePath = PathUtils::resourcesPath() + "images/fadeMask.png";
|
auto texturePath = PathUtils::resourcesPath() + "images/fadeMask.png";
|
||||||
_fadeMaskMap = DependencyManager::get<TextureCache>()->getImageTexture(texturePath, image::TextureUsage::STRICT_TEXTURE);
|
_fadeMaskMap = DependencyManager::get<TextureCache>()->getImageTexture(texturePath, image::TextureUsage::STRICT_TEXTURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FadeConfigureJob::configure(const Config& config) {
|
void FadeJob::configure(const Config& config) {
|
||||||
assert(_parameters);
|
auto& configurations = _configurations.edit();
|
||||||
_parameters->_editedCategory = config.editedCategory;
|
|
||||||
_parameters->_isManualThresholdEnabled = config.manualFade;
|
|
||||||
_parameters->_manualThreshold = config.manualThreshold;
|
|
||||||
|
|
||||||
for (auto i = 0; i < FadeJobConfig::EVENT_CATEGORY_COUNT; i++) {
|
for (auto i = 0; i < FadeJobConfig::EVENT_CATEGORY_COUNT; i++) {
|
||||||
auto& configuration = _configurations[i];
|
auto& eventParameters = configurations.parameters[i];
|
||||||
const auto& eventConfig = config.events[i];
|
const auto& eventConfig = config.events[i];
|
||||||
|
|
||||||
_parameters->_durations[i] = eventConfig._duration;
|
eventParameters._baseLevel = eventConfig.baseLevel;
|
||||||
configuration._baseInvSizeAndLevel.x = 1.f / eventConfig.baseSize.x;
|
eventParameters._noiseInvSizeAndLevel.x = 1.f / eventConfig.noiseSize.x;
|
||||||
configuration._baseInvSizeAndLevel.y = 1.f / eventConfig.baseSize.y;
|
eventParameters._noiseInvSizeAndLevel.y = 1.f / eventConfig.noiseSize.y;
|
||||||
configuration._baseInvSizeAndLevel.z = 1.f / eventConfig.baseSize.z;
|
eventParameters._noiseInvSizeAndLevel.z = 1.f / eventConfig.noiseSize.z;
|
||||||
configuration._baseInvSizeAndLevel.w = eventConfig.baseLevel;
|
eventParameters._noiseInvSizeAndLevel.w = eventConfig.noiseLevel;
|
||||||
configuration._noiseInvSizeAndLevel.x = 1.f / eventConfig.noiseSize.x;
|
eventParameters._isInverted = eventConfig._isInverted & 1;
|
||||||
configuration._noiseInvSizeAndLevel.y = 1.f / eventConfig.noiseSize.y;
|
eventParameters._edgeWidthInvWidth.x = eventConfig.edgeWidth;
|
||||||
configuration._noiseInvSizeAndLevel.z = 1.f / eventConfig.noiseSize.z;
|
eventParameters._edgeWidthInvWidth.y = 1.f / eventParameters._edgeWidthInvWidth.x;
|
||||||
configuration._noiseInvSizeAndLevel.w = eventConfig.noiseLevel;
|
eventParameters._innerEdgeColor = eventConfig.edgeInnerColor;
|
||||||
configuration._isInverted = eventConfig._isInverted & 1;
|
eventParameters._outerEdgeColor = eventConfig.edgeOuterColor;
|
||||||
configuration._edgeWidthInvWidth.x = eventConfig.edgeWidth;
|
_thresholdScale[i] = 1.f + (eventParameters._edgeWidthInvWidth.x + std::max(0.f, (eventConfig.noiseLevel + eventConfig.baseLevel)*0.5f - 0.5f));
|
||||||
configuration._edgeWidthInvWidth.y = 1.f / configuration._edgeWidthInvWidth.x;
|
|
||||||
configuration._innerEdgeColor = eventConfig.edgeInnerColor;
|
|
||||||
configuration._outerEdgeColor = eventConfig.edgeOuterColor;
|
|
||||||
_parameters->_thresholdScale[i] = 1.f + (configuration._edgeWidthInvWidth.x + std::max(0.f, (eventConfig.noiseLevel + eventConfig.baseLevel)*0.5f-0.5f));
|
|
||||||
_parameters->_noiseSpeed[i] = eventConfig.noiseSpeed;
|
|
||||||
_parameters->_timing[i] = (FadeJobConfig::Timing) eventConfig.timing;
|
|
||||||
}
|
}
|
||||||
_isBufferDirty = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FadeConfigureJob::run(const render::RenderContextPointer& renderContext, const Input& input, Output& output) {
|
const FadeJob* FadeJob::_currentInstance{ nullptr };
|
||||||
if (_isBufferDirty || _parameters->_isEditEnabled) {
|
gpu::TexturePointer FadeJob::_currentFadeMaskMap;
|
||||||
auto& configurations = output.edit1().edit();
|
const gpu::BufferView* FadeJob::_currentFadeBuffer{ nullptr };
|
||||||
std::copy(_configurations, _configurations + FadeJobConfig::EVENT_CATEGORY_COUNT, configurations.parameters);
|
|
||||||
if (_parameters->_editedCategory == FadeJobConfig::USER_ENTER_LEAVE_DOMAIN) {
|
void FadeJob::run(const render::RenderContextPointer& renderContext, const Input& input) {
|
||||||
configurations.parameters[FadeJobConfig::USER_ENTER_LEAVE_DOMAIN]._baseInvSizeAndLevel.y = 1.0f / input.getDimensions().y;
|
const Config* jobConfig = static_cast<const Config*>(renderContext->jobConfig.get());
|
||||||
|
auto scene = renderContext->args->_scene;
|
||||||
|
|
||||||
|
// And now update fade effect on all visible items
|
||||||
|
for (auto i = 0; i < RenderFetchCullSortTask::NUM_BUCKETS; i++) {
|
||||||
|
auto& bucket = input[i].get<render::ItemBounds>();
|
||||||
|
|
||||||
|
for (const auto& itemBound : bucket) {
|
||||||
|
auto& item = scene->getItem(itemBound.id);
|
||||||
|
|
||||||
|
//updateFadeOnItem(item);
|
||||||
}
|
}
|
||||||
_isBufferDirty = false;
|
|
||||||
}
|
|
||||||
output.edit0() = _fadeMaskMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
const FadeRenderJob* FadeRenderJob::_currentInstance{ nullptr };
|
|
||||||
gpu::TexturePointer FadeRenderJob::_currentFadeMaskMap;
|
|
||||||
const gpu::BufferView* FadeRenderJob::_currentFadeBuffer{ nullptr };
|
|
||||||
|
|
||||||
void FadeRenderJob::run(const render::RenderContextPointer& renderContext, const Input& inputs) {
|
|
||||||
assert(renderContext->args);
|
|
||||||
assert(renderContext->args->hasViewFrustum());
|
|
||||||
|
|
||||||
const auto& inItems = inputs.get0();
|
|
||||||
|
|
||||||
if (!inItems.empty()) {
|
|
||||||
const auto& lightingModel = inputs.get1();
|
|
||||||
const auto& configuration = inputs.get2();
|
|
||||||
const auto& fadeMaskMap = configuration.get0();
|
|
||||||
const auto& fadeParamBuffer = configuration.get1();
|
|
||||||
|
|
||||||
RenderArgs* args = renderContext->args;
|
|
||||||
render::ShapeKey::Builder defaultKeyBuilder;
|
|
||||||
|
|
||||||
defaultKeyBuilder.withFade();
|
|
||||||
defaultKeyBuilder.withoutCullFace();
|
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
// Update interactive edit effect
|
|
||||||
if (_parameters->_isEditEnabled) {
|
|
||||||
updateFadeEdit(renderContext, inItems.front());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
_editPreviousTime = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Setup camera, projection and viewport for all items
|
|
||||||
batch.setViewportTransform(args->_viewport);
|
|
||||||
batch.setStateScissorRect(args->_viewport);
|
|
||||||
|
|
||||||
glm::mat4 projMat;
|
|
||||||
Transform viewMat;
|
|
||||||
args->getViewFrustum().evalProjectionMatrix(projMat);
|
|
||||||
args->getViewFrustum().evalViewTransform(viewMat);
|
|
||||||
|
|
||||||
batch.setProjectionTransform(projMat);
|
|
||||||
batch.setViewTransform(viewMat);
|
|
||||||
|
|
||||||
// Setup lighting model for all items;
|
|
||||||
batch.setUniformBuffer(render::ShapePipeline::Slot::LIGHTING_MODEL, lightingModel->getParametersBuffer());
|
|
||||||
|
|
||||||
// From the lighting model define a global shapKey ORED with individiual keys
|
|
||||||
render::ShapeKey::Builder keyBuilder = defaultKeyBuilder;
|
|
||||||
if (lightingModel->isWireframeEnabled()) {
|
|
||||||
keyBuilder.withWireframe();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prepare fade effect
|
|
||||||
bindPerBatch(batch, fadeMaskMap, render::ShapePipeline::Slot::MAP::FADE_MASK, &fadeParamBuffer, render::ShapePipeline::Slot::BUFFER::FADE_PARAMETERS);
|
|
||||||
|
|
||||||
render::ShapeKey globalKey = keyBuilder.build();
|
|
||||||
args->_globalShapeKey = globalKey._flags.to_ulong();
|
|
||||||
args->_enableFade = true;
|
|
||||||
|
|
||||||
renderShapes(renderContext, _shapePlumber, inItems, -1, globalKey);
|
|
||||||
|
|
||||||
args->_enableFade = false;
|
|
||||||
args->_batch = nullptr;
|
|
||||||
args->_globalShapeKey = 0;
|
|
||||||
|
|
||||||
// Very, very ugly hack to keep track of the current fade render job
|
|
||||||
_currentInstance = nullptr;
|
|
||||||
_currentFadeMaskMap.reset();
|
|
||||||
_currentFadeBuffer = nullptr;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float FadeRenderJob::computeElementEnterThreshold(double time, const double period, FadeJobConfig::Timing timing) const {
|
float FadeJob::computeElementEnterThreshold(double time, const double period, FadeJobConfig::Timing timing) const {
|
||||||
assert(period > 0.0);
|
assert(period > 0.0);
|
||||||
float fadeAlpha = 1.0f;
|
float fadeAlpha = 1.0f;
|
||||||
const double INV_FADE_PERIOD = 1.0 / period;
|
const double INV_FADE_PERIOD = 1.0 / period;
|
||||||
|
@ -712,16 +532,17 @@ float FadeRenderJob::computeElementEnterThreshold(double time, const double peri
|
||||||
return fadeAlpha;
|
return fadeAlpha;
|
||||||
}
|
}
|
||||||
|
|
||||||
float FadeRenderJob::computeFadePercent(quint64 startTime) {
|
float FadeJob::computeFadePercent(quint64 startTime) {
|
||||||
const double time = (double)(int64_t(usecTimestampNow()) - int64_t(startTime)) / (double)(USECS_PER_SECOND);
|
const double time = (double)(int64_t(usecTimestampNow()) - int64_t(startTime)) / (double)(USECS_PER_SECOND);
|
||||||
assert(_currentInstance);
|
/* assert(_currentInstance);
|
||||||
return _currentInstance->computeElementEnterThreshold(time,
|
return _currentInstance->computeElementEnterThreshold(time,
|
||||||
_currentInstance->_parameters->_durations[FadeJobConfig::ELEMENT_ENTER_LEAVE_DOMAIN],
|
_currentInstance->_parameters->_durations[FadeJobConfig::ELEMENT_ENTER_LEAVE_DOMAIN],
|
||||||
_currentInstance->_parameters->_timing[FadeJobConfig::ELEMENT_ENTER_LEAVE_DOMAIN]);
|
_currentInstance->_parameters->_timing[FadeJobConfig::ELEMENT_ENTER_LEAVE_DOMAIN]);*/
|
||||||
|
return (float)time;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FadeRenderJob::updateFadeEdit(const render::RenderContextPointer& renderContext, const render::ItemBound& itemBounds) {
|
void FadeJob::updateFadeEdit(const render::RenderContextPointer& renderContext, const render::ItemBound& itemBounds) {
|
||||||
if (_editPreviousTime == 0) {
|
/* if (_editPreviousTime == 0) {
|
||||||
_editPreviousTime = usecTimestampNow();
|
_editPreviousTime = usecTimestampNow();
|
||||||
_editTime = 0.0;
|
_editTime = 0.0;
|
||||||
}
|
}
|
||||||
|
@ -804,32 +625,32 @@ void FadeRenderJob::updateFadeEdit(const render::RenderContextPointer& renderCon
|
||||||
|
|
||||||
default:
|
default:
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void FadeRenderJob::bindPerBatch(gpu::Batch& batch, int fadeMaskMapLocation, int fadeBufferLocation) {
|
void FadeJob::bindPerBatch(gpu::Batch& batch, int fadeMaskMapLocation, int fadeBufferLocation) {
|
||||||
assert(_currentFadeMaskMap);
|
assert(_currentFadeMaskMap);
|
||||||
assert(_currentFadeBuffer!=nullptr);
|
assert(_currentFadeBuffer!=nullptr);
|
||||||
bindPerBatch(batch, _currentFadeMaskMap, fadeMaskMapLocation, _currentFadeBuffer, fadeBufferLocation);
|
bindPerBatch(batch, _currentFadeMaskMap, fadeMaskMapLocation, _currentFadeBuffer, fadeBufferLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FadeRenderJob::bindPerBatch(gpu::Batch& batch, gpu::TexturePointer texture, int fadeMaskMapLocation, const gpu::BufferView* buffer, int fadeBufferLocation) {
|
void FadeJob::bindPerBatch(gpu::Batch& batch, gpu::TexturePointer texture, int fadeMaskMapLocation, const gpu::BufferView* buffer, int fadeBufferLocation) {
|
||||||
batch.setResourceTexture(fadeMaskMapLocation, texture);
|
batch.setResourceTexture(fadeMaskMapLocation, texture);
|
||||||
batch.setUniformBuffer(fadeBufferLocation, *buffer);
|
batch.setUniformBuffer(fadeBufferLocation, *buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FadeRenderJob::bindPerBatch(gpu::Batch& batch, gpu::TexturePointer texture, const gpu::BufferView* buffer, const gpu::PipelinePointer& pipeline) {
|
void FadeJob::bindPerBatch(gpu::Batch& batch, gpu::TexturePointer texture, const gpu::BufferView* buffer, const gpu::PipelinePointer& pipeline) {
|
||||||
auto program = pipeline->getProgram();
|
auto program = pipeline->getProgram();
|
||||||
auto maskMapLocation = program->getTextures().findLocation("fadeMaskMap");
|
auto maskMapLocation = program->getTextures().findLocation("fadeMaskMap");
|
||||||
auto bufferLocation = program->getUniformBuffers().findLocation("fadeParametersBuffer");
|
auto bufferLocation = program->getUniformBuffers().findLocation("fadeParametersBuffer");
|
||||||
bindPerBatch(batch, texture, maskMapLocation, buffer, bufferLocation);
|
bindPerBatch(batch, texture, maskMapLocation, buffer, bufferLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FadeRenderJob::bindPerItem(gpu::Batch& batch, RenderArgs* args, glm::vec3 offset, quint64 startTime) {
|
bool FadeJob::bindPerItem(gpu::Batch& batch, RenderArgs* args, glm::vec3 offset, quint64 startTime) {
|
||||||
return bindPerItem(batch, args->_pipeline->pipeline.get(), offset, startTime);
|
return bindPerItem(batch, args->_pipeline->pipeline.get(), offset, startTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FadeRenderJob::bindPerItem(gpu::Batch& batch, const gpu::Pipeline* pipeline, glm::vec3 offset, quint64 startTime) {
|
bool FadeJob::bindPerItem(gpu::Batch& batch, const gpu::Pipeline* pipeline, glm::vec3 offset, quint64 startTime) {
|
||||||
auto& uniforms = pipeline->getProgram()->getUniforms();
|
auto& uniforms = pipeline->getProgram()->getUniforms();
|
||||||
auto fadeNoiseOffsetLocation = uniforms.findLocation("fadeNoiseOffset");
|
auto fadeNoiseOffsetLocation = uniforms.findLocation("fadeNoiseOffset");
|
||||||
auto fadeBaseOffsetLocation = uniforms.findLocation("fadeBaseOffset");
|
auto fadeBaseOffsetLocation = uniforms.findLocation("fadeBaseOffset");
|
||||||
|
@ -845,7 +666,7 @@ bool FadeRenderJob::bindPerItem(gpu::Batch& batch, const gpu::Pipeline* pipeline
|
||||||
threshold = 1.f-computeFadePercent(startTime);
|
threshold = 1.f-computeFadePercent(startTime);
|
||||||
|
|
||||||
// Manage interactive edition override
|
// Manage interactive edition override
|
||||||
assert(_currentInstance);
|
/* assert(_currentInstance);
|
||||||
if (_currentInstance->_parameters->_isEditEnabled) {
|
if (_currentInstance->_parameters->_isEditEnabled) {
|
||||||
eventCategory = _currentInstance->_parameters->_editedCategory;
|
eventCategory = _currentInstance->_parameters->_editedCategory;
|
||||||
threshold = _currentInstance->_editThreshold;
|
threshold = _currentInstance->_editThreshold;
|
||||||
|
@ -859,7 +680,7 @@ bool FadeRenderJob::bindPerItem(gpu::Batch& batch, const gpu::Pipeline* pipeline
|
||||||
if (eventCategory != FadeJobConfig::BUBBLE_ISECT_OWNER) {
|
if (eventCategory != FadeJobConfig::BUBBLE_ISECT_OWNER) {
|
||||||
threshold = (threshold - 0.5f)*_currentInstance->_parameters->_thresholdScale[eventCategory] + 0.5f;
|
threshold = (threshold - 0.5f)*_currentInstance->_parameters->_thresholdScale[eventCategory] + 0.5f;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
batch._glUniform1i(fadeCategoryLocation, eventCategory);
|
batch._glUniform1i(fadeCategoryLocation, eventCategory);
|
||||||
batch._glUniform1f(fadeThresholdLocation, threshold);
|
batch._glUniform1f(fadeThresholdLocation, threshold);
|
||||||
// This is really temporary
|
// This is really temporary
|
||||||
|
@ -871,3 +692,29 @@ bool FadeRenderJob::bindPerItem(gpu::Batch& batch, const gpu::Pipeline* pipeline
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const render::Item* FadeJob::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 = 2.f;
|
||||||
|
|
||||||
|
for (const auto& itemBound : inputItems) {
|
||||||
|
if (!itemBound.bound.contains(rayOrigin) && itemBound.bound.findRayIntersection(rayOrigin, rayDirection, isectDistance, face, normal)) {
|
||||||
|
if (isectDistance>minDistance && isectDistance < minIsectDistance) {
|
||||||
|
auto& item = scene->getItem(itemBound.id);
|
||||||
|
|
||||||
|
if (item.getKey().isShape() && !item.getKey().isMeta()) {
|
||||||
|
nearestItem = &item;
|
||||||
|
minIsectDistance = isectDistance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nearestItem;
|
||||||
|
}
|
||||||
|
|
|
@ -15,21 +15,6 @@
|
||||||
#include <render/ShapePipeline.h>
|
#include <render/ShapePipeline.h>
|
||||||
#include <render/RenderFetchCullSortTask.h>
|
#include <render/RenderFetchCullSortTask.h>
|
||||||
|
|
||||||
#include "LightingModel.h"
|
|
||||||
|
|
||||||
class FadeSwitchJobConfig : public render::Job::Config {
|
|
||||||
Q_OBJECT
|
|
||||||
Q_PROPERTY(bool editFade MEMBER editFade NOTIFY dirty)
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
bool editFade{ false };
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void dirty();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
class FadeJobConfig : public render::Job::Config {
|
class FadeJobConfig : public render::Job::Config {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(int editedCategory MEMBER editedCategory WRITE setEditedCategory NOTIFY dirtyCategory)
|
Q_PROPERTY(int editedCategory MEMBER editedCategory WRITE setEditedCategory NOTIFY dirtyCategory)
|
||||||
|
@ -58,6 +43,8 @@ class FadeJobConfig : public render::Job::Config {
|
||||||
Q_PROPERTY(float noiseSpeedX READ getNoiseSpeedX WRITE setNoiseSpeedX NOTIFY dirty)
|
Q_PROPERTY(float noiseSpeedX READ getNoiseSpeedX WRITE setNoiseSpeedX NOTIFY dirty)
|
||||||
Q_PROPERTY(float noiseSpeedY READ getNoiseSpeedY WRITE setNoiseSpeedY NOTIFY dirty)
|
Q_PROPERTY(float noiseSpeedY READ getNoiseSpeedY WRITE setNoiseSpeedY NOTIFY dirty)
|
||||||
Q_PROPERTY(float noiseSpeedZ READ getNoiseSpeedZ WRITE setNoiseSpeedZ NOTIFY dirty)
|
Q_PROPERTY(float noiseSpeedZ READ getNoiseSpeedZ WRITE setNoiseSpeedZ NOTIFY dirty)
|
||||||
|
Q_PROPERTY(float threshold MEMBER threshold NOTIFY dirty)
|
||||||
|
Q_PROPERTY(bool editFade MEMBER editFade NOTIFY dirty)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -153,10 +140,6 @@ public:
|
||||||
|
|
||||||
void setTiming(int value);
|
void setTiming(int value);
|
||||||
int getTiming() const { return events[editedCategory].timing; }
|
int getTiming() const { return events[editedCategory].timing; }
|
||||||
|
|
||||||
bool manualFade{ false };
|
|
||||||
float manualThreshold{ 0.f };
|
|
||||||
int editedCategory{ ELEMENT_ENTER_LEAVE_DOMAIN };
|
|
||||||
|
|
||||||
struct Event {
|
struct Event {
|
||||||
glm::vec4 edgeInnerColor;
|
glm::vec4 edgeInnerColor;
|
||||||
|
@ -173,6 +156,11 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
Event events[EVENT_CATEGORY_COUNT];
|
Event events[EVENT_CATEGORY_COUNT];
|
||||||
|
float threshold{ 0.f };
|
||||||
|
float manualThreshold{ 0.f };
|
||||||
|
int editedCategory{ ELEMENT_ENTER_LEAVE_DOMAIN };
|
||||||
|
bool editFade{ false };
|
||||||
|
bool manualFade{ false };
|
||||||
|
|
||||||
Q_INVOKABLE void save() const;
|
Q_INVOKABLE void save() const;
|
||||||
Q_INVOKABLE void load();
|
Q_INVOKABLE void load();
|
||||||
|
@ -180,67 +168,20 @@ public:
|
||||||
static QString eventNames[EVENT_CATEGORY_COUNT];
|
static QString eventNames[EVENT_CATEGORY_COUNT];
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
void dirty();
|
void dirty();
|
||||||
void dirtyCategory();
|
void dirtyCategory();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FadeCommonParameters
|
|
||||||
{
|
|
||||||
using Pointer = std::shared_ptr<FadeCommonParameters>;
|
|
||||||
|
|
||||||
FadeCommonParameters();
|
|
||||||
|
|
||||||
bool _isEditEnabled{ false };
|
|
||||||
bool _isManualThresholdEnabled{ false };
|
|
||||||
float _manualThreshold{ 0.f };
|
|
||||||
float _thresholdScale[FadeJobConfig::EVENT_CATEGORY_COUNT];
|
|
||||||
int _editedCategory{ FadeJobConfig::ELEMENT_ENTER_LEAVE_DOMAIN };
|
|
||||||
float _durations[FadeJobConfig::EVENT_CATEGORY_COUNT];
|
|
||||||
glm::vec3 _noiseSpeed[FadeJobConfig::EVENT_CATEGORY_COUNT];
|
|
||||||
FadeJobConfig::Timing _timing[FadeJobConfig::EVENT_CATEGORY_COUNT];
|
|
||||||
};
|
|
||||||
|
|
||||||
class FadeSwitchJob {
|
|
||||||
public:
|
|
||||||
|
|
||||||
enum FadeBuckets {
|
|
||||||
OPAQUE_SHAPE = 0,
|
|
||||||
TRANSPARENT_SHAPE,
|
|
||||||
|
|
||||||
NUM_BUCKETS
|
|
||||||
};
|
|
||||||
|
|
||||||
using FadeOutput = render::VaryingArray<render::ItemBounds, FadeBuckets::NUM_BUCKETS>;
|
|
||||||
|
|
||||||
using Input = RenderFetchCullSortTask::Output;
|
|
||||||
using Output = render::VaryingSet3 < RenderFetchCullSortTask::Output, FadeOutput, render::Item::Bound > ;
|
|
||||||
using Config = FadeSwitchJobConfig;
|
|
||||||
using JobModel = render::Job::ModelIO<FadeSwitchJob, Input, Output, Config>;
|
|
||||||
|
|
||||||
FadeSwitchJob(FadeCommonParameters::Pointer commonParams) : _parameters{ commonParams } {}
|
|
||||||
|
|
||||||
void configure(const Config& config);
|
|
||||||
void run(const render::RenderContextPointer& renderContext, const Input& input, Output& output);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
FadeCommonParameters::Pointer _parameters;
|
|
||||||
|
|
||||||
void distribute(const render::RenderContextPointer& renderContext, const render::Varying& input,
|
|
||||||
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
|
struct FadeParameters
|
||||||
{
|
{
|
||||||
glm::vec4 _baseInvSizeAndLevel;
|
|
||||||
glm::vec4 _noiseInvSizeAndLevel;
|
glm::vec4 _noiseInvSizeAndLevel;
|
||||||
glm::vec4 _innerEdgeColor;
|
glm::vec4 _innerEdgeColor;
|
||||||
glm::vec4 _outerEdgeColor;
|
glm::vec4 _outerEdgeColor;
|
||||||
glm::vec2 _edgeWidthInvWidth;
|
glm::vec2 _edgeWidthInvWidth;
|
||||||
|
glm::float32 _baseLevel;
|
||||||
glm::int32 _isInverted;
|
glm::int32 _isInverted;
|
||||||
glm::float32 _padding;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FadeConfiguration
|
struct FadeConfiguration
|
||||||
|
@ -248,56 +189,17 @@ struct FadeConfiguration
|
||||||
FadeParameters parameters[FadeJobConfig::EVENT_CATEGORY_COUNT];
|
FadeParameters parameters[FadeJobConfig::EVENT_CATEGORY_COUNT];
|
||||||
};
|
};
|
||||||
|
|
||||||
class FadeConfigureJob {
|
class FadeJob {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
using UniformBuffer = gpu::StructBuffer<FadeConfiguration>;
|
|
||||||
using Input = render::Item::Bound ;
|
|
||||||
using Output = render::VaryingSet2<gpu::TexturePointer, UniformBuffer>;
|
|
||||||
using Config = FadeJobConfig;
|
using Config = FadeJobConfig;
|
||||||
using JobModel = render::Job::ModelIO<FadeConfigureJob, Input, Output, Config>;
|
using Input = RenderFetchCullSortTask::BucketList;
|
||||||
|
using JobModel = render::Job::ModelI<FadeJob, Input, Config>;
|
||||||
|
|
||||||
FadeConfigureJob(FadeCommonParameters::Pointer commonParams);
|
FadeJob();
|
||||||
|
|
||||||
const gpu::TexturePointer getFadeMaskMap() const { return _fadeMaskMap; }
|
|
||||||
|
|
||||||
void configure(const Config& config);
|
void configure(const Config& config);
|
||||||
void run(const render::RenderContextPointer& renderContext, const Input& input, Output& output);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
FadeCommonParameters::Pointer _parameters;
|
|
||||||
bool _isBufferDirty{ true };
|
|
||||||
gpu::TexturePointer _fadeMaskMap;
|
|
||||||
FadeParameters _configurations[FadeJobConfig::EVENT_CATEGORY_COUNT];
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class FadeRenderJobConfig : public render::Job::Config {
|
|
||||||
Q_OBJECT
|
|
||||||
Q_PROPERTY(float threshold MEMBER threshold NOTIFY dirty)
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
float threshold{ 0.f };
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void dirty();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
class FadeRenderJob {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
using Config = FadeRenderJobConfig;
|
|
||||||
using Input = render::VaryingSet3<render::ItemBounds, LightingModelPointer, FadeConfigureJob::Output>;
|
|
||||||
using JobModel = render::Job::ModelI<FadeRenderJob, Input, Config>;
|
|
||||||
|
|
||||||
FadeRenderJob(FadeCommonParameters::Pointer commonParams, render::ShapePlumberPointer shapePlumber) : _shapePlumber{ shapePlumber }, _parameters{ commonParams } {}
|
|
||||||
|
|
||||||
void configure(const Config& config) {}
|
|
||||||
void run(const render::RenderContextPointer& renderContext, const Input& inputs);
|
void run(const render::RenderContextPointer& renderContext, const Input& inputs);
|
||||||
|
|
||||||
static void bindPerBatch(gpu::Batch& batch, int fadeMaskMapLocation, int fadeBufferLocation);
|
static void bindPerBatch(gpu::Batch& batch, int fadeMaskMapLocation, int fadeBufferLocation);
|
||||||
|
@ -311,15 +213,17 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
static const FadeRenderJob* _currentInstance;
|
static const FadeJob* _currentInstance;
|
||||||
static gpu::TexturePointer _currentFadeMaskMap;
|
static gpu::TexturePointer _currentFadeMaskMap;
|
||||||
static const gpu::BufferView* _currentFadeBuffer;
|
static const gpu::BufferView* _currentFadeBuffer;
|
||||||
|
|
||||||
render::ShapePlumberPointer _shapePlumber;
|
gpu::StructBuffer<FadeConfiguration> _configurations;
|
||||||
FadeCommonParameters::Pointer _parameters;
|
gpu::TexturePointer _fadeMaskMap;
|
||||||
|
float _thresholdScale[FadeJobConfig::EVENT_CATEGORY_COUNT];
|
||||||
|
|
||||||
float computeElementEnterThreshold(double time, const double period, FadeJobConfig::Timing timing) const;
|
float computeElementEnterThreshold(double time, const double period, FadeJobConfig::Timing timing) const;
|
||||||
|
|
||||||
|
|
||||||
// Everything needed for interactive edition
|
// Everything needed for interactive edition
|
||||||
uint64_t _editPreviousTime{ 0 };
|
uint64_t _editPreviousTime{ 0 };
|
||||||
double _editTime{ 0.0 };
|
double _editTime{ 0.0 };
|
||||||
|
@ -328,6 +232,7 @@ private:
|
||||||
glm::vec3 _editBaseOffset{ 0.f, 0.f, 0.f };
|
glm::vec3 _editBaseOffset{ 0.f, 0.f, 0.f };
|
||||||
|
|
||||||
void updateFadeEdit(const render::RenderContextPointer& renderContext, const render::ItemBound& itemBounds);
|
void updateFadeEdit(const render::RenderContextPointer& renderContext, const render::ItemBound& itemBounds);
|
||||||
|
const render::Item* findNearestItem(const render::RenderContextPointer& renderContext, const render::Varying& input, float& minIsectDistance) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_FadeEffect_h
|
#endif // hifi_FadeEffect_h
|
||||||
|
|
|
@ -53,14 +53,9 @@ void RenderDeferredTask::configure(const Config& config)
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderDeferredTask::build(JobModel& task, const render::Varying& input, render::Varying& output) {
|
void RenderDeferredTask::build(JobModel& task, const render::Varying& input, render::Varying& output) {
|
||||||
auto commonFadeParameters = std::make_shared<FadeCommonParameters>();
|
const auto& items = input.get<Input>();
|
||||||
const auto fadeSwitchOutputs = task.addJob<FadeSwitchJob>("FadeSwitch", input, commonFadeParameters).get<FadeSwitchJob::Output>();
|
|
||||||
|
// task.addJob<FadeJob>("Fade", fadeEditedItem, commonFadeParameters).get<FadeConfigureJob::Output>();
|
||||||
const auto& items = fadeSwitchOutputs.get0();
|
|
||||||
const auto& fadeItems = fadeSwitchOutputs.get1();
|
|
||||||
const auto& fadeEditedItem = fadeSwitchOutputs[2];
|
|
||||||
|
|
||||||
const auto fadeConfigureOutputs = task.addJob<FadeConfigureJob>("FadeConfigure", fadeEditedItem, commonFadeParameters).get<FadeConfigureJob::Output>();
|
|
||||||
|
|
||||||
// Prepare the ShapePipelines
|
// Prepare the ShapePipelines
|
||||||
ShapePlumberPointer shapePlumber = std::make_shared<ShapePlumber>();
|
ShapePlumberPointer shapePlumber = std::make_shared<ShapePlumber>();
|
||||||
|
@ -101,11 +96,6 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren
|
||||||
const auto opaqueInputs = DrawStateSortDeferred::Inputs(opaques, lightingModel).asVarying();
|
const auto opaqueInputs = DrawStateSortDeferred::Inputs(opaques, lightingModel).asVarying();
|
||||||
task.addJob<DrawStateSortDeferred>("DrawOpaqueDeferred", opaqueInputs, shapePlumber);
|
task.addJob<DrawStateSortDeferred>("DrawOpaqueDeferred", opaqueInputs, shapePlumber);
|
||||||
|
|
||||||
const auto fadeOpaques = fadeItems[FadeSwitchJob::OPAQUE_SHAPE];
|
|
||||||
const auto fadeOpaqueInputs = FadeRenderJob::Input(fadeOpaques, lightingModel, fadeConfigureOutputs).asVarying();
|
|
||||||
task.addJob<FadeRenderJob>("DrawFadeOpaque", fadeOpaqueInputs, commonFadeParameters, shapePlumber);
|
|
||||||
|
|
||||||
|
|
||||||
task.addJob<EndGPURangeTimer>("OpaqueRangeTimer", opaqueRangeTimer);
|
task.addJob<EndGPURangeTimer>("OpaqueRangeTimer", opaqueRangeTimer);
|
||||||
|
|
||||||
|
|
||||||
|
@ -159,10 +149,6 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren
|
||||||
const auto transparentsInputs = DrawDeferred::Inputs(transparents, lightingModel).asVarying();
|
const auto transparentsInputs = DrawDeferred::Inputs(transparents, lightingModel).asVarying();
|
||||||
task.addJob<DrawDeferred>("DrawTransparentDeferred", transparentsInputs, shapePlumber);
|
task.addJob<DrawDeferred>("DrawTransparentDeferred", transparentsInputs, shapePlumber);
|
||||||
|
|
||||||
const auto fadeTransparents = fadeItems[FadeSwitchJob::TRANSPARENT_SHAPE];
|
|
||||||
const auto fadeTransparentInputs = FadeRenderJob::Input(fadeTransparents, lightingModel, fadeConfigureOutputs).asVarying();
|
|
||||||
task.addJob<FadeRenderJob>("DrawFadeTransparent", fadeTransparentInputs, commonFadeParameters, shapePlumber);
|
|
||||||
|
|
||||||
// LIght Cluster Grid Debuging job
|
// LIght Cluster Grid Debuging job
|
||||||
{
|
{
|
||||||
const auto debugLightClustersInputs = DebugLightClusters::Inputs(deferredFrameTransform, deferredFramebuffer, lightingModel, linearDepthTarget, lightClusters).asVarying();
|
const auto debugLightClustersInputs = DebugLightClusters::Inputs(deferredFrameTransform, deferredFramebuffer, lightingModel, linearDepthTarget, lightClusters).asVarying();
|
||||||
|
@ -176,7 +162,6 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren
|
||||||
task.addJob<ToneMappingDeferred>("ToneMapping", toneMappingInputs);
|
task.addJob<ToneMappingDeferred>("ToneMapping", toneMappingInputs);
|
||||||
|
|
||||||
{ // DEbug the bounds of the rendered items, still look at the zbuffer
|
{ // 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>("DrawMetaBounds", metas);
|
||||||
task.addJob<DrawBounds>("DrawOpaqueBounds", opaques);
|
task.addJob<DrawBounds>("DrawOpaqueBounds", opaques);
|
||||||
task.addJob<DrawBounds>("DrawTransparentBounds", transparents);
|
task.addJob<DrawBounds>("DrawTransparentBounds", transparents);
|
||||||
|
|
|
@ -314,12 +314,16 @@ public:
|
||||||
class FadeState {
|
class FadeState {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
enum {
|
||||||
|
INACTIVE = (uint8_t)-1
|
||||||
|
};
|
||||||
|
|
||||||
|
uint8_t eventType{ INACTIVE };
|
||||||
uint64_t startTime{ 0 };
|
uint64_t startTime{ 0 };
|
||||||
glm::vec3 noiseOffset{ 0.f, 0.f, 0.f };
|
glm::vec3 noiseOffset{ 0.f, 0.f, 0.f };
|
||||||
glm::vec3 baseOffset{ 0.f, 0.f, 0.f };
|
glm::vec3 baseOffset{ 0.f, 0.f, 0.f };
|
||||||
glm::vec3 baseSize{ 1.f, 1.f, 1.f };
|
glm::vec3 baseSize{ 1.f, 1.f, 1.f };
|
||||||
float threshold{ 0.f };
|
float threshold{ 0.f };
|
||||||
uint8_t eventType{ (uint8_t)-1 };
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue