-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
SSRPass: Correct Reflector depth. #21403
Conversation
70f9e4c
to
084c80c
Compare
084c80c
to
c11f194
Compare
scope.resolution = options.resolution || new Vector2( window.innerWidth, window.innerHeight ); | ||
|
||
scope._isDistanceAttenuation = ReflectorForSSRPass.ReflectorShader.defines.isDistanceAttenuation | ||
Object.defineProperty(scope, 'isDistanceAttenuation', { |
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.
How is isDistanceAttenuation
used?
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.
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.
Then I think the property should be called distanceAttenuation
.
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.
OK. Shall I change all variables prefixed with is
: isOtherMeshes
, isGroundReflector
, isPerspectiveCamera
, isFresnel
, isDistanceAttenuation
, isOtherMeshes
, isBouncing
, isInfiniteThick
, isBlur
, isSelecctive
to their none-is
-prefixed version?
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.
I looked at several examples with gui
, found really no setting name prefixed with 'is', and feel need ensure consistency, so I renamed all words prefixed with is
.
In addition, renamed all defines
to uppercase.
a867a86
to
a3b9ea2
Compare
Make `defines` all uppercase.
a3b9ea2
to
c83b90f
Compare
Sorry, seems like we introduced conflicts. |
Resolved. |
Thanks! |
Previously, a hack was used to adjust
maxDistance
to lettDepth
at the default camera distance has a relatively stable value. However, after changing the camera distance, the value oftDepth
will also change.Now the correct way to calculate
tDepth
is used, so that there is a stable value in any situation.But at the trade off of turned off Oblique Near-Plane Clipping feature, because of it distort
tDepth
severely, and I feel need more long time to learn how to compensate it.Any way, the Oblique Near-Plane Clipping is just used to fix the issue when something in bettwen
virtualCamera
andReflector
, for this demo scene and manygroundReflector
s, I think it's not a problem and correcttDepth
is more important. I'll keep research how to compensate.Before:
After: