Defined g-buffer index constants to make it easier for users to add their own g-buffers #8106
+35
−14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please read the Contributing guide before making a PR.
Checklist for PR maker
need-backport-*
label. After you backport the PR, the label changes tobackported-*
. (I don't think this is necessary. It's a cleanup, not a fix)CHANGELOG.md
file. (Is this worth mentioning in the changelog? It's not a bug fix nor a new feature. I'll add it if you think I should.)Purpose of this PR
Why is this PR needed, what hard problem is it solving/fixing?
I'm a user and I tried adding a custom g-buffer to URP and it was a real pain 😂 I did a few small changes to make it easier to add a gbuffer and have the other g-buffer indices shift over correctly. I also added some comments to clarify things that I didn't understand, and I'm looking to share those for other users who wish to add g-buffers.
This is one half of changes that I made to my local version of URP to make it easier to expand
SurfaceData
. If this gets in, I would also like to open a PR with some small changes in shader code,SurfaceData
is initialized weirdly in a few places and that cost me a lot of hours to debug, and I think that can be solved elegantly, but this is my first contribution so let's take it one step at a time.Testing status
Describe what manual/automated tests were performed for this PR
I have triple-checked that all the values are the same as before, and I've created a test scene with both static & dynamic objects, baked lighting, and then turned a bunch of render pipeline features on and off and checked that all the g-buffers kept working correctly.
That's about as much as I could think of, but if you have any suggestions for other things to test I will happily take a look.
Comments to reviewers
It's my first contribution. I read the README and contribution guidelines but I was a bit confused about where to branch from & where to merge to exactly, so I set it to Draft so we can maybe check that first.
Thank you for your consideration 🙏
By the way I talked to @UnityAljosha during the Office Hours event on Discord and he gave me permission to open a PR for this.