imagination XD

realizing dream

[Tutorial] Fake Water Reflection on Unity Indie

3 Comments

I found this trick when i’m playing with Unity Water (Basic). I’m going to show you how to make a semi-realistic Water reflection on Unity indie.

  1. First of all, make a model. You can just use Cube or Import Assets from Unity > Unity Water (Basic).
  2. After that, make a new material and choose : Reflective > Parallax Specular
  3. Set all the shader setting like the picture above. Main Color (133,133,133), Specular Color (255,255,255), Reflection Color (95,95,95).
  4. And then, choose a cubemap. If you want more realistic, you can download the RenderCubemapWizard here. If you use RenderCubemapWizard, copy it to the Editor folder in your project asset folder (if you don’t have an Editor folder, create a new one with “Editor” folder name).
  5. On project tab, click Create > Cubemap
  6. Click GameObject > Render into Cubemap, drag the water object to the “Render from position”, and drag your cubemap to “Cubemap”. And click Render.
  7. Then, click your water material and then drag your cubemap to Cubemap properties. Not really reflective ? Adjust the brightness of Reflection Color.
  8. Launch photoshop to make Normal Map and Heighmap. You can download nVidia Normal Map here. If you don’t have photoshop, you can use SSSBump here.
  9. Open your water texture to photoshop. Click Filters > NVidia > Normal Map Filter. Adjust the scale. I just set it to 15.
  10. Save it. Open it again (Original, not normal filtered). Click Image > mode > Grayscale. Click CTRL + I to invert. Save it.
  11. Open Unity. Drag your Normal Map texture to Normal Map Properties. If Unity rants about Normal map tag, just click Fix now. Drag your Alpha texture to Heightmap properties. Unity will not rant about tag. But you have to set it “Alpha from grayscale”. You can adjust the height.
  12. And now for the movement script.
  13. Click Create > New Javascript > I name it as “WaterMover.js”
  14. #pragma strict
    var scrollSpeed = 0.25;
    function FixedUpdate(){
     var offset = Time.time * scrollSpeed;
     renderer.material.mainTextureOffset = Vector2(0,-offset);
     renderer.material.SetTextureOffset("_BumpMap", Vector2(0,-offset));
     }

     

  15. Attach that script to Water. And see it moves.

Later i’ll research about Caustic and Transparent > Reflective Parallax Specular.

Advertisements

Author: IMGVERTEX

Started making games since 13 year old. 3D CGI Weeaboo | VFX Otaku | Anime Researcher | Indie Game Dev | VR Chuunibyou

3 thoughts on “[Tutorial] Fake Water Reflection on Unity Indie

  1. Pingback: [Research] Unity Underwater Caustic Effect | imagination XD

  2. Pingback: +++ Unity Cubemap Quick Reflection Test +++ | 26:PM ➜ Josiah Munsey

  3. Pingback: [Shader] Reflective Transparent / Water-like Unity Indie | imagination XD

FEED ME

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s