Merge pull request #1234 from HifiExperiments/forwardFade

fix fade out not working in forward rendering
This commit is contained in:
ksuprynowicz 2024-11-12 17:32:28 +01:00 committed by GitHub
commit ad5b6d0db7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 15 additions and 14 deletions

View file

@ -28,10 +28,8 @@ FadeEffect::FadeEffect() {
}
void FadeEffect::build(JobModel& task, const render::Varying& inputs, render::Varying& outputs) {
auto editedFadeCategory = task.addJob<FadeJob>("Fade");
const auto fadeEditInput = FadeEditJob::Input(inputs, editedFadeCategory).asVarying();
task.addJob<FadeEditJob>("FadeEdit", fadeEditInput);
const auto editedFadeCategory = task.addJob<FadeJob>("Fade");
task.addJob<FadeEditJob>("FadeEdit", editedFadeCategory);
}
render::ShapePipeline::BatchSetter FadeEffect::getBatchSetter() {

View file

@ -15,8 +15,7 @@
class FadeEffect {
public:
using Input = render::ItemBounds;
using JobModel = render::Task::ModelI<FadeEffect, render::ItemBounds>;
using JobModel = render::Task::Model<FadeEffect>;
FadeEffect();

View file

@ -35,7 +35,7 @@ void FadeEditJob::configure(const Config& config) {
_isEditEnabled = config.editFade;
}
void FadeEditJob::run(const render::RenderContextPointer& renderContext, const FadeEditJob::Input& inputs) {
void FadeEditJob::run(const render::RenderContextPointer& renderContext, const FadeEditJob::Input& input) {
auto scene = renderContext->_scene;
if (_isEditEnabled) {
@ -63,7 +63,7 @@ void FadeEditJob::run(const render::RenderContextPointer& renderContext, const F
render::Transition::AVATAR_CHANGE
};
auto transitionType = categoryToTransition[inputs.get1()];
auto transitionType = categoryToTransition[input];
transaction.queryTransitionOnItem(_editedItem, [transitionType, scene](render::ItemID id, const render::Transition* transition) {
if (transition == nullptr || transition->isFinished || transition->eventType != transitionType) {

View file

@ -177,13 +177,13 @@ class FadeEditJob {
public:
using Config = FadeEditConfig;
using Input = render::VaryingSet2<render::ItemBounds, FadeCategory>;
using Input = FadeCategory;
using JobModel = render::Job::ModelI<FadeEditJob, Input, Config>;
FadeEditJob() {}
void configure(const Config& config);
void run(const render::RenderContextPointer& renderContext, const FadeEditJob::Input& inputs);
void run(const render::RenderContextPointer& renderContext, const FadeEditJob::Input& input);
private:

View file

@ -145,10 +145,6 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren
// Shadow Stage Frame
const auto shadowFrame = shadowTaskOutputs[1];
if (depth == 0) {
task.addJob<FadeEffect>("FadeEffect", opaques);
}
const auto jitter = task.addJob<JitterSample>("JitterCam");
// GPU jobs: Start preparing the primary, deferred and lighting buffer

View file

@ -10,6 +10,7 @@
//
#include "RenderViewTask.h"
#include "FadeEffect.h"
#include "RenderShadowTask.h"
#include "RenderCommonTask.h"
#include "RenderDeferredTask.h"
@ -40,6 +41,13 @@ void DeferredForwardSwitchJob::build(JobModel& task, const render::Varying& inpu
void RenderViewTask::build(JobModel& task, const render::Varying& input, render::Varying& output, render::CullFunctor cullFunctor, uint8_t tagBits, uint8_t tagMask, size_t depth) {
const auto items = task.addJob<RenderFetchCullSortTask>("FetchCullSort", cullFunctor, tagBits, tagMask);
if (depth == 0 && tagBits == render::ItemKey::TAG_BITS_0) {
// TODO: This doesn't actually do any rendering, it simply processes the fade transactions. Even though forward rendering
// doesn't support fading right now, we still need to do this once for both paths, otherwise we are left with orphaned objects
// after they fade out. In the future, we should refactor this to happen elsewhere.
task.addJob<FadeEffect>("FadeEffect");
}
// Issue the lighting model, aka the big global settings for the view
const auto lightingModel = task.addJob<MakeLightingModel>("LightingModel");