-
Notifications
You must be signed in to change notification settings - Fork 36
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
base: master
Are you sure you want to change the base?
Extract AO and VoxelGenerator from SphereRenderer #1202
Conversation
…mbientOcclusion()
|
Style check found formatting issues! Comment |
/format |
Hint: it's a bit weirdly squished in Y
|
||
bool megamol::compositing_gl::AO::recreateResources(void) { | ||
|
||
auto const& ogl_ctx = frontend_resources.get<frontend_resources::OpenGL_Context>(); //TODO necessary? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove if not used.
// 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); |
There was a problem hiding this comment.
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.
GLuint texture_handle; | ||
GLuint vertex_array_; | ||
GLuint vbo_; |
There was a problem hiding this comment.
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?
Extract parts of the SphereRenderer into seperate modules
Summary of Changes
New modules
Test Instructions
Use the following project to test the new modules (remove ".txt")
AO.lua.txt