Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
6
Question by Marnix · Apr 15, 2011 at 03:16 PM · waterpro

Water3Example has strange refraction

I created a very simple scene with a few cubes, spheres and the water 3 example. I also set as much settings to off as possible. Bug somehow, the refraction that is left looks like a skewed reflection. I am certain that it is NOT the reflection, because the reflection is turned off. And when I turn it on, there are 2 reflections in the water. One is correct, the other one the skewed one.

strange refraction

The settings are as follows:

settings

So:

  • Reflection is off
  • The waves are off
  • small waves are off
  • Fresnel is off

These settings are just for testing.

The image in the water looks like a mirrored image of the scene, but it's definitely no reflection. Which looks like this. There are three ellipsoids now:

with reflection

What is wrong? How do I fix this? There is only one camera in my scene.


Update
Although @Statement gives a very good description of what is wrong, it is not an answer to the question. If someone reads this question: please consider the answer of @Statement as an addition to this question. I'm still looking for an answer. Is this really a bug in the Water3 Example?

Comment
Add comment · Show 1
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 Wibbs 1 · Apr 15, 2011 at 03:31 PM 0
Share
  • for a really clear, well laid out question and screenshots

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Statement · Apr 16, 2011 at 01:29 PM

Hey, odd effect. So refraction is the one thing that become wrong? I don't have that shader, nor pro, so I can't tell exactly what is wrong. To me, it looks as if the refraction rays bounce off in the wrong direction (they seem to bounce back up, instead of bounce into the surface interior).

alt text

This suggest an issue with either the way the refraction is calculated in the shader, or the normals somehow end up incorrect (either vertex or bumps), or it somehow render the back side of the water mesh.

What you could try is make sure you don't use a cube for the water mesh, and if you do, make sure the bottom is obscured with some other mesh like the terrain. You can also try turn off any bump maps or anything else that may alter the normal of the surface.

However, since the reflection also use normals, it's hard to argue that the normals would be incorrect since if they were, the reflection would also be wrong, but the reflection seems to work just fine.

I am puzzled :)


Comment contents:

I took the "refracted" image and flipped it vertically. It's hard to tell from the small image but close up you see that all pixels are placed identically, which wouldn't been the case if the projection was skewed or rendered from another point of view. To me, it seems it is a mirrored version of the viewport to the pixel.

Refracted mirrored

Left version is the scene above water. Right version is the refraction of the water.

Close up

Close up on the closest ball with a yellow cube (?) behind it. Similar pixels suggest same view is used.

Comment
Add comment · Show 7 · 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 Statement · Apr 16, 2011 at 01:32 PM 0
Share

By the way, what does the refraction fix checkbox do?

avatar image Marnix · Apr 16, 2011 at 04:15 PM 0
Share

@Statement. It does do something different. I will post an example of it next friday, but it doesn't fix it.

avatar image Marnix · Apr 16, 2011 at 04:21 PM 0
Share

@Statement. The normals should be correct indeed. Reflection goes fine. Also: The mesh i'm using is a default mesh (a circle) from the example. The water3example can be used in the free edition as well.

avatar image Statement · Apr 16, 2011 at 04:32 PM 0
Share

Hm, it can? But it looks like there's some render-to-texture going on :P

avatar image Marnix · Apr 17, 2011 at 09:33 AM 0
Share

Yes it can, but it doesn't show you all features. I think it will look ugly, but at least a working example is presented. Actually, the texture used looks like the exact mirroring of the main viewport, don't you think?

Show more comments
avatar image
0

Answer by HolBol · Jun 26, 2011 at 09:39 PM

Hey, you told me to have a look, so yeah! You need one separate material for each instance of water you have- this usually fixes the bug! So just duplicate the material, and assign it to your other water. I hope this helps you.

Comment
Add comment · Show 5 · 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 HolBol · Jun 26, 2011 at 09:41 PM 0
Share

Wait, ignore that. Try putting in a blank static cubemap and see what happens.

avatar image Marnix · Jun 26, 2011 at 09:55 PM 0
Share

Huh? This is already a static cubemap that is assigned to the camera. How blank do you need it? You mean that you want me to clear the camera with a solid color? I only have one water instance in the example above. So there is only one water instance.

avatar image HolBol · Jun 26, 2011 at 10:03 PM 0
Share

in your inspector screenshot, the static cubemap field is empty.

avatar image Marnix · Jun 26, 2011 at 10:06 PM 0
Share

Ah good one, but I hope that that's not the problem, because I am going to use UniSky in my project, so that would mean that I can't reflect the actual weather in my game when I want to use Water3. I'll try this soon and come back to you with my findings.

avatar image Marnix · Jun 28, 2011 at 02:39 PM 0
Share

@Fishman92 This doesn't fix it. There is no difference on my problem if I add it. There is something wrong with the refraction texture of the water, but I can't find where this is drawn.

avatar image
0

Answer by LeeGibson · Jun 28, 2011 at 02:16 PM

if you turn the Fresnel power to zero the fake reflection should be gone.

at least that worked out for me; don't know what the fresnel should be doing instead of those weird reflections.

Comment
Add comment · Show 1 · 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 Marnix · Jun 28, 2011 at 02:37 PM 0
Share

@LeeGibson This doesn't solve the problem, because there will be no refraction left. Fresnel is the lerp factor between refraction and reflection. What is true, is that there is something wrong in the refraction model.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

GUI & Water don't show up in web player (Water3Example) 2 Answers

Water from Unity 3.3 doesnt works on Unity 3.4 2 Answers

Water for Android OS (Tegra Tango) 0 Answers

Unity Pro Water Bug 0 Answers

Unity 3 Pro Water bugs 3 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