#Water Shader with fog and outline help please!

1 messages ยท Page 1 of 1 (latest)

sterile lantern
#

Hello! Start of thread!

#

here is the shader graph, and the problem

#

The water is giving an outline over everyhthing it intersects with, which isnt what i want, and how do i also make the fog effect the water?

#

The fog is just the standard unity fog under the lighyting setrtings

obsidian acorn
#

I don't typically use fog but I think there is a Fog node that you can use to handle that, it returns the Colour and Intensity. I think then it's just a Lerp with A set to the Fog Colour, B set to the current Base Colour output and T set to the Fog Intensity.

sterile lantern
#

so i dont use the fog in the lighting settings?

obsidian acorn
sterile lantern
#

Like so?

obsidian acorn
#

I think so, but test it and see if it looks correct

sterile lantern
#

Something isnt quite right ๐Ÿ˜…

obsidian acorn
#

Ah yes, it's lava now ๐Ÿ˜†

sterile lantern
#

Do you know how to fix? haha

obsidian acorn
#

Sorry was answering other questions, am opening a project now to test but it takes a while to open ๐Ÿ˜ฌ

sterile lantern
#

Sure no problem, I can send you this graph too?

obsidian acorn
#

Atm just going to test the fog so don't really need the graph. I have a similar water shader already anyway

obsidian acorn
#

Ah, that's because the fog node has changed in v12

sterile lantern
#

my shader graphi is 10.5.1

#

unity version 2020.3.14f1

obsidian acorn
# sterile lantern my shader graphi is 10.5.1

Okay for older versions should be able to use a Custom Function containing :

#ifdef SHADERGRAPH_PREVIEW
    Out = In;
#else
    Out = MixFog(In, Fog);
#endif

inputs : "In" (Vector3) and "Fog" (Float)
outputs : "Out" (Vector3)
Put your current Base Color in the In, and Density output from the Fog node into the Fog input.

#

As for your white outlines btw, I think it could be related to anti-aliasing (MSAA). Turning it off on the URP asset might fix it. May have to only use the post-process based AA solutions on the Camera (FXAA / SMAA)

sterile lantern
#

thank youu!, I'll try the AA now too

#

Removing AA from the URP asset (lessoned?) it, But its still there