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

A proper way to do viewmodels #7071

Open
Xenthio opened this issue Nov 28, 2024 · 3 comments
Open

A proper way to do viewmodels #7071

Xenthio opened this issue Nov 28, 2024 · 3 comments

Comments

@Xenthio
Copy link

Xenthio commented Nov 28, 2024

What can't you do?

We're still unable to create proper viewmodels that self shadow and do all the things we could do in the entity system

How would you like it to work?

A new render layer? really any way, you probably have better ideas than me.

What have you tried?

I've tried

  1. Multiple cameras (breaks post processing)
  2. Implementing it myself (Cant get them to self shadow without casting shadows on the ground)
  3. Using overlay layer (same as above)

Additional context

No response

@timmybo5
Copy link

I've found a workaround to allow post processing while having a view model camera, until we have a proper solution it might be able to help you out.
#4827 (comment)

@Xenthio
Copy link
Author

Xenthio commented Nov 28, 2024

I've found a workaround to allow post processing while having a view model camera, until we have a proper solution it might be able to help you out. #4827 (comment)

oh yeah i used a similar trick in one of the game jam submissions i worked on, it doesn't solve that the viewmodel camera method is unfortunately laggy

@Retroeer
Copy link

Overlay layer also doesn't have a nice way of doing separate FoV, opposed to the camera method where you can just crank the FoV slider. You can do some scaling shennanigans to emulate the effect of FoV, but if you're bonemerging arms onto a weapon, scaling by non-uniform values just spaghettifies the bonemerged model.
My solution has been just taking @timmybo5's workaround and then applying an async delay to it,

        ViewModelCamera.ClearFlags = ClearFlags.Stencil | ClearFlags.Depth | ClearFlags.Color;
        _ = Task.DelaySeconds(0.001f).ContinueWith(_ => { ViewModelCamera.ClearFlags = ClearFlags.Stencil | ClearFlags.Depth; });

Don't get me wrong, this fucking sucks, but it's been better than the alternative (atleast for my use case)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To triage
Development

No branches or pull requests

3 participants