Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
7
Question by SparrowKing · May 25, 2016 at 02:40 PM · water

Pink water

Whenever I place water in the terrain it becomes this pink texture. Is there a way to fix that? I just started using Unity Yesterday (free version)

Comment
Add comment · Show 7
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image designedaudio · May 25, 2016 at 03:59 PM -2
Share

I have the same issue with the water assets.

avatar image Marshall1956 designedaudio · May 25, 2016 at 11:34 PM 0
Share

FYI - Better to not put this as an Answer, but as a comment.

avatar image kieselsteine · Jun 02, 2016 at 04:50 PM -1
Share

i have the same problem

avatar image kieselsteine kieselsteine · Jun 02, 2016 at 04:59 PM 0
Share

I have these three errors;

Severity Code Description Project Project Rank File Line Column Category Source Suppression State Tool Error Shader error in 'FX/Water': undeclared identifier 'unity_Object2World' at line 80 (on d3d11)

Compiling Vertex program with WATER_REFRACTIVE Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING Solution 'sch2' ‎(2 projects) 3 0 0 IntelliSense

Severity Code Description Project Project Rank File Line Column Category Source Suppression State Tool Error Shader error in 'FX/SimpleWater4': undeclared identifier 'unity_ObjectToWorld' at line 130 (on d3d11)

Compiling Vertex program with WATER_REFLECTIVE WATER_VERTEX_DISPLACE$$anonymous$$ENT_ON WATER_EDGEBLEND_ON Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING Solution 'sch2' ‎(2 projects) 3 0 0 IntelliSense

Severity Code Description Project Project Rank File Line Column Category Source Suppression State Tool Error Shader error in 'FX/Water': undeclared identifier 'unity_ObjectToWorld' at line 80 (on d3d11)

Compiling Vertex program with WATER_REFRACTIVE Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING Solution 'sch2' ‎(2 projects) 3 0 0 IntelliSense

avatar image kieselsteine kieselsteine · Jun 02, 2016 at 05:04 PM 0
Share

I am not a programmer English is not my language Can anyone fix this?

avatar image Awengerr kieselsteine · Jun 02, 2016 at 05:33 PM 0
Share

In first error u must delete unity word at line 80 in monodevelop and just leave '_Object2World' In second you must find that shader in monodevelop it will be in water4 folder and replace 'unity_ObjectToWorld' at line 130 to "_Object2World" In third error find that FX/Water open in monodevelop and do like in second error but at line 80 I think that should help but im not a programmer and English is not my first language too.

avatar image matthew_craig · Jul 27, 2016 at 04:58 PM 0
Share

This worked for me, but there are in fact several lines of code in each water "shaders" file that need to be re-worked. The key is to save after each change and check the console error report again and again. It will list the next line of code with an error until, finally, you have fixed it.

1 Reply

· Add your reply
  • Sort: 
avatar image
27
Best Answer

Answer by Marshall1956 · May 25, 2016 at 11:33 PM

I have had the same problem.

I Import the Standard Assets>Environment.

Under Standard Assets>Environment>Water>Water>Prefabs>WaterProDaytime select and drag onto scene. The round water object appears in the scene as a pink circle (mine is (16,1,16) in size).

The WaterProDaytime game object is added. In the Inspector it has components Transform, Water Plane Mesh (Mesh Filter), Mesh Renderer, Water (Script), material WaterProDaytime.

The material WaterProDaytime is pink. It has a Shader FX/Water.

The FX/Water Shader is the problem.

Find the FX/Water Shader in the Assets. It is found in Standard Assets>Environment>Water>Water>Shaders>FXWaterPro. Select this. In the Inspector it has Default Maps, Imported Object FX/Water.

Under Imported Object FX/Water there is Compiled code with a button "Compile and show code". If you click Compile and show code, I get multiple error messages, basically all the same:

  'unity_ObjectToWorld' : undeclared identifier     opengl 80
 undeclared identifier 'unity_ObjectToWorld'        d3d9    80

etc.

Double click the FXWaterPro icon in the Project folder you found above. This opens script FXWaterPro.shader in MonoDevelop. The first line of the script is:

   1  // Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'


Notice that the error messages relate to '_Object2World'. If you search the code for 'unity_ObjectToWorld' you will find it in only one place:

 80 float4 wpos = mul (unity_ObjectToWorld, v.vertex);

Just replace unity_ObjectToWorld with _Object2World:

 80 float4 wpos = mul (_Object2World, v.vertex);

Save the script (Ctrl-S). Go back to Unity and now your water is working!

Both WaterProDaytime and WaterProNighttime use the same FX/Water shader.

If someone knows why the Upgrade replaces the text as above, I would like to know. If there are undesirable effects caused by the renaming I would also like to know. I haven't tried to publish any projects, but it works in the editor.

I have Unity Personal (64bit) version 5.3.4f1 Personal

Comment
Add comment · Show 14 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Awengerr · Jun 02, 2016 at 10:34 AM 0
Share

Thanks for help, but i had also problem with FXWaterBasic.shader i just do the same thing like in FXWaterPro.shader in $$anonymous$$onoDevelop.

First line of FXWaterBasic.shader:

 // Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'

In line 43 just replace

 float4 wpos = mul (unity_ObjectToWorld, v.vertex);

to:

 float4 wpos = mul (_Object2World, v.vertex);

I think this resolve problem for these water shaders for now.

avatar image MauroSK8 · Jun 04, 2016 at 06:45 AM 0
Share

you guys are genius!!! thank you so much! I was desperated and you fixed it thanks a lot!!!

@$$anonymous$$gerr and @$$anonymous$$arshall1956

now all of my water prefabs are working perfectly! and my scene is looking great thanks to you... cause water gives just a really great touch!!!

avatar image Raditz_X_RAG3 · Jun 20, 2016 at 01:00 AM 0
Share

Thank you, this problem was driving me nuts, along with lag problems from DX11. Unity 5 is still seriously bugged all around, and the devs shouldn't even consider it stable right now.

avatar image Delicious_Mitesh Raditz_X_RAG3 · Jul 12, 2016 at 09:54 AM 0
Share

Thankyou so much.

avatar image ayanpike · Jun 24, 2016 at 08:24 PM 0
Share

THIS DOES NOT WOR$$anonymous$$. I REPEAT. THIS DOES NOT WOR$$anonymous$$. UNITY, YOU $$anonymous$$UST FIX THIS OR LOSE CUSTO$$anonymous$$ERS!

avatar image lucas216erickson · Jun 27, 2016 at 11:09 PM 0
Share

I tried the suggested solution, but I just get the same error: "Shader error in 'FX/Water': undeclared identifier 'unity_Object2World' at line 80 (on glcore)

Compiling Vertex program with WATER_REFRACTIVE Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING SHADER_API_DES$$anonymous$$TOP"

Neither "ObjectToWorld" or "Object2World" work! Please help.

avatar image Awengerr lucas216erickson · Jun 28, 2016 at 08:29 AM 0
Share

Delete unity in monodevelop its must be _Object2World not unity_Object2World it's a difference

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

75 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Basic Water shader error message 6 Answers

Particles on Water 0 Answers

Cartoon Water shader for endless platform. 0 Answers

Water Asset is missing? Wanting to add a puddle to my scene. 2 Answers

Refraction issue with water in shader forge. 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges