Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract AO and VoxelGenerator from SphereRenderer #1202

Open
wants to merge 45 commits into
base: master
Choose a base branch
from

Conversation

OliviaOdenthal
Copy link

Extract parts of the SphereRenderer into seperate modules

  • Ambient Occlusion
  • Volumetexture generation

Summary of Changes

New modules

  • AO module (computes ambient occlusion in a deferred rendering pass)
  • VoxelGenerator module (computes a volume texture for sphere particle datasets)

Test Instructions

Use the following project to test the new modules (remove ".txt")
AO.lua.txt

image
image

@geringsj geringsj requested review from invor and geringsj June 27, 2023 13:26
@geringsj
Copy link
Contributor

  • Move voxelization to compute shader?
  • How to streamline Graph Snippets, i.e. adding deferred pipeline?

@github-actions
Copy link

github-actions bot commented Jul 5, 2023

Style check found formatting issues! Comment /format, to automatically commit the suggested changes.

@geringsj
Copy link
Contributor

geringsj commented Jul 5, 2023

/format


bool megamol::compositing_gl::AO::recreateResources(void) {

auto const& ogl_ctx = frontend_resources.get<frontend_resources::OpenGL_Context>(); //TODO necessary?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove if not used.

Comment on lines +374 to +380
// Draw screen filling 'quad' (2 triangle, front facing: CCW)
std::vector<GLfloat> vertices = {-1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, -1.0f, 1.0f, 1.0f};
GLuint vert_attrib_loc = glGetAttribLocation(this->lighting_prgm_->getHandle(), "inPosition");
glEnableVertexAttribArray(vert_attrib_loc);
glVertexAttribPointer(vert_attrib_loc, 2, GL_FLOAT, GL_TRUE, 0, vertices.data());
glDrawArrays(GL_TRIANGLES, static_cast<GLint>(0), static_cast<GLsizei>(vertices.size() / 2));
glDisableVertexAttribArray(vert_attrib_loc);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should suffice to do the quad preparation once before rendering, instead of every frame.

Comment on lines +99 to +101
GLuint texture_handle;
GLuint vertex_array_;
GLuint vbo_;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make things easier to use glowl helpers here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants