EEVEE-Next: Add Inflate Bounds option #114200
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#114200
Loading…
Reference in New Issue
No description provided.
Delete Branch "pragma37/blender:pull-extend-bbox"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add an Inflate Bounds option to Material settings, so frustum culling can work correctly with vertex displacement.
I am a bit unsure if we want this to be on the material. I think it depends much on the geometry. Cycles has a per object clipping property and other game engine consider the bounds a per object property.
I think it is more tedious to set up per material as you could forget one is set too high.
Not to mention this adds a bit more complexity compared to per object.
@ -299,7 +299,7 @@ class EEVEE_NEXT_MATERIAL_PT_settings_surface(MaterialButtonsPanel, Panel):
col.prop(mat, "use_backface_culling", text="Camera")
col.prop(mat, "use_backface_culling_shadow", text="Shadow")
# TODO(fclem): Displacement option
This is meant for the displacement type. Not the bounds.
The amount of displacement is always driven by the material itself (unless using an attribute node).
For the latter case, we can add the per-object property as well and just use the max value.
Consider you have a material and change its displacement. Now you have to search all the objects that use it (across scenes and even blend files) for it to work properly.
There are also cases where it may not be even possible to set the property (GN instancing procedural geometry).
104e54d1e3
tode2502b700
So had a lot of discussion with both artists and programmers. Here is some considerations:
In favor of per Object:
In favor of per material:
This is kind of similar to the step size of cycles volume material where a two level control should be working.
Since it is quite unclear for me how the object propertie would influence the material one, I would just add the material one first in the end.
I think object space is fine for now. We can add a world space option if needed later.
@ -225,0 +227,4 @@
if (is_drawable_type) {
for (auto i : IndexRange(DRW_cache_object_material_count_get(ob))) {
if (::Material *material = BKE_object_material_get(ob, i + 1)) {
inflate_bounds = math::max(inflate_bounds, material->inflate_bounds);
This is a bit annoying because this can make material that have no displacement inflate the bounding box for no reason.
I'm wondering if we could amend the bounds after the drawcall loop instead of trying to compute it upfront. This way, we would know if there is displacement based on the GPU material flag and the material flag.
Moreover that would avoid one loop over materials that are scattered across memory.
@ -160,3 +160,3 @@
}
inline void ObjectBounds::sync(Object &ob)
inline void ObjectBounds::sync(Object &ob, float inflate_bounds /* = 0.0f*/)
I don't think writing the default parameter is part of the code style.
@ -260,0 +269,4 @@
BKE_pbvh_bounding_box(ob_ref.object->sculpt->pbvh, min, max);
float3 center = (min + max) * 0.5;
float3 half_extent = max - center;
half_extent += float3(inflate_bounds);
No need to cast to
float3
.VecBase &operator+=(const T &b)
is defined.@ -955,6 +955,15 @@ void RNA_def_material(BlenderRNA *brna)
"Determines which inner part of the mesh will produce volumetric effect");
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
prop = RNA_def_property(srna, "inflate_bounds", PROP_FLOAT, PROP_NONE);
Since this is related to displacement, I would name it accordingly. Maybe call it
Max Vertex Displacement Distance
("max_vertex_displacement"
) but I wouldn't clamp the displacement (at least not yet and definitively not in this commit).Also this should be a
PROP_DISTANCE
.Done, but I've renamed the UI text to just "Max Displacement", so it can fit in the default panel width.
@ -957,1 +957,4 @@
prop = RNA_def_property(srna, "inflate_bounds", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, nullptr, "inflate_bounds");
RNA_def_property_range(prop, 0.0f, 1000.0f);
Max should be FLT_MAX
@ -967,0 +969,4 @@
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_text(prop,
"Max Vertex Displacement",
"Extends the bounds used for frustum culling. "
This needs to be updated. I'm not sure if we should refer to the frustum culling which is a technical details in EEVEE and not even a feature.