53 GL_CHECK(glTexStorage2D(GL_TEXTURE_CUBE_MAP, mipmap_fp16 ?
int(log2(
float(size))) + 1 : 1, GL_RGBA16F, size, size));
54 GL_CHECK(glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
55 GL_CHECK(glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, mipmap_fp16 ? GL_LINEAR_MIPMAP_NEAREST : GL_LINEAR));
63 float start = 6500000.0f;
64 float end = 7000000.0f;
66 GL_CHECK(glUniform1f(3, (end - start) / steps));
68 GL_CHECK(glBindImageTexture(0,
tex, 0, GL_TRUE, 0, GL_WRITE_ONLY, GL_RGBA16F));
69 GL_CHECK(glDispatchCompute(size / 8, size / 8, 6));
70 GL_CHECK(glMemoryBarrier(GL_ALL_BARRIER_BITS));
75 GL_CHECK(glGenerateMipmap(GL_TEXTURE_CUBE_MAP));
GLuint common_compile_compute_shader_from_file(const char *cs_source)
const T::data_type * value_ptr(const T &vec)
void generate(unsigned size, vec3 sun_dir)
bool common_has_extension(const char *ext)
GLenum GLuint GLintptr GLsizeiptr size