MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / Init

Method Init

Source/Graphics/lightprobecollection.cpp:134–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132}
133
134void LightProbeCollection::Init() {
135 if (cube_map_fbo == INVALID_FRAMEBUFFER) {
136 Graphics::Instance()->genFramebuffers(&cube_map_fbo, "light_probe_cube_map");
137 }
138 if (!cube_map.valid()) {
139 cube_map = Textures::Instance()->makeCubemapTexture(128, 128, GL_RGBA16F, GL_RGBA, Textures::MIPMAPS);
140 }
141 Textures::Instance()->SetTextureName(cube_map, "Light Probe Collection Cubemap");
142 probe_model_id = Models::Instance()->loadModel(HardcodedPaths::paths[HardcodedPaths::kLightProbe]);
143 if (!light_probes.empty()) {
144 tet_mesh_needs_update = true;
145 }
146 light_probe_texture_buffer_id = -1;
147 light_probe_buffer_object_id = -1;
148 grid_texture_buffer_id = -1;
149 grid_buffer_object_id = -1;
150}
151
152void LightProbeCollection::Dispose() {
153 Graphics::Instance()->deleteFramebuffer(&cube_map_fbo);

Callers

nothing calls this directly

Calls 6

genFramebuffersMethod · 0.80
makeCubemapTextureMethod · 0.80
SetTextureNameMethod · 0.80
validMethod · 0.45
loadModelMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected