#Water Shader with fog and outline help please!
1 messages ยท Page 1 of 1 (latest)
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
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.
so i dont use the fog in the lighting settings?
You still use that. The Fog node is what you need in an unlit graph to support those fog settings
Like so?
I think so, but test it and see if it looks correct
Ah yes, it's lava now ๐
Do you know how to fix? haha
Sorry was answering other questions, am opening a project now to test but it takes a while to open ๐ฌ
Sure no problem, I can send you this graph too?
Atm just going to test the fog so don't really need the graph. I have a similar water shader already anyway
Hm that's a bit weird. I just tried using the Lerp the same way and it seems to work ๐ค
Ah, that's because the fog node has changed in v12
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)