Announcement

Collapse
No announcement yet.

Help with a water shader?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help with a water shader?

    I have found a glsl water shader online and I was wondering if anyone could remake it in blueprints and materials, Whats nice is it is all generated so no repeating textures or waves. I would do this myself but I'm still not that good with materials.

    Link to the GLSL code is here: https://www.shadertoy.com/view/Ms2SD1

    #2
    Have you seen the Community Ocean Project? It might meet your needs.

    If not, that shader looks like it would need some custom code anyway, so it would be quicker and easier to convert the code itself. Luckily, HLSL and GLSL are very similar. To convert between them you pretty much just need to replace a few type/function/variable names. Here's a short guide. Give your HLSL shader a .usf extension. Put it in Epic Games/4.x/Engine/Shaders/ Open MaterialTemplate.usf in the same folder and add a line to include your shader file. Now, if you use a custom node in the material editor, you can call functions from your shader. In the code field put something like "return functionname(x);" no quotes. Make sure the custom node's output type is the same as the function, and that it has the same number of inputs, with the same names, as the function.

    Comment


      #3
      I'm using that currently, its horrible quality. I've seen it made in ue4 but he didn't release source

      Comment


        #4
        Quality of an ocean isn't dependent upon using the custom node or not. You could rebuild this whole network using just a few custom nodes and worldspace/vec(x)parameters. If you are not getting the results you are wanting, perhaps there is an issue with implementation? Or perhaps the wave count/size/speed variance is not properly set?

        Could you post a bit more of your current work so that we could see what it is exactly that you are struggling with?

        -Jeremy-
        Portfolio
        UE3 - Advanced FX Masterclass Part 1 DVD
        UE3 - Advanced FX Masterclass Part 2 DVD

        Comment

        Working...
        X