Search Issue Tracker

By Design

Votes

0

Found in

5.0.0f2

Issue ID

673327

Regression

No

Shader preprocessor ignores Unity platform defines

Shaders

-

How to reproduce:

1. Open new project
2. Import attached shader into project
3. Place two planes one above another
4. Create a material using the imported shader
- The shader appears to be a simple distance-based blur
5. Open the shader
6. Go to line 78
7. Adjust the code under the #else statement to produce slightly different results (for example, change 0.5 to 0.6) and save the shader
8. Return to the Editor and observe the changes
9. Build to OSX/Win standalone and run
- Notice how the #elif statements were ignored and the shader produces the same result in standalone as in the editor
- The the #if and #elif statements appear to work fine, as simply using 1 or 0 produces expected results.
- The platform defines match the ones in http://docs.unity3d.com/Manual/PlatformDependentCompilation.html

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.