EEVEE Next: Ambient Occlusion #108398

Merged
Miguel Pozo merged 29 commits from pragma37/blender:pull-eevee-next-ao into main 2023-06-30 19:37:37 +02:00
4 changed files with 2 additions and 22 deletions
Showing only changes of commit 87e9895f91 - Show all commits

View File

@ -154,18 +154,12 @@ class RENDER_PT_eevee_next_ambient_occlusion(RenderButtonsPanel, Panel):
def poll(cls, context):
return (context.engine in cls.COMPAT_ENGINES)
def draw_header(self, context):
scene = context.scene
props = scene.eevee
self.layout.prop(props, "use_gtao", text="")
def draw(self, context):
layout = self.layout
layout.use_property_split = True
scene = context.scene
pragma37 marked this conversation as resolved

Do not make it optional. Always enable it if render pass is needed. It might become a core part of the raytracing module.

Do not make it optional. Always enable it if render pass is needed. It might become a core part of the raytracing module.
Review

Always enable it if render pass is needed

It already works that way. See AmbientOcclusion::init.

Do you want to always enable it for the main shading too?
I think some users wouldn’t like that.

> Always enable it if render pass is needed It already works that way. See `AmbientOcclusion::init`. Do you want to always enable it for the main shading too? I think some users wouldn’t like that.

Do you want to always enable it for the main shading too?

Kind of. If it has to be an option it would be elsewhere.

> Do you want to always enable it for the main shading too? Kind of. If it has to be an option it would be elsewhere.
props = scene.eevee
layout.active = props.use_gtao
col = layout.column()
col.prop(props, "gtao_distance")
col.prop(props, "gtao_quality")

View File

@ -36,10 +36,7 @@ namespace blender::eevee {
void AmbientOcclusion::init()
{
const Scene *scene = inst_.scene;
data_.enabled = (scene->eevee.flag & SCE_EEVEE_GTAO_ENABLED) ||
(inst_.film.enabled_passes_get() & EEVEE_RENDER_PASS_AO);
render_pass_enabled_ = data_.enabled && inst_.film.enabled_passes_get() & EEVEE_RENDER_PASS_AO;
render_pass_enabled_ = inst_.film.enabled_passes_get() & EEVEE_RENDER_PASS_AO;
data_.distance = scene->eevee.gtao_distance;
data_.quality = scene->eevee.gtao_quality;

View File

@ -1006,7 +1006,6 @@ BLI_STATIC_ASSERT_ALIGN(RayTracingData, 16)
* \{ */
struct AOData {
bool1 enabled;
float distance;
float quality;
int _pad0;

View File

@ -142,10 +142,6 @@ OcclusionData ambient_occlusion_search(vec3 vP,
const float inverted,
const float dir_sample_count)
{
if (!ao_buf.enabled) {
return ambient_occlusion_disabled_data();
}
vec2 noise = ambient_occlusion_get_noise(texel);
vec2 dir = ambient_occlusion_get_dir(noise.x);
vec2 uv = get_uvs_from_view(vP);
@ -211,12 +207,6 @@ void ambient_occlusion_eval(OcclusionData data,
/* No error by default. */
visibility_error = 1.0;
if (!ao_buf.enabled) {
visibility = data.custom_occlusion;
bent_normal = N;
return;
}
bool early_out = (inverted != 0.0) ? (max_v4(abs(data.horizons)) == 0.0) :
(min_v4(abs(data.horizons)) == M_PI);
if (early_out) {