Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/eevee_lightcache.c
| Show First 20 Lines • Show All 373 Lines • ▼ Show 20 Lines | lcache->grid_tx.tex = GPU_texture_create_nD(lcache->grid_tx.tex_size[0], | ||||
| lcache->grid_tx.tex_size[2], | lcache->grid_tx.tex_size[2], | ||||
| 2, | 2, | ||||
| lcache->grid_tx.data, | lcache->grid_tx.data, | ||||
| IRRADIANCE_FORMAT, | IRRADIANCE_FORMAT, | ||||
| GPU_DATA_UNSIGNED_BYTE, | GPU_DATA_UNSIGNED_BYTE, | ||||
| 0, | 0, | ||||
| false, | false, | ||||
| NULL); | NULL); | ||||
| GPU_texture_bind(lcache->grid_tx.tex, 0); | |||||
| GPU_texture_filter_mode(lcache->grid_tx.tex, true); | GPU_texture_filter_mode(lcache->grid_tx.tex, true); | ||||
| GPU_texture_unbind(lcache->grid_tx.tex); | |||||
| } | } | ||||
| if (lcache->cube_tx.tex == NULL) { | if (lcache->cube_tx.tex == NULL) { | ||||
| if (GPU_arb_texture_cube_map_array_is_supported()) { | if (GPU_arb_texture_cube_map_array_is_supported()) { | ||||
| lcache->cube_tx.tex = GPU_texture_cube_create(lcache->cube_tx.tex_size[0], | lcache->cube_tx.tex = GPU_texture_cube_create(lcache->cube_tx.tex_size[0], | ||||
| lcache->cube_tx.tex_size[2] / 6, | lcache->cube_tx.tex_size[2] / 6, | ||||
| lcache->cube_tx.data, | lcache->cube_tx.data, | ||||
| GPU_R11F_G11F_B10F, | GPU_R11F_G11F_B10F, | ||||
| GPU_DATA_10_11_11_REV, | GPU_DATA_10_11_11_REV, | ||||
| NULL); | NULL); | ||||
| } | } | ||||
| else { | else { | ||||
| lcache->cube_tx.tex = GPU_texture_create_nD(lcache->cube_tx.tex_size[0], | lcache->cube_tx.tex = GPU_texture_create_nD(lcache->cube_tx.tex_size[0], | ||||
| lcache->cube_tx.tex_size[1], | lcache->cube_tx.tex_size[1], | ||||
| lcache->cube_tx.tex_size[2], | lcache->cube_tx.tex_size[2], | ||||
| 2, | 2, | ||||
| lcache->cube_tx.data, | lcache->cube_tx.data, | ||||
| GPU_R11F_G11F_B10F, | GPU_R11F_G11F_B10F, | ||||
| GPU_DATA_10_11_11_REV, | GPU_DATA_10_11_11_REV, | ||||
| 0, | 0, | ||||
| false, | false, | ||||
| NULL); | NULL); | ||||
| } | } | ||||
| GPU_texture_bind(lcache->cube_tx.tex, 0); | |||||
| GPU_texture_mipmap_mode(lcache->cube_tx.tex, true, true); | |||||
| for (int mip = 0; mip < lcache->mips_len; mip++) { | for (int mip = 0; mip < lcache->mips_len; mip++) { | ||||
| GPU_texture_add_mipmap( | GPU_texture_add_mipmap( | ||||
| lcache->cube_tx.tex, GPU_DATA_10_11_11_REV, mip + 1, lcache->cube_mips[mip].data); | lcache->cube_tx.tex, GPU_DATA_10_11_11_REV, mip + 1, lcache->cube_mips[mip].data); | ||||
| } | } | ||||
| GPU_texture_unbind(lcache->cube_tx.tex); | GPU_texture_mipmap_mode(lcache->cube_tx.tex, true, true); | ||||
| } | } | ||||
| return true; | return true; | ||||
| } | } | ||||
| bool EEVEE_lightcache_load(LightCache *lcache) | bool EEVEE_lightcache_load(LightCache *lcache) | ||||
| { | { | ||||
| if (lcache == NULL) { | if (lcache == NULL) { | ||||
| return false; | return false; | ||||
| ▲ Show 20 Lines • Show All 979 Lines • Show Last 20 Lines | |||||