Hello everyone, I have a question. When I was debugging Blender, I found that after switching to the shading page, the first material ball in the lower right corner can only display a small area, and the rest of the area is black.
After debugging, I sorted out the process, but I donât know if this understanding is correct. In this process, what methods, tools, and testing methods can be used to modify this problem?
Thanks.
1ďźCreate ăequirect_radiance_gputextureă 2d texture from
ăcity.exră
ImBuf *ibuf = sl->equirect_radiance_buffer;
sl->equirect_radiance_gputexture =
GPU_texture_create_2d("studiolight_radiance",
ibuf->x,
ibuf->y,
1,
GPU_RGBA16F,
GPU_TEXTURE_USAGE_SHADER_READ,
ibuf->float_buffer.data);
2ďźCreate ărt_coloră cube texture from
ăequirect_radiance_gputextureă
via ăstudioLightă
EEVEE_lightprobes_cache_init
EEVEE_lookdev_cache_init(vedata,
sldata, psl->probe_background, pinfo, &grp);
DRW_shgroup_uniform_texture_ex(grp,
"studioLight", sl->equirect_radiance_gputexture, state);
eevee_lightbake_create_render_target(&lbake,
scene->eevee.gi_cubemap_resolution);
EEVEE_lightbake_cache_init(sldata, vedata,
lbake.rt_color, lbake.rt_depth);
EEVEE_lightbake_render_world(sldata, vedata,
lbake.rt_fb);
lookdev_world_frag.glsl
background_color =
node_tex_environment_equirectangular(
worldvec, studioLight).rgb;
3ďźCreate ăcube_txă cubeArray texture from ărt_coloră
via ăprobeHdră
EEVEE_lightbake_filter_glossy(sldata,
vedata,
lbake.rt_color,
lbake.store_fb,
0,
1.0f,
lcache->mips_len,
filter_quality,
clamp);
void EEVEE_lightcache_create{
light_cache->cube_tx.tex =
DRW_texture_create_cube_array_ex(cube_size,
cube_len,
GPU_R11F_G11F_B10F,
usage,
cube_texflag,
nullptr);
}
DRW_shgroup_uniform_texture(grp, "probeHdr", rt_color);
lightprobe_filter_glossy_frag.glsl
vec3 l_col = textureLod(probeHdr, L, lod).rgb;
void EEVEE_lightbake_filter_glossy{
GPU_framebuffer_ensure_config(&fb,{GPU_ATTACHMENT_NONE,
GPU_ATTACHMENT_TEXTURE_MIP(light_cache->cube_tx.tex, i),});
DRW_draw_pass(psl->probe_glossy_compute);
}
txl->lookdev_cube_tx = stl->lookdev_lightcache->cube_tx.tex;
4ďźăPrincipled BSDFă: sample from ăcube_txă via ăprobeCubesă
DRW_shgroup_uniform_texture(grp, "probeCubes", txl->lookdev_cube_tx);
closure_PrincipledBSDF_eval
closure_eval
closure_GlossyBSDF_eval
Closure closure_eval(ClosureReflection reflection,
const bool do_output_ssr)
closure_Glossy_indirect_end
vec3 probe_evaluate_world_spec(vec3 R,
float roughness)
{
float lod = fast_sqrt(roughness) * prbLodCubeMax;
return textureLod_cubemapArray(probeCubes,
vec4(R, 0.0), load).rgb;
}