Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] VRWaterShader : Simple, VR compatible, Easy and good looking water.

Discussion in 'Assets and Asset Store' started by synqark, Jan 30, 2018.

  1. synqark

    synqark

    Joined:
    Jun 5, 2017
    Posts:
    4
    --------------------------------
    1.1 : Addtional Shader Varieties :
    • ZWrite : avoid Z bug each mesh faces
    • GLES30 : Compatible for OpenGL ES3.0
      (tessellation feature was replaced by vertex offset feature. Sorry! )
    1.0 : Initial Release!
    --------------------------------

    VRWaterShader is simple shader, that focused to output water and liquid-like surfaces.

    Include following features:
    - PBR(BaseColor+Tex, Metallic, Gross)
    - Only one shader to run.
    - SinglePass Stereo Rendering support. (That is why I'm saying 'VR')
    - Two Height&Normal map as Waterwave
    - Supports Tessellation.
    - Screen Space Refraction Support (and configurable strength each distance from camera)
    - Additional Cubemap for ambient light.


    (no underwater effects. sorry!!)



    [Reserved for another Youtube Preview ><]

    [Reserved for Screenshots. ><]

    Contact: virtually.synqarks@gmail.com
    https://twitter.com/synqark

    Thank you for reading. :)
     
    Last edited: Feb 21, 2018
  2. psychicvrlab

    psychicvrlab

    Joined:
    Oct 29, 2014
    Posts:
    14
    Hi,
    I purchased the water asset. It's really good.

    It works well with Windows app and VR. I tried to use it with WebGL environment, but it doesn't work with WebGL. Would it be possible to make it available for WebGL?
     
  3. psychicvrlab

    psychicvrlab

    Joined:
    Oct 29, 2014
    Posts:
    14
    I guess "Target renderes" on Shader Forge matters, but I don't know how to fix it.
     

    Attached Files:

    • sf.png
      sf.png
      File size:
      275.4 KB
      Views:
      1,160
  4. synqark

    synqark

    Joined:
    Jun 5, 2017
    Posts:
    4
    Thank you for be interested in my assets.
    I'll try to run in WebGL environments correctly. but It may take a few days.
    ( bcz I don't have enough knowledge about WebGL and OpenGL.):(
     
  5. synqark

    synqark

    Joined:
    Jun 5, 2017
    Posts:
    4
    I found it. but tessellation feature need to be omitted

    upload_2018-2-14_23-6-33.png

    Please Cut Tessellation nodes. and Connect Vertex Offset instead of Displacement.
    upload_2018-2-14_23-8-57.png

    Then we're able to set target renderers including OpenGL ES 3.0
    upload_2018-2-14_23-10-19.png

    Thank you for you information!
    I'll add this shader (VRWaterShader/GLES ?) next update.
     
    psychicvrlab likes this.
  6. synqark

    synqark

    Joined:
    Jun 5, 2017
    Posts:
    4
    version 1.1 is out!
     
  7. GreggBzz

    GreggBzz

    Joined:
    Nov 29, 2016
    Posts:
    2
    Hi There,

    I'm using Unity 2017.4. I purchased this shader, and it does work as advertised, but only on prefab meshes like a plane.

    Any procedural mesh I apply the materials to renders black. Here is code I made for a simple procedural quad:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class SimpleMesh : MonoBehaviour {
    6.     private Vector3[] vertices = new Vector3[4];
    7.     private Vector2[] uv = new Vector2[4];
    8.     private Vector3[] normals = new Vector3[4];
    9.     private int[] triangles = new int[6];
    10.     private GameObject aSimpleMesh;
    11.  
    12.     // Use this for initialization
    13.     void Start () {
    14.         vertices[0].x = 0; vertices[0].y = 5; vertices[0].z = 0;
    15.         vertices[1].x = 0; vertices[1].y = 5; vertices[1].z = 1;
    16.         vertices[2].x = 1; vertices[2].y = 5; vertices[2].z = 1;
    17.         vertices[3].x = 1; vertices[3].y = 5; vertices[3].z = 0;
    18.  
    19.         triangles[0] = 0; triangles[1] = 1; triangles[2] = 2;
    20.         triangles[3] = 0; triangles[4] = 2; triangles[5] = 3;
    21.  
    22.         uv[0].x = 0; uv[0].y = 0;
    23.         uv[1].x = 0; uv[1].y = 1;
    24.         uv[2].x = 1; uv[2].y = 1;
    25.         uv[3].x = 1; uv[3].y = 0;
    26.  
    27.         aSimpleMesh = new GameObject("aSimpleMesh");
    28.         aSimpleMesh.AddComponent<MeshFilter>();
    29.         aSimpleMesh.AddComponent<MeshRenderer>();
    30.         aSimpleMesh.GetComponent<MeshFilter>().mesh.vertices = vertices;
    31.         aSimpleMesh.GetComponent<MeshFilter>().mesh.triangles = triangles;
    32.         normals = aSimpleMesh.GetComponent<MeshFilter>().mesh.normals;
    33.         for (int i = 0; i <= normals.Length - 1; i++) {
    34.             normals[i] = new Vector3(0, 1, 0);
    35.         }
    36.         aSimpleMesh.GetComponent<MeshFilter>().mesh.normals = normals;
    37.         aSimpleMesh.GetComponent<MeshFilter>().mesh.uv = uv;
    38.         aSimpleMesh.GetComponent<MeshFilter>().mesh.RecalculateBounds();
    39.     }
    40.  
    41.     public Vector3[] GetNormals() {
    42.         return normals;
    43.     }
    44.  
    45.     public Vector3[] GetVerts() {
    46.         return vertices;
    47.     }
    48.     public int[] GetTris() {
    49.         return triangles;
    50.     }
    51.     public Vector2[] GetUv() {
    52.         return uv;
    53.     }
    54. }
    55.  
    When applying the Day material to my simple quad, it renders black. The mesh looks identical in the inspector to any simple prefab mesh created in unity, like a plane or a spheres etc.

    Here's a screen shot from above. You can see my small quad mesh renders black. But below, a prefab plane mesh renders the material fine.

    upload_2018-4-20_21-58-6.png


    I don't understand why this is happening, and it's quite a shame since my project is almost entirely procedural.

    synqark, Maybe you can help me out! Thanks!
     
  8. GreggBzz

    GreggBzz

    Joined:
    Nov 29, 2016
    Posts:
    2
  9. ItzMorphineTime

    ItzMorphineTime

    Joined:
    Jun 24, 2017
    Posts:
    1
    Please can you help me fix this issue:


    Code (CSharp):
    1. Shader error in 'VRWaterShader/Standard': syntax error: unexpected token ';' at line 563 (on d3d11)
    2.  
    3. Compiling Vertex program with UNITY_PASS_FORWARDADD SPOT LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF
    4. Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR
    5.  
     
  10. bzor

    bzor

    Joined:
    May 28, 2013
    Posts:
    35
    are there plans to make this work in 2018? thanks!
     
  11. Lilcolombian

    Lilcolombian

    Joined:
    Jun 1, 2017
    Posts:
    15
    @synqark I just purchaced you asset pack and am having some issues with the water, I am using it for a Oculus VR scene and I see a strange reflection from the osean as if there is a 2nd plane parented to my headset. If you could help me out it would be appreciated
     
  12. Lilcolombian

    Lilcolombian

    Joined:
    Jun 1, 2017
    Posts:
    15
    Wanna correct and say the issue was caused by having the HDR setting on the camera to off. siwtching to "USE GRAPHICS SETTINGS" cleared the strange reflection plane.
    if there are some other settings I should be aware of I would appreciate any info
     
  13. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,450
    Any chance of an Oculus Quest/Go compatible version? Curious what prevents it from working on those platforms

    Edit: I ended up making my own with Shader Graph in UniversalRP
     
    Last edited: May 28, 2020
    pdnellius likes this.
  14. HaMrDev

    HaMrDev

    Joined:
    Nov 4, 2019
    Posts:
    7
    hold uppp the asset doesnt show on unity asset store it says 404
     
  15. davidandrade89

    davidandrade89

    Joined:
    Mar 11, 2020
    Posts:
    4
    Can I try yours out?