Skip to content
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

fix wireframe #67

Merged
merged 4 commits into from
Feb 4, 2024
Merged

fix wireframe #67

merged 4 commits into from
Feb 4, 2024

Conversation

takahiro0327
Copy link
Contributor

I attempted to fix #37.
When checked with KKS/KK/HS2, the wireframe did not render and blue screened.

Before:
failedh2

A game-specific fix for Illusion was needed.
CameraClearFlags was not needed and certain post-effects needed to be disabled.
However, I can imagine that some games may require CameraClearFlags.

After:
ok

What should I do with this code?
Should I check the process name or something to separate the processes?
If it is not good for applications other than Illusion, then we can discard this code.

@takahiro0327 takahiro0327 marked this pull request as draft February 4, 2024 07:53
@ManlyMarco
Copy link
Owner

It definitely needs testing in other games as well, the issue happens outside of Illusion games too. As long as it's not causing a dependency on specific games then it's fine to add.

@takahiro0327
Copy link
Contributor Author

Other games... I only have Insult Order...

Do you know of any games where CameraClearFlags had to be set?

This problem seems to be caused by a post-effect using CameraClearFlags.Depth that has been changed to CameraClearFlags.Color.
Why did you set CameraClearFlags.Color to clearFlags?

@takahiro0327
Copy link
Contributor Author

InsultOrder has been improved.

Before:
image

After:
image

@takahiro0327
Copy link
Contributor Author

My fix wasn't working with the character maker.
image

They switched the skin mesh depending on the exposure of the clothes. Amazing.
image
image
image
image

@ManlyMarco
Copy link
Owner

ManlyMarco commented Feb 4, 2024

Do you know of any games where CameraClearFlags had to be set?

It was added in a12e903, I don't remember what game exactly had issues but it was most likely one of Illusion games, likely AI-Girl or HS2. Why not keep the fix and add it to CameraWithWireframe?

@takahiro0327
Copy link
Contributor Author

If I add the following code, Maker will be normalized, but Studio will be ruined.

_camera.clearFlags = CameraClearFlags.Color;

Some cameras use CameraClearFlags.Depth. That would not work properly.
image
image

@takahiro0327 takahiro0327 marked this pull request as ready for review February 4, 2024 17:46
@takahiro0327
Copy link
Contributor Author

Please review.

Maybe this will work.
I turn off the color adjustment effect so the wire color changes a little. Other than that, it should be fine.
It was necessary to wait at least 2 frames after turning off the effect before registering the event.

I'm tired...

image
image
image
image

Copy link
Owner

@ManlyMarco ManlyMarco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I made some minor changes to clean it up a bit in case someone has to fix it again in the future.

@ManlyMarco ManlyMarco merged commit 6edca28 into ManlyMarco:master Feb 4, 2024
@takahiro0327
Copy link
Contributor Author

Thanks for refactoring!

@mricher-git
Copy link
Contributor

Just tested on RailRoader and wireframe unfortunetly still not working.

@takahiro0327
Copy link
Contributor Author

Oops.
Did that work in the previous version?

@mricher-git
Copy link
Contributor

Oops. Did that work in the previous version?

I just got Railroader so I'm not sure. I can try previous version and let you know.

@mricher-git
Copy link
Contributor

Oops. Did that work in the previous version?

Can confirm it didn't work before in 5.1.0 either.

@takahiro0327
Copy link
Contributor Author

Sorry, but I do not have that game and will not buy it for this issue. If it was working on an earlier version, I would have thought about it for a minute.
If you make a PR I can help you test it on a game I have. If you make a PR, let me know via mention.

@mricher-git
Copy link
Contributor

Railroader uses URP and onPreRender/onPostRender aren't called in that pipeline.

@ManlyMarco The reference assemblies in RUE don't include URP members, how would one go about solving this, or is it not possible?

@ManlyMarco
Copy link
Owner

It has to be done with reflection since older unity versions don't have URP.

@takahiro0327 takahiro0327 deleted the fix_wireframe branch March 21, 2024 04:20
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.

[HS2] Wireframe broken in Studio
3 participants