cone shadows done

This commit is contained in:
2023-02-12 21:27:04 +03:00
parent 728c4a85ed
commit e3389bcc20
11 changed files with 142 additions and 88 deletions

View File

@@ -36,7 +36,8 @@ RendererBase::RendererBase(QGLView * view_)
, buffer_lights(GL_UNIFORM_BUFFER, GL_STREAM_DRAW)
, buffer_lights_pos(GL_UNIFORM_BUFFER, GL_STREAM_DRAW)
, textures_empty(GL_RGBA, false)
, textures_maps(GL_RGBA, true) {
, textures_maps(GL_RGBA, true)
, shadow_maps_cone(GL_R32F, false) {
textures_manager = new TextureManager(view);
maps_size = QSize(1024, 1024);
maps_hash = 0;
@@ -60,6 +61,7 @@ void RendererBase::initTextureArrays() {
textures_empty.load(f, im, emrWhite);
im.fill(0xFF8080);
textures_empty.load(f, im, emrBlue);
shadow_maps_cone.init(f);
}
@@ -223,6 +225,7 @@ void RendererBase::reloadLightsParameters(const QMap<int, QList<Light *>> & ligh
so.decay_intensity[1] = l->decay_linear;
so.decay_intensity[2] = l->decay_quadratic;
so.decay_intensity[3] = l->intensity;
so.flags = l->cast_shadow ? 1 : 0;
}
buffer_lights.bind(view);
buffer_lights.resize(view, cur_lights_params_.size() * sizeof(QGLLightParameter));