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

Single-pass instanced rendering support #16

Open
Nirv-git opened this issue Mar 12, 2024 · 1 comment
Open

Single-pass instanced rendering support #16

Nirv-git opened this issue Mar 12, 2024 · 1 comment

Comments

@Nirv-git
Copy link

I was curious if would be possible for you to add Single-pass instanced rendering support to this shader.

Some explanation is that VR applications need the image rendered in stereo. The older method is to use Multi-pass rendering, while Single-pass instanced has some more performance enhancements. This grass shader works great in the old multi-pass, just not Single-pass. It is still using the Build-in Render Pipeline, just needs some accommodations in the shader code.

With more basic shaders I have been able to go through the Unity documentation below and make the modifications myself, mostly just adding macros to the correct spots. However I am very much not a shader dev and have been finding it a challenge to make the correct changes to this one.

I'd be happy to toss you a tip/ko-fi for your efforts.

Some documents on applying these changes to custom shaders
https://docs.unity3d.com/Manual/SinglePassInstancing.html
https://github.com/cnlohr/shadertrixx/tree/main?tab=readme-ov-file#add-instancing-support
https://github.com/cnlohr/shadertrixx/tree/main?tab=readme-ov-file#tessellation-shader-examples

More about Stereo rendering and how to test with MockHMD https://docs.unity3d.com/Manual/SinglePassStereoRendering.html

How the shader currently looks in Single-pass instanced, it is correct in the main eye (left) but not the right
image

@Velorexe
Copy link
Owner

Interesting, I'll take a look at it! Can't guarantee that I can come with results, since I'm not a shader dev myself either XD
I'll let you know once I've made some progress or if I have some findings on the matter.

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

No branches or pull requests

2 participants