-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
SSR Post Filter #1144
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
SSR Post Filter #1144
Conversation
applying approximateNormals on filter creation
riccardobl
left a comment
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.
Thanks for taking the time to adapt this to jme filters.
I see that you have replaced some macros with uniforms, if there is no specific reason for doing that, i suggest to switch them back (using the Defines { } block in j3md) because they are generally faster (no memory access) and allow compile time optimization.
Also, i made this patch at some point, that fixed some artifacts that were caused by wrong depth linearization riccardobl/SimpleSSRShader@f0e91a9 .
… with macros(!) reapplied depth linearization fix removed the test scene
|
I replaced the macros to allow as much runtime tweaking as possible (since the filter probably needs to be adapter to different use cases). But performance is everything, so I switched back (and added even more macros for the blur pass). If anyone wants to tweak in runtime they'll need to reinit the materials to see the changes). |
jme3-effects/src/main/java/com/jme3/post/filters/SsrFilter.java
Outdated
Show resolved
Hide resolved
jme3-effects/src/main/java/com/jme3/post/filters/SsrFilter.java
Outdated
Show resolved
Hide resolved
|
I noticed that the blur is meant to be run over several passes. I'll try to implement that as well |
|
added new technique for rendering world normals + glossiness in pbrlighting |
jme3-effects/src/main/resources/Common/MatDefs/SSR/normal_gloss.vert
Outdated
Show resolved
Hide resolved
|
The current pre pass only uses vertex normals. Would it make sense to read the normal map if available? Or make that a HQ option? Or is it simply not worth the cost since the roughness map will take care of the details? |
|
Yes, i think it should, otherwise the result won't be much different from the approximated normals. |
|
All right, I think that's it? Thanks for reviewing this feature. The filter would have been crap otherwise. |
|
Do you have a test scene that uses the PBRLighting? |
|
Yeah. I removed the one i committed because a simple isnt really
representative. So i've been testing with a scene from work which is
complex.
…On Fri, Aug 2, 2019, 14:57 Riccardo Balbo ***@***.***> wrote:
Do you have a test scene that uses the PBRLighting?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1144?email_source=notifications&email_token=AB46MQWXDKJP7JRIE5NR3UTQCQVLBA5CNFSM4IC2R7BKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3NVFFI#issuecomment-517690005>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB46MQUHH7JMQBE2NEJUB5LQCQVLBANCNFSM4IC2R7BA>
.
|
|
I noticed that approxNormals = false didn't work on the master branch, whereas it worked on my somewhat obsolete local branch. Some digging led to a difference in Instancing.glsllib mine: the latter works just as expected, but the master version leads to the wrong perspective. PBRLighting and relevant shaders in effects are identical. I've changed (not pushed) normal_gloss.vert to: Thoughts?
|
|
Mh, actually the master version should be the correct one... i've also noticed some pretty bad artifacts when you move the camera away, i'll have to take a look at this more carefully and maybe move the raytracing to screenspace while i'm at it. I hope it is not a problem if i keep this unmerged for a while until i have the time to look into it. |
|
Any progress on this? Otherwise I suggest we merge it to avoid it rotting away. What's there works quite well on short to medium distances. Merging would allow anyone to refactor it in the future. |
|
@riccardobl What artifacts? Can you take a screenshot? |
|
FYI: I've pushed this to a separate repo: https://github.com/neph1/SsrFilter |
SSR Filter based on: https://github.com/riccardobl/SimpleSSRShader/
Some liberties taken when restructuring it.
Consider skipping testScene.j3o. Might just clutter an already cluttered testData project?
Some artifacts remain. Unsure which are due to SSR in general, the original shader and my implementation