-
Notifications
You must be signed in to change notification settings - Fork 73
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
Update Unity Version to 2021.3 LTS #63
Conversation
if (_applyDistortionShader == null || renderingData.cameraData.cameraType == CameraType.Reflection) return; | ||
if (_applyDistortionShader == null | ||
|| renderingData.cameraData.cameraType == CameraType.Reflection | ||
|| renderingData.cameraData.cameraType == CameraType.Preview) |
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.
ShaderGUI描画時のcameraTypeがPreviewで、その場合CameraColorTarget中身のRTが空になり、エラーになるので、それの回避判定を追加しました。
ConfigureTarget(_renderTargetRTHandle); | ||
#else | ||
ConfigureTarget(_renderTargetIdentifier); | ||
#endif | ||
ConfigureClear(ClearFlag.Color, Color.gray); |
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.
@S20817
シーンの深度バッファをセットしなくなっているため、DISTORTIONの処理で深度テストが効かなくなってしまっています。
DISTORTIONはシーンに設置されている板ポリに遮蔽されている箇所に発生するのが正しい挙動だと思われますが、遮蔽されていなくても、DISTORTIONが起きるようになってしまっています。
添付している動画を参照してください。
(DistortionオブジェクトはMainCameraの下にあるので動かして確認してください。)
Bug-DistortedUvBufferPass.mp4
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.
修正しました。
2023-09-26.12.23.14.mov
8424210
to
5cc208c
Compare
@@ -41,15 +41,17 @@ public void Setup(RenderTargetIdentifier renderTargetIdentifier) | |||
} | |||
#endif | |||
|
|||
public override void Configure(CommandBuffer cmd, RenderTextureDescriptor cameraTextureDescriptor) | |||
public override void OnCameraSetup(CommandBuffer cmd, ref RenderingData renderingData) |
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.
DepthTargetをFeatureを介して設定するよりもカメラから直接取得した方がいいと思うので、ConfigureTargetの処理をConfigureからOnCameraSetupに移動しました。
作業概要
作業項目
確認
TodoRTHandle対応後に、ScreenDIstortionUVをつける場合、マテリアルGUI描画する時なぜかNullエラーが出てしまいます。原因まだ調査中で、Runtimeに影響しないため、とりあえず応急処置だけをしました。