Conversation
added 2 commits
October 17, 2022 17:22
Fedr
reviewed
Oct 17, 2022
| ivec2 texSize = textureSize( pixels, 0 ); | ||
| vec2 pos = gl_FragCoord.xy + shift; | ||
| vec2 pos = gl_FragCoord.xy; | ||
| if ( !convX ) |
Contributor
Author
There was a problem hiding this comment.
we use this shader for x convolution and for y convolution, shift can be applied only for one of them
Fedr
reviewed
Oct 17, 2022
source/MRViewer/MRGLStaticHolder.cpp
Outdated
| #define INV_QUALITY 0.33333334 | ||
| #define INV_NUM_SAMPLES 0.020833333 | ||
| const float gaussWeights[] = float[6] (0.923, 0.726, 0.4867, 0.278, 0.135, 0.056); | ||
| const float invNorm = 0.161046; |
Contributor
There was a problem hiding this comment.
can we divide gaussWeights on this beforehand?
Fedr
reviewed
Oct 17, 2022
source/MRViewer/MRGLStaticHolder.cpp
Outdated
| posShift = vec2(0.0,blurRadius /(6.0* float(texSize.y))); | ||
|
|
||
| float convSum = texture(pixels, pos).a; | ||
| for (int i=0;i<6;i=i+1) |
Fedr
reviewed
Oct 17, 2022
source/MRViewer/MRShadowsGL.cpp
Outdated
| GL_EXEC( glDisable( GL_MULTISAMPLE ) ); | ||
| #endif | ||
| sceneFramebuffer_.copyTexture(); | ||
| drawLowSize_(); // draw scene texture in low size for further convolve |
Fedr
reviewed
Oct 17, 2022
source/MRViewer/MRShadowsGL.cpp
Outdated
| GL_EXEC( glBindFramebuffer( GL_FRAMEBUFFER, copyFramebuffer_ ) ); | ||
|
|
||
| GL_EXEC( glBindTexture( GL_TEXTURE_2D, resTexture_ ) ); | ||
| GL_EXEC( glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, size.x, size.y, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL ) ); |
Contributor
There was a problem hiding this comment.
Can we reduce code by using GlTexture2 here?
Fedr
reviewed
Oct 17, 2022
source/MRViewer/MRShadowsGL.h
Outdated
| float blurRadius{ 40.0f }; | ||
| // value that describes blur quality, blur texture downscaling coefficient | ||
| // (0,1] 1 - is maximum quality, but it can affect performance on embedded systems | ||
| // 0.25 - recomended value |
Fedr
approved these changes
Oct 18, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.