Skip to content

OrthographicSSRPass (screen space reflection) - #20061

Closed
gonnavis wants to merge 49 commits into
mrdoob:devfrom
gonnavis:OrthographicSSRPass
Closed

gonnavis wants to merge 49 commits into
mrdoob:devfrom
gonnavis:OrthographicSSRPass

Conversation

@gonnavis

@gonnavis gonnavis commented Aug 13, 2020 •

Copy link
Copy Markdown
Contributor

Demo Demo2
Inspired by Blender EEVEE SSR, and this tut ( mostly by the two screen grid images imgA imgB, I only read a little text and hardly read the code, then start writing my own code. )
Now just support OrthographicCamera. I'm trying to support PerspectiveCamera.

----------------EDIT 2----------------
Now support PerspectiveCamera. New PR: #20156

----------------EDIT----------------
Demo ScreenShot
clipboard

@mrdoob

mrdoob commented Aug 13, 2020 •

Copy link
Copy Markdown
Owner

Thanks for working on this!

Is this how's supposed to look like?

Screen Shot 2020-08-13 at 4 22 03 PM

Also, it runs at ~5fps on my machine (MacBook Pro, Intel).

@gonnavis

gonnavis commented Aug 13, 2020 •

Copy link
Copy Markdown
Contributor Author

Hello Mr.doob

Yes, it is. I've already added the screenshot to the pr.
I know it's not look very well now, may need more advaced blur or anti-alias, and SSR has own limitations.
But I'm already satisfied with this reflection feeling.
My main goal now is to support PerspectiveCamera, after this, I will do in-depth study with the looking improvement.

I can run at 30fps at my win7 laptop with GTX 980M about 40% usage and 1920*1080 chrome maximized window.
The performance cost by the shader is mainly based on pixels count. May Mac retina monitor has too many pixels?
I'll consider these factors.

@gonnavis

gonnavis commented Aug 17, 2020 •

Copy link
Copy Markdown
Contributor Author

I found out that antialas was turned on and dpr was set before.
If turn them off, can reach about 12fps on Mac when the window is maximized.
If stepStride is set to 2, it can run to about 28fps.
Demo Demo2
Mac configuration

@Mugen87

Mugen87 commented Aug 17, 2020

Copy link
Copy Markdown
Collaborator

On my iMac I get only about 10 FPS which is definitely to low. Apart from the performance aspect, the visual appearance of the pass still looks buggy.

@gonnavis

Copy link
Copy Markdown
Contributor Author

Yes, I just want to mention that the performance of this pass is not that bad on mac. I'll keep improving.

@gonnavis

Copy link
Copy Markdown
Contributor Author

@mrdoob Hello Mr.doob

After use depthTexture instead of depthRenderTarget, the quality has been greatly improved.

I think it might be worth a second review now.

Demo

clipboard

@mrdoob

mrdoob commented Aug 21, 2020

Copy link
Copy Markdown
Owner

Nice! It is looking much better indeed!

@mrdoob

mrdoob commented Aug 21, 2020

Copy link
Copy Markdown
Owner

Would it be hard to make this work with PerspectiveCamera too?

@gonnavis

gonnavis commented Aug 21, 2020 •

Copy link
Copy Markdown
Contributor Author

@gonnavis

gonnavis commented Aug 21, 2020 •

Copy link
Copy Markdown
Contributor Author

After just calc the distance from viewPosition to reflectRay using pointToLineDistance function, instead of calc the reflectRay position at this pixel, I think perspectiveCamera support is almost OK.

But it need more adjustments ( some may be already done in OrthographicSSRPass ), I'll keep improving.

Perspective Demo

aaa

@gonnavis

Copy link
Copy Markdown
Contributor Author

After solving an obvious problem under the PerspectiveCamera, I think the SSRPass is ready to use.
So no need for OrthographicSSRPass now, I made a new PR #20156 .

@mrdoob

mrdoob commented Aug 24, 2020

Copy link
Copy Markdown
Owner

This one can be closed then?

@gonnavis

gonnavis commented Aug 24, 2020 •

Copy link
Copy Markdown
Contributor Author

Yes, I'll merge these codes to SSRPass #20156.

@mrdoob mrdoob closed this Aug 24, 2020
@mrdoob mrdoob removed this from the rXXX milestone Aug 24, 2020
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