PavelDoGreat / Super-Blur

Screen and UI gaussian blur for Unity
MIT License
843 stars 107 forks source link

World-space UI #3

Open wilg opened 7 years ago

wilg commented 7 years ago

Looks like this doesn't work on worldspace UI. Can you point me in the right direction to modifying this to work that way? (I'm not a shader expert by any stretch.)

PavelDoGreat commented 7 years ago

Sorry for being late. Try to use 2 cameras: one renders everything, except yout world-space ui, with blur and option "Only UI" enabled, second camera renders everything without blur.

I don't know if it works, just gave you some ideas.

artyom-zuev commented 6 years ago

To continue the subject - can you please explain a bit more how to use this with UI systems like NGUI (which can be considered "world-space", I suppose, since no UI tailored Unity functionality is used by it)? To be specific, here is the setup:

I have a couple of questions related to that setup:

https://i.imgur.com/CHkKOEN.gifv

I apologize for asking questions not specific to the stock UI system, but I'm hopeful I can get this wonderful asset to work with NGUI (especially since Unity UI was based on NGUI design).

artyom-zuev commented 6 years ago

I think I figured it out. There is one problem remaining (UVs are vertically flipped), but otherwise everything works wonderfully. To make the asset work with NGUI or any other world-space UI system, you need to do the following:

For some reason, blitting is broken in Edit mode - I don't know why, but blitting over UI quads results in pure black color no matter what you do, for as long as you are in Edit mode. Frame Debugger doesn't work correctly in Edit mode either, so I'm not sure what's up with that, but I'm glad everything works in play mode. :)

I'll set up a pull request with some improvements (global texture use instead of explicit reference to single UI material to allow multiple materials to participate in blurring; separate NGUI shader following all NGUI conventions like vertex color use, blending and so on; iOS-style saturation-based boost to blurred pixels etc.) a bit later. Thanks for the wonderful asset! :)

wilg commented 6 years ago

@artyom-zuev Any chance of that PR? Would love to try out those features.