Final touches in MW volume.

This commit is contained in:
Jonathas Costa
2019-11-13 15:36:13 -05:00
parent caa02ca20a
commit aaa73415e9
3 changed files with 6 additions and 3 deletions

View File

@@ -25,8 +25,7 @@ local MilkyWayVolumeGalaxy = {
Filename = data .. "/MilkyWayRGBAVolume1024x1024x128.raw",
Dimensions = {1024, 1024, 128},
Size = {1.2E21, 1.2E21, 0.15E21},
Steps = 480,
Downscale = 0.5,
Downscale = 0.4,
},
Points = {
Type = "Points",

View File

@@ -112,6 +112,7 @@ private:
void applyTMO(float blackoutFactor);
void applyFXAA();
void updateDownscaleColorTexture();
void updateExitVolumeTextures();
void writeDownscaledVolume();
std::map<VolumeRaycaster*, RaycastData> _raycastData;

View File

@@ -560,10 +560,14 @@ void FramebufferRenderer::writeDownscaledVolume() {
glEnablei(GL_BLEND, 0);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glDisable(GL_DEPTH_TEST);
glBindVertexArray(_screenQuad);
glDrawArrays(GL_TRIANGLES, 0, 6);
glBindVertexArray(0);
glEnable(GL_DEPTH_TEST);
_downscaledVolumeProgram->deactivate();
// Restores blending state
@@ -1212,7 +1216,6 @@ void FramebufferRenderer::performRaycasterTasks(const std::vector<RaycasterTask>
}
if (raycaster->downscaleRender() < 1.f) {
float scaleDown = raycaster->downscaleRender();
glViewport(0, 0, _resolution.x, _resolution.y);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, _gBuffers.framebuffer);
writeDownscaledVolume();