U 3.0 Surface shaders preprocessor

Hi

Is this possible to use preprocessor commands in surface shader?

I wrote test shader (shows black or white color) using preprocessor, but it seemed to don’t see any definitions made with Shader.EnableKeyword. Adding proper #pragma multicompile didn’t helped.

Is it possible, or maybe will be in futere releases?

Hej Rychu,
in theory it should work, but currently it doesn’t seem to. We’ll look into it and let you know when it’s fixed.

Thanks for replay, it would be great to have that working.

Will be fixed in next Unity release!

Can anybody confirm that this works now? Because it seems it still doesn’t.

edit: it does.
Here’s the answer: