TheFuseLab / VL.Fuse

A library for visually programming on the GPU, built to enable rapid workflows and modular approaches to accelerated graphics, logic and computation.
https://www.thefuselab.io
MIT License
269 stars 21 forks source link

Raymarch (Material) does not seem to work with VolumeSDF #51

Closed sebescudie closed 2 years ago

sebescudie commented 3 years ago

Was trying to make a small HowTo for the VolumeSDF node, using the Stanford Dragon asset from FieldTrip. When using the Raymarch (Basic) node, the dragon renders fine, but using Raymarch (Material), it only shows a box.

After trying to use Raymarch (Material), gamma stays in Hot Swapping state forever (static red bar under the quad menu) and ends up being unresponsive.

azeno commented 3 years ago

I fear this needs a PR in Stride itself. The culprit seems to be the blocking WaitForResult in this line: https://github.com/stride3d/stride/blob/7e836297cb5930c01e6dfa0183e7f3cc64748fb6/sources/engine/Stride.Rendering/Rendering/DynamicEffectInstance.cs#L60

triggering https://github.com/stride3d/stride/blob/7e836297cb5930c01e6dfa0183e7f3cc64748fb6/sources/engine/Stride.Rendering/Rendering/EffectSystem.cs#L165 which schedules the continuation on the same thread - at least I don't see any code which would ensure that the continuation is scheduled on another thread.

tebjan commented 3 years ago

@sebescudie was this working in earlier versions?

sebescudie commented 3 years ago

@azeno Thanks for the pointer! Not much I can do on my side sadly :)

@tebjan Just tried with 402 and had the same behavior. Earlier versions I tested would either throw exceptions or give red nodes (because of newly introduced stuff in Gamma that were not there back then).

azeno commented 3 years ago

Just did a PR which fixes this issue. Please close once it's accepted and our Stride version updated.

sebescudie commented 3 years ago

Thanks @azeno, the freezing issue is fixed.

I'm keeping this one open though, because the VolumeSDF still does not render with a Raymarch (Material). Tested with 2021.4 preview 568 and latest Fuse from develop (8248761a0745fd9566766b63d32b650544824291).

everyoneishappy commented 3 years ago

I'm pretty sure it's the sampler not being setup correctly when used in material system. Could this be related? https://github.com/vvvv/VL.StandardLibs/issues/130

everyoneishappy commented 2 years ago

This poor module had been quite the venn diagram of overlapping issues... One step closer with vvvv/VL.StandardLibs#489 fixed. But still some funky stuff with the sampler. Demo patch in 9981cfcdf054cef6e93155e47442d70c5a6ad283

Will not work on open, then if you change some things on the sampler it does, but also seems to ignore the actual sampler settings. @tebjan would you have any advice?