Forum begins after the advertisement:


Problem with getting the Underwater Effect working in the YouTube short

Home Forums Video Game Tutorial Series Creating an Underwater Survival Game in Unity Problem with getting the Underwater Effect working in the YouTube short

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #11984
    Gaetoush
    Level 1
    Participant
    Helpful?
    Up
    0
    ::

    I am working with the water creation video on Unity however by following this one perfectly I do not have the expected result I’m supposed to have a fog or at least a semblance of water but I only have water and not its contents underneath. I show you this just below and tell me what the solutions are thank you again.

    #11985
    Terence
    Level 30
    Keymaster
    Helpful?
    Up
    0
    ::

    Hi Gaetoush, there are a few things you want to check:

    1. You need to start Play-in-Editor for the effect to show up. In your recorded video, your game doesn’t seem to be playing.
    2. Ensure that you have a child GameObject under the Water Body. This GameObject should contain a plane that is facing downwards, opposite of the direction of your Water Body’s surface, and it should be assigned to the Water Surface layer.
    3. Make sure your Water Body GameObject is set to be under the Water layer. This isn’t mentioned in our video.
    4. Another thing that isn’t mentioned in the video is the Depth Layers property under the CameraUnderwaterEffect component needs to be set to select everything except the Water layer. See the screenshot below for reference.

    Let me know if this helps!

    #12051
    Gaetoush
    Level 1
    Participant
    Helpful?
    Up
    0
    ::

    Hello thank you for helping me I return the changes you advised me (I tried to show you the changes made) however even when launching my game, it did not change anything

    #12067
    Terence
    Level 30
    Keymaster
    Helpful?
    Up
    0
    ::

    Hi Gaetoush,

    In your CameraUnderwaterEffect.cs script, can you remove the following lines and see if the effects apply?

        //This is where the image effect is applied
        private void OnRenderImage(RenderTexture source, RenderTexture destination)
        {
            if (material && inWater)
            {
                //Update the depth render texture
                depthCam.Render();
    
                //We pass the information to our material
                material.SetColor("_DepthColor", depthColor);
                material.SetFloat("_DepthStart", depthStart);
                material.SetFloat("_DepthEnd", depthEnd);
    
                //Apply to the image using blit
                Graphics.Blit(source, destination, material);
            }
            else
            {
                Graphics.Blit(source, destination);
            }
        }
    #16606
    A_DONUT
    Level 6
    Moderator
    Helpful?
    Up
    0
    ::

    Is the doubt solved or do u need more assistance?

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Go to Login Page →


Advertisement below: