URP / HDRP pay only the feature u use

Any plan to make URP / HDRP truly modular feature that u can toggle on/off to make it truly only pay for the feature u using. I believe until now it’s still not the case that even u toggle off it still pay the same performance cost for a lot of features. Any plan to change that? It’s also the initiative to make extend / modify URP / HDRP without needing to make the package at local and do local modification.

From what I think, one of solution to do that is when user toggles off a feature u can add a scripting define symbol to complete strip all the code that is part of the feature. But still I think it needs better implementation to make it dun need to strip code to achieve the same result as domain reload is really annoying. Seems like it’s really hard to achieve this goal if not rewrite the oop codebase to switch to dots codebase for URP, HDRP and SRP.

This is something that we always think about when writing features. Most of the time when we can save the runtime cost when a feature is disabled we will do so. Do you have any specific example in mind?

Also one thing to keep in mind is that compiling out each feature if it’s not used has a significant maintenance and complexity cost. If we did that for every feature, we’d need to test every single combination separately which is not doable in practice. Also, when a feature has shader code, it would also need to be compiled out which means more shader variants. This is a very hard balance to maintain between runtime cost and maintenace/build time so we need to be very careful.
However we do take feedback and bug reports so if anything seems to have too much cost when disabled then please report it to us so that we can take a look.

1 Like