By now it is just a "compositor", so move the files one folder up.
Things that were under realtime_compositor/intern move into
already existing intern folder.
Pull Request: https://projects.blender.org/blender/blender/pulls/132004
Previously, the number of material slots on the geometry (e.g. mesh) was the
ground truth. However, this had limitations in the case when the object had more
material slots than the evaluated geometry. All extra slots on the object were
ignored.
This patch changes the definition so that the number of materials used for
rendering is the maximum of the number of material slots on the geometry and on
the object. This also implies that one always needs a reference to an object
when determining that number, but that was fairly straight forward to achieve in
current code.
This patch also cleans up the material count handling a fair amount by using the
`BKE_object_material_*_eval` API more consistently instead of manually accessing
`totcol`. Cycles uses the the same API indirectly through RNA.
Pull Request: https://projects.blender.org/blender/blender/pulls/131869
Previously, the number of material slots on the geometry (e.g. mesh) was the
ground truth. However, this had limitations in the case when the object had more
material slots than the evaluated geometry. All extra slots on the object were
ignored.
This patch changes the definition so that the number of materials used for
rendering is the maximum of the number of material slots on the geometry and on
the object. This also implies that one always needs a reference to an object
when determining that number, but that was fairly straight forward to achieve in
current code.
This patch also cleans up the material count handling a fair amount by using the
`BKE_object_material_*_eval` API more consistently instead of manually accessing
`totcol`. Cycles uses the the same API indirectly through RNA.
Pull Request: https://projects.blender.org/blender/blender/pulls/131761
`float4(float3 &)` is currently problematic because of implicit conversions
to and from `float *`. Writing the constructor explicitly fixes the problem.
Also add const to the arguments.
Pull Request: https://projects.blender.org/blender/blender/pulls/131828
When "Developer Extras" is disabled, the experemental options
must not be used.
Some checks for experemental options weren't using the macro which
checks both are set.
Add comment to avoid this happening in the future.
Use static CreateInfos for Overlay-Next shaders using a similar approach to Workbench shader variations.
Remove unused infos and shader sources.
Remove the `gpu_shader_create_info_get_unfinalized_copy` workaround.
Pull Request: https://projects.blender.org/blender/blender/pulls/131514
This was reported for freestyle, but was also the case for regular
renders.
So even though MotionBlurModule::init and MotionBlurModule::step return
early when motionblur is disabled, Sampling::init would still up the
samples with motionblur samples (even if motionblur was disabled
alltogether).
To resolve, only do this when motionblur is enabled.
Pull Request: https://projects.blender.org/blender/blender/pulls/131795
There is a case where the active image index could be placed on an
non-existing tile. This PR fixes this by keeping track of the active
tile when looping over all tiles.
Pull Request: https://projects.blender.org/blender/blender/pulls/131789
This was caused by a bad state where a texture (likely the viewport)
texture, could be bound as texture by the viewport blit function
and kept bound as texture input during the subsequent redraw.
This would provoke a feedback loop which is UB.
It is still unknown why this is not catched by our GL layer
and why it isn't an issue in Vulkan or Metal nor other GL
implementations.
Add back all missing calls from previous `DRW_state_reset` to
avoid more regressions.
Use the same workaround as for render.
Wrap the sync inside its own `custom_pipeline_wrapper` so that
we don't freeze the main thread when waiting for these 50ms.
Also remove the `manager->begin_sync()` and `manager->end_sync()`
as they are already present inside `render_sync`.
Pull Request: https://projects.blender.org/blender/blender/pulls/131678
Depth of field attaches the half res and scene color texture, but
doesn't provide the correct usage flags. This resulted in validation
errors in Metal & Vulkan.
Pull Request: https://projects.blender.org/blender/blender/pulls/131655
Regression from #131134.
The shader still reads `vel.obj.ofs[STEP_NEXT]` even when in the
viewport.
- Ensure that `vel.obj.ofs[STEP_NEXT]` points to a valid memory
location even if the computed value is still wrong.
- Ensure that the viewport always uses a 2 channel vector_tx and all
texture reads are always swizzled.
This also seems to fix the motion vector pass for the realtime compositor.
Pull Request: https://projects.blender.org/blender/blender/pulls/131445
Workbench shaders uses one fragment shaders, but uses different
resources based on the step of the effect. This failed in vulkan as all
defined resources should be found. This PR separates the steps in its
own fragment shader and adds sampler binding per step.
- Removed the max coc input texture as it wasn't used.
- Removed the background texture as it wasn't used.
- Renumbered the resources.
Pull Request: https://projects.blender.org/blender/blender/pulls/131606